-
-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clang error when compiling on OS X (Mavericks) #13
Comments
Hi and thank you for your feedback. It seems your environment isn't properly configured and can't find libSDLmain.a By the way, if you installed Netbeans you can just open and run the project with the IDE instead of running make, but that won't fix your problem though. Check this link for the installation and configuration of SDL: http://stackoverflow.com/questions/4591076/c-sdl-on-macosx-without-xcode This may solve your problem. |
Thanks for the quick answer! /bin/sh build-scripts/mkinstalldirs /home/user/SDL/bin I tried replacing the directory to my home dir and it installed succesfully. Now what do i do? I still get the same error when trying to compile GearBoy. Should I somehow add the SDL directory to the make process? |
Yes that guide assumes you have the SDL extracted on your home dir. Try this: go to library/frameworks/ and rename SDLmain to SDL Found here: http://uzebox.org/forums/viewtopic.php?f=9&t=532 |
The directory "~/Library/Frameworks/" doesn't exist, so i tried "/Library/Framework/" instead. The only SDL file is already called "SDL.framework" so i tried to rename it to "SDLmain.framework", but that didn't change anything... This might be what goes wrong: http://forums.macrumors.com/showthread.php?t=1495793 If it is any help, the libSDLmain.a is located at "/usr/local/lib/" and "/opt/local/lib/" and if I write "sdl-config --libs" in the terminal (from "~/"), it returns: "-L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa" I'm not sure if i installed SDL wrong... Can you give a little more detail on what you mean by: "Install and configure SDL for development."? |
I'm sorry but I can't remember the steps I took to install SDL on my Mac. |
I have tried doing everything from the readme again... I still can't get it to work. I will of cause make a post if I solve it myself. |
If you feel that I have to change something in the makefile or with the Netbeans project just tell me, or send me a pull request. I'll make my best to integrate you're findings so any other doesn't have to fix this again. If I have a chance I'll try with a clean environment too. Thanks |
I started today with a new Mac installation. I found that SDL 1.2 no longer compiles on Mavericks so I'm updating both Gearboy and Gearsystem to use SDL 2. SDL 2 compiled without any issues on my Mac and I was able to build Gearboy with the latest version of Netbeans so I'm closing this issue. Let me know if you have any further issues. |
I tried now on a completely new MacBook. NetBeans 7.4, Xcode 5, Qt 4.8.5 and SDL 2.0.1 installed successfully (I think). I still get the same error: ld: library not found for -lSDL2main Can you describe exactly how you installed SDL? I just moved the SDL2.framework to /Library/Frameworks |
Just followed the readme file for Mac and |
Now it works! Fantastic! :) I downloaded the SDL 2 ->source code<- and compiled it as you described. Maybe that should be more clear in the README-file if that is what you meant to do in the first place? |
Yes that's it, now you told me about the framework file I did realize about your error. |
I followed the guide from README.md for installing on Mac OS X. Netbeans, Xcode, Qt 4 and SDL installed correctly and i added qmake to PATH.
But when i try to compile it using:
make -f nbproject/Makefile-Release.mk SUBPROJECTS= .build-conf
I get the following error:
ld: library not found for -lSDLmain
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [dist/Release/CLang-MacOSX/Gearboy] Error 1
make: *** [.build-conf] Error 2
(Sorry I can't make a code-block, I'm new at GitHub)
The text was updated successfully, but these errors were encountered: