Ld: framework not found Cocoa

When using latest SDL2 from svn I get this error in xcode link stage:
ld: framework not found Cocoa

I am using xcode 8.3 on latest mac os and cmake 3.80 rc4.

Any clue how to solve this issue?

Are your xcode command line tools installed standalone?
kiss_sdl - Simple generic GUI widget toolkit for SDL2 https://github.com/actsl/kiss_sdl

Im not sure what you mean, they were installed when I first opened xcode and clicked yes. I am not a mac user so I don’t know what you mean by separately.

Just a thing I forgot to mention, I am ticking all the static options for SDL inside CMake, could that be a problem? I mean my goal is to make a single app and static is how I would do it on windows.

Does if work if you compile this empty C program and link it with Cocoa?

echo "int main(int argc, const char **argv) {return 0;}" > cocoatest.c
clang cocoatest.c -o cocoatest -framework Cocoa

If that fails, maybe try running xcode-select --install.

Runs no problem, no error, no output in the terminal. With my project if I manually go into the build settings and extra link flags, if I take out these everything compiles and links fine: -framework Carbon -framework Cocoa -Wl,–no-undefined
I replace the last one with -Wl,-undefined,error and it all works. Is the SDL cmakelists script up to date? no idea why I can get rid of Cocoa and it still compiles and links successfully.

So it turns out xcode has “Link frameworks automatically” option so SDL doesn’t need to do anything. Now I need to figure out how to make the SDL cmakelists not add any frameworks or that --no-undefined thing. :frowning:.

Well I got this fixed just by manually editing the cmakelists file. Not sure where to report this to SDL as a bug.

Not sure where to report this to SDL as a bug.

If you could drop a note about this at https://bugzilla.libsdl.org/,
I’ll take a look.



Submitted the bug, thanks.

1 Like