# Link error on MacOSX

**URL:** <https://discourse.libsdl.org/t/link-error-on-macosx/19620>\
**Category:** SDL Development\
**Created:** [May 22, 2013, 10:33pm UTC](https://discourse.libsdl.org/t/link-error-on-macosx/19620 "2013-05-22T22:33:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mako\_energy](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/m/cab0a1/32.png) [@Mako\_energy](https://discourse.libsdl.org/u/Mako_energy)\
**Post date:** [May 22, 2013, 10:33pm UTC](https://discourse.libsdl.org/t/link-error-on-macosx/19620/1 "2013-05-22T22:33:15Z")

</div>

I am currently trying to do all the necessary touchups to my engine so I can get a working MacOSX port up and running. I have SDL being built through CMake which is integrated into the CMake configuration of my engine. SDL compiles just fine as a dependency, however when it attempts to link it errors in “SDL\_Log.c” saying it can’t find the symbol “\_SDL\_NSLog”. I have looked through the code and I found the method it’s talking about in “SDL\_cocoavideo.m”. As far as I can tell the project seems to be configured correctly for that files inclusion in the project.

What could be going wrong?

---

<div class="post-metadata">

**Author:** ![Gabriele\_Greco](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/8edcca/32.png) [@Gabriele\_Greco](https://discourse.libsdl.org/u/Gabriele_Greco)\
**Post date:** [May 24, 2013, 3:39pm UTC](https://discourse.libsdl.org/t/link-error-on-macosx/19620/2 "2013-05-24T15:39:45Z")

</div>

> \*\*  
> I am currently trying to do all the necessary touchups to my engine so I  
> can get a working MacOSX port up and running. I have SDL being built  
> through CMake which is integrated into the CMake configuration of my  
> engine. SDL compiles just fine as a dependency, however when it attempts to  
> link it errors in “SDL\_Log.c” saying it can’t find the symbol “\_SDL\_NSLog”.  
> I have looked through the code and I found the method it’s talking about in  
> “SDL\_cocoavideo.m”. As far as I can tell the project seems to be configured  
> correctly for that files inclusion in the project.

I’m quite sure I’ve had that problem too when trying to build with CMake on  
OSX, so after a few failed attempts to fix the CMakeLists.txt I switched  
back to build with autotools, the problem I had was that some of the .m  
files do not get complied also if they are correctly added in the  
respective directories… I thought it was some problem with my version of  
cmake and gave up since I had not a lot of time at the moment :)–  
Bye,  
Gabry

---

<div class="post-metadata">

**Author:** ![Doug1](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/doug1/32/2451_2.png) [@Doug1](https://discourse.libsdl.org/u/Doug1)\
**Post date:** [May 25, 2013, 11:56am UTC](https://discourse.libsdl.org/t/link-error-on-macosx/19620/3 "2013-05-25T11:56:21Z")

</div>

## – Options: – 3DNOW (Wanted: ON): OFF – ALSA (Wanted: OFF): OFF – ALSA\_SHARED (Wanted: OFF): OFF – ALTIVEC (Wanted: ON): OFF – ARTS (Wanted: OFF): OFF – ARTS\_SHARED (Wanted: OFF): OFF – ASSEMBLY (Wanted: ON): ON – ASSERTIONS (Wanted: auto): auto – CLOCK\_GETTIME (Wanted: OFF): OFF – DIRECTFB\_SHARED (Wanted: OFF): OFF – DIRECTX (Wanted: OFF): OFF – DISKAUDIO (Wanted: ON): ON – DUMMYAUDIO (Wanted: ON): ON – ESD (Wanted: OFF): OFF – ESD\_SHARED (Wanted: OFF): OFF – FUSIONSOUND (Wanted: OFF): OFF – FUSIONSOUND\_SHARED (Wanted: OFF): OFF – GCC\_ATOMICS (Wanted: OFF): OFF – INPUT\_TSLIB (Wanted: OFF): OFF – LIBC (Wanted: ON): ON – MMX (Wanted: ON): ON – NAS (Wanted: OFF): OFF – OSS (Wanted: OFF): OFF – PTHREADS (Wanted: OFF): OFF – PTHREADS\_SEM (Wanted: OFF): OFF – PULSEAUDIO (Wanted: OFF): OFF – PULSEAUDIO\_SHARED (Wanted: OFF): OFF – RENDER\_D3D (Wanted: OFF): OFF – RPATH (Wanted: OFF): OFF – SDL\_DLOPEN (Wanted: ON): ON – SSE (Wanted: ON): ON – SSE2 (Wanted: ON): ON – SSEMATH (Wanted: ON): ON – VIDEO\_COCOA (Wanted: ON): ON – VIDEO\_DIRECTFB (Wanted: OFF): OFF – VIDEO\_DUMMY (Wanted: ON): ON – VIDEO\_OPENGL (Wanted: ON): ON – VIDEO\_OPENGLES (Wanted: ON): OFF – VIDEO\_X11 (Wanted: OFF): OFF – VIDEO\_X11\_XCURSOR (Wanted: OFF): OFF – VIDEO\_X11\_XINERAMA (Wanted: OFF): OFF – VIDEO\_X11\_XINPUT (Wanted: OFF): OFF – VIDEO\_X11\_XRANDR (Wanted: OFF): OFF – VIDEO\_X11\_XSCRNSAVER (Wanted: OFF): OFF – VIDEO\_X11\_XSHAPE (Wanted: OFF): OFF – VIDEO\_X11\_XVM (Wanted: OFF): OFF – X11\_SHARED (Wanted: OFF): OFF– – CFLAGS: -g -O3 – EXTRA\_CFLAGS: -msse2 -msse -mmmx – EXTRA\_LDFLAGS: – EXTRA\_LIBS: m;iconv;/System/Library/Frameworks/Cocoa.framework;/System/Library/Frameworks/IOKit.framework;/System/Library/Frameworks/ForceFeedback.framework;/System/Library/Frameworks/Carbon.framework;/System/Library/Frameworks/CoreAudio.framework;/System/Library/Frameworks/AudioUnit.framework

## – Build Shared Library: ON – Build Static Library: ON

– Something was not detected, although your are sure that it  
– has been properly installed? Then make sure, you have set  
– the CFLAGS and LDFLAGS environment variables correctly.

dougs-Mac-mini:build doug$ ninja  
…  
[231/231] Linking C static library libSDL2.a  
dougs-Mac-mini:build doug$ ls  
CMakeCache.txt Makefile build.ninja  
include libSDL2.2.0.0.dylib libSDL2.dylib  
rules.ninja sdl2.pc  
CMakeFiles SDL2.spec cmake\_install.cmake  
libSDL2.0.dylib libSDL2.a libSDL2main.a sdl2-config

~  
Doug.

On Fri, May 24, 2013 at 11:39 PM, Gabriele Greco \<gabriele.greco at darts.it\>wrote:

> \*\*
> 
> > I am currently trying to do all the necessary touchups to my engine so I  
> > can get a working MacOSX port up and running. I have SDL being built  
> > through CMake which is integrated into the CMake configuration of my  
> > engine. SDL compiles just fine as a dependency, however when it attempts to  
> > link it errors in “SDL\_Log.c” saying it can’t find the symbol “\_SDL\_NSLog”.  
> > I have looked through the code and I found the method it’s talking about in  
> > “SDL\_cocoavideo.m”. As far as I can tell the project seems to be configured  
> > correctly for that files inclusion in the project.
> 
> I’m quite sure I’ve had that problem too when trying to build with CMake  
> on OSX, so after a few failed attempts to fix the CMakeLists.txt I switched  
> back to build with autotools, the problem I had was that some of the .m  
> files do not get complied also if they are correctly added in the  
> respective directories… I thought it was some problem with my version of  
> cmake and gave up since I had not a lot of time at the moment 🙂
> 
> –  
> Bye,  
> Gabry
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![Doug1](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/doug1/32/2451_2.png) [@Doug1](https://discourse.libsdl.org/u/Doug1)\
**Post date:** [May 25, 2013, 11:57am UTC](https://discourse.libsdl.org/t/link-error-on-macosx/19620/4 "2013-05-25T11:57:27Z")

</div>

(that’s off hg head; can’t comment on if it builds on any other snap shots  
or whatever)~  
Doug.

On Sat, May 25, 2013 at 7:56 PM, Doug \<@Doug1\> wrote:

> ## – Options: – 3DNOW (Wanted: ON): OFF – ALSA (Wanted: OFF): OFF – ALSA\_SHARED (Wanted: OFF): OFF – ALTIVEC (Wanted: ON): OFF – ARTS (Wanted: OFF): OFF – ARTS\_SHARED (Wanted: OFF): OFF – ASSEMBLY (Wanted: ON): ON – ASSERTIONS (Wanted: auto): auto – CLOCK\_GETTIME (Wanted: OFF): OFF – DIRECTFB\_SHARED (Wanted: OFF): OFF – DIRECTX (Wanted: OFF): OFF – DISKAUDIO (Wanted: ON): ON – DUMMYAUDIO (Wanted: ON): ON – ESD (Wanted: OFF): OFF – ESD\_SHARED (Wanted: OFF): OFF – FUSIONSOUND (Wanted: OFF): OFF – FUSIONSOUND\_SHARED (Wanted: OFF): OFF – GCC\_ATOMICS (Wanted: OFF): OFF – INPUT\_TSLIB (Wanted: OFF): OFF – LIBC (Wanted: ON): ON – MMX (Wanted: ON): ON – NAS (Wanted: OFF): OFF – OSS (Wanted: OFF): OFF – PTHREADS (Wanted: OFF): OFF – PTHREADS\_SEM (Wanted: OFF): OFF – PULSEAUDIO (Wanted: OFF): OFF – PULSEAUDIO\_SHARED (Wanted: OFF): OFF – RENDER\_D3D (Wanted: OFF): OFF – RPATH (Wanted: OFF): OFF – SDL\_DLOPEN (Wanted: ON): ON – SSE (Wanted: ON): ON – SSE2 (Wanted: ON): ON – SSEMATH (Wanted: ON): ON – VIDEO\_COCOA (Wanted: ON): ON – VIDEO\_DIRECTFB (Wanted: OFF): OFF – VIDEO\_DUMMY (Wanted: ON): ON – VIDEO\_OPENGL (Wanted: ON): ON – VIDEO\_OPENGLES (Wanted: ON): OFF – VIDEO\_X11 (Wanted: OFF): OFF – VIDEO\_X11\_XCURSOR (Wanted: OFF): OFF – VIDEO\_X11\_XINERAMA (Wanted: OFF): OFF – VIDEO\_X11\_XINPUT (Wanted: OFF): OFF – VIDEO\_X11\_XRANDR (Wanted: OFF): OFF – VIDEO\_X11\_XSCRNSAVER (Wanted: OFF): OFF – VIDEO\_X11\_XSHAPE (Wanted: OFF): OFF – VIDEO\_X11\_XVM (Wanted: OFF): OFF – X11\_SHARED (Wanted: OFF): OFF
> 
> ## – CFLAGS: -g -O3 – EXTRA\_CFLAGS: -msse2 -msse -mmmx – EXTRA\_LDFLAGS: – EXTRA\_LIBS: m;iconv;/System/Library/Frameworks/Cocoa.framework;/System/Library/Frameworks/IOKit.framework;/System/Library/Frameworks/ForceFeedback.framework;/System/Library/Frameworks/Carbon.framework;/System/Library/Frameworks/CoreAudio.framework;/System/Library/Frameworks/AudioUnit.framework
> 
> ## – Build Shared Library: ON – Build Static Library: ON
> 
> – Something was not detected, although your are sure that it  
> – has been properly installed? Then make sure, you have set  
> – the CFLAGS and LDFLAGS environment variables correctly.
> 
> dougs-Mac-mini:build doug$ ninja  
> …  
> [231/231] Linking C static library libSDL2.a  
> dougs-Mac-mini:build doug$ ls  
> CMakeCache.txt Makefile build.ninja  
> include libSDL2.2.0.0.dylib libSDL2.dylib  
> rules.ninja sdl2.pc  
> CMakeFiles SDL2.spec cmake\_install.cmake  
> libSDL2.0.dylib libSDL2.a libSDL2main.a sdl2-config
> 
> ~  
> Doug.
> 
> On Fri, May 24, 2013 at 11:39 PM, Gabriele Greco \<gabriele.greco at darts.it\>wrote:
> 
> > \*\*
> > 
> > > I am currently trying to do all the necessary touchups to my engine so I  
> > > can get a working MacOSX port up and running. I have SDL being built  
> > > through CMake which is integrated into the CMake configuration of my  
> > > engine. SDL compiles just fine as a dependency, however when it attempts to  
> > > link it errors in “SDL\_Log.c” saying it can’t find the symbol “\_SDL\_NSLog”.  
> > > I have looked through the code and I found the method it’s talking about in  
> > > “SDL\_cocoavideo.m”. As far as I can tell the project seems to be configured  
> > > correctly for that files inclusion in the project.
> > 
> > I’m quite sure I’ve had that problem too when trying to build with CMake  
> > on OSX, so after a few failed attempts to fix the CMakeLists.txt I switched  
> > back to build with autotools, the problem I had was that some of the .m  
> > files do not get complied also if they are correctly added in the  
> > respective directories… I thought it was some problem with my version of  
> > cmake and gave up since I had not a lot of time at the moment 🙂
> > 
> > –  
> > Bye,  
> > Gabry
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
