# macOS: Clang don't link SDL2\_ttf

**URL:** <https://discourse.libsdl.org/t/macos-clang-dont-link-sdl2-ttf/27083>\
**Category:** SDL Development\
**Created:** [January 18, 2020, 6:07pm UTC](https://discourse.libsdl.org/t/macos-clang-dont-link-sdl2-ttf/27083 "2020-01-18T18:07:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lubomirskirka](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/l/ea666f/32.png) [@lubomirskirka](https://discourse.libsdl.org/u/lubomirskirka)\
**Post date:** [January 18, 2020, 6:07pm UTC](https://discourse.libsdl.org/t/macos-clang-dont-link-sdl2-ttf/27083/1 "2020-01-18T18:07:39Z")

</div>

Hi, I want to start develop game in SDL2(that it’s correct installed), but Clang don’t see SDL2\_ttf. I moved it to /Library/Frameworks/ as written in read me.

This is cmake from my teacher:

> cmake\_minimum\_required(VERSION 3.5)  
> project(tetris2)
> 
> set(CMAKE\_CXX\_FLAGS “${CMAKE\_CXX\_FLAGS} -std=c++14 -Wall -Wextra -pedantic”)
> 
> find\_package(SDL2 REQUIRED)
> 
> include\_directories(${SDL2\_INCLUDE\_DIRS})
> 
> set(SOURCE\_FILES main.cpp)
> 
> add\_executable(tetris2 ${SOURCE\_FILES})  
> target\_link\_libraries(tetris2 ${SDL2\_LIBRARIES} SDL2\_ttf)

And output:

> /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/lubomirskirka/tetris2/cmake-build-debug --target tetris2 – -j 2  
> Scanning dependencies of target tetris2  
> [50%] Building CXX object CMakeFiles/tetris2.dir/main.cpp.o  
> [100%] Linking CXX executable tetris2  
> ld: library not found for -lSDL2\_ttf  
> clang: error: linker command failed with exit code 1 (use -v to see invocation)  
> make[3]: \*\*\* [tetris2] Error 1  
> make[2]: \*\*\* [CMakeFiles/tetris2.dir/all] Error 2  
> make[1]: \*\*\* [CMakeFiles/tetris2.dir/rule] Error 2  
> make: \*\*\* [tetris2] Error 2
