[tsc-devel] Re: First try at porting to Mac, and a linker error
datahead |
Tue, 06 Oct 2015 21:43:32 UTC
Post via forum by datahead <…9@x…>:
@Tobbi, as Quintus said, Secret Chronicles uses SDL1 and not SDL2 (which I know is what Super Tux uses). It makes sense to first double check this if you have not done so.
This forum suggests things must be done differently on Mac as opposed to Linux - http://forums.macrumors.com/threads/library-not-found-for-lsdlmain.1495793/:
[quote]There are differences in how SDL is packaged on Linux and Mac OS X. The Mac version of SDL is a framework, not a library. When using the -lSDLmain flag on Mac OS X, you're going to get a link error because the Mac version of SDL does not have a library named SDLmain.[/quote]
For make files, they then suggest:
[quote]remove the -lSDLmain linker flag. Use the -framework flag to link the SDL and Cocoa frameworks[/quote]
Of course, we need to do things through CMakeLists.txt in TSC.
These two forum entries:
http://stackoverflow.com/questions/9646055/cmake-sdl-on-mac-os-x-cant-find-lsdlmain
http://www.4byte.cn/question/2114531/cmake-sdl-on-mac-os-x-can-t-find-lsdlmain.html
...suggest that the following CMakeLists.txt statement may be needed to resolve the problem. I did not find it with a text search in our own CMakeLists.txt file:
[code]
link_directories( /opt/local/lib )
[/code]
I would try experimenting with that and see what effects it has.
Here they also suggest double checking if you have secondary SDL libraries: https://groups.google.com/forum/#!topic/gravit/v_DI08EbAPo
These are the packages I had to install when installing it in Ubuntu 12:
libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl-image1.2-dev
--
Sent by Chessboard.