SDL 1.2 on MAC - Apple Mach-O Linker Error

Hi
I have an old project, c++ that is running on PC, also it was some time ago converted to iOS and Android, now I’m trying to run it on Mac. After some work sources compile properly but then I got linker error.

ld: warning: ignoring file /Users/sodigital/Desktop/gMac/branches/engine/external/MAC_2/SDL.framework/Versions/A/Resources/libSDL.dylib, file was built for unsupported file format ( 0x6C 0x69 0x62 0x53 0x44 0x4C 0x2D 0x31 0x2E 0x32 0x2E 0x30 0x2E 0x37 0x2E 0x31 ) which is not the architecture being linked (i386): /Users/sodigital/Desktop/gMac/branches/engine/external/MAC_2/SDL.framework/Versions/A/Resources/libSDL.dylib
Undefined symbols for architecture i386:
“_SDL_CreateCursor”, referenced from:
CursorManager::load() in CursorManager.o
“_SDL_Delay”, referenced from:
Base::endFrame(bool) in base.o
“_SDL_FreeSurface”, referenced from:
Base::initGraphics() in base.o
“_SDL_GL_GetAttribute”, referenced from:
Base::initGraphics() in base.o
“_SDL_GL_SetAttribute”, referenced from:
Base::initGraphics() in base.o
“_SDL_GL_SwapBuffers”, referenced from:
Base::endFrame(bool) in base.o
Base::initGraphics() in base.o
“_SDL_GetAppState”, referenced from:
Base::hasFocus() in base.o
Base::endFrame(bool) in base.o
“_SDL_GetKeyState”, referenced from:
Base::endFrame(bool) in base.o
“_SDL_GetVideoInfo”, referenced from:
Base::initGraphics() in base.o
“_SDL_Init”, referenced from:
Base::initSDLSystem() in base.o
“_SDL_LoadBMP_RW”, referenced from:
Base::initGraphics() in base.o
“_SDL_PollEvent”, referenced from:
Base::endFrame(bool) in base.o
“_SDL_PushEvent”, referenced from:
-[SDLApplication terminate:] in SDLMain.o
“_SDL_Quit”, referenced from:
Base::terminate(int) in base.o
Base::quitSDLSystem() in base.o
“_SDL_RWFromFile”, referenced from:
Base::initGraphics() in base.o
“_SDL_SetColorKey”, referenced from:
Base::initGraphics() in base.o
“_SDL_SetCursor”, referenced from:
CursorManager::render() in CursorManager.o
CursorManager::render(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) in CursorManager.o
“_SDL_SetVideoMode”, referenced from:
Base::initGraphics() in base.o
“_SDL_ShowCursor”, referenced from:
Base::onFocusLost() in base.o
Base::setEnableMouseCursor(bool) in base.o
“_SDL_WM_SetCaption”, referenced from:
Base::initGraphics() in base.o
Base::setWindowTitle(char const*) in base.o
“_SDL_WM_SetIcon”, referenced from:
Base::initGraphics() in base.o

I’m not sure if those warning are relevant or not. Any help?

That sounds like you are trying to link against a 64 bit library in a 32 bit compilation (or the other way arround).
Make sure your libs match your build system (x86 or x64).

~ mkalte

1 Like