# I can't compile on OSX (i installed macports, brew, the libs and compilers etc, the object code compiles, won't link)

**URL:** <https://forum.devtalk.com/t/i-cant-compile-on-osx-i-installed-macports-brew-the-libs-and-compilers-etc-the-object-code-compiles-wont-link/61518>\
**Category:** Game Dev Questions/Help\
**Tags:** osx, macos, macs, opengl, c\
**Created:** [28 June 2022 17:21 UTC](https://forum.devtalk.com/t/i-cant-compile-on-osx-i-installed-macports-brew-the-libs-and-compilers-etc-the-object-code-compiles-wont-link/61518 "2022-06-28T17:21:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev232](https://forum.devtalk.com/letter_avatar_proxy/v4/letter/d/2acd7d/32.png) [@dev232](https://forum.devtalk.com/u/dev232)\
**Post date:** [28 June 2022 17:21 UTC](https://forum.devtalk.com/t/i-cant-compile-on-osx-i-installed-macports-brew-the-libs-and-compilers-etc-the-object-code-compiles-wont-link/61518/1 "2022-06-28T17:21:54Z")

</div>

Installed Mac Ports on OSX High Sierra

> sudo port install gcc11 libsdl2 openssl glfw libsdl2\_gfx libsdl2\_image libsdl2\_mixer libsdl2\_net libsdl2\_ttf

and added the libs to the compile options: and that made the object code finally compile and not error out:

> CPUOPTIMIZATIONS?=-fcommon -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fno-trapping-math -D\_THREAD\_SAFE -I/opt/local/include/SDL2 -L/opt/local/lib -lSDL2

But it won’t produce a binary:

Build more but didn’t link:

> “\_volume”, referenced from:  
> \_M\_Draw in menu.o  
> \_M\_Menu\_Options\_AdjustSliders in menu.o  
> ld: symbol(s) not found for architecture x86\_64  
> clang: error: linker command failed with exit code 1 (use -v to see invocation)  
> make[2]: \*\*\* [darkplaces-sdl] Error 1  
> make[1]: \*\*\* [bin-debug] Error 2  
> make: \*\*\* [sdl-debug] Error 2

Errors:

> [apples-Mac-mini:buildforapple r00t$ ./all compileengineonly sdlCompiling - Pastebin.com](http://pastebin.com/QwM2D7xh)

Won’t link and won’t thusly create the binary.

This is the makefile.inc:

> [apples-Mac-mini:buildforapple r00t$ apples-Mac-mini:buildforapple r00t$ appl - Pastebin.com](http://pastebin.com/GPkifHGn)

this is the makefile (no extension)

> [apples-Mac-mini:buildforapple r00t$ apples-Mac-mini:buildforapple r00t$ appl - Pastebin.com](http://pastebin.com/TP7rJCLP)

Can someone help? (Please don’t suggest upgrading the OS, nor buying a new mac)
