[CMake] CMake Tutorial and Error: undefined symbols

Bill Hoffman bill.hoffman at kitware.com
Sun Jan 28 19:12:16 EST 2007


David Morris wrote:
> > //C compiler.
>
>     > CMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc
>     >
>     > //CXX compiler.
>     > CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
>     >
>     > I'm not sure if the CXX compiler is correct, or if it should be
>     g++. I
>     > tried changing it there but it didn't go anything. Any ideas?
>     > thanks for the help,
>     > dave
>     >
>     You need to link in the mac frameworks, like this:
>     target_link_libraries(foo -framework Cocoa -framework Carbon)
>
>     -Bill
>
> this line:
>
> TARGET_LINK_LIBRARIES(${CurrentExe} -framework Cocoa -framework Carbon)
>
>  seems to return this error:
>
> /usr/bin/ld: can't locate framework for: -framework -lCocoa
>
> is there something I need to do before that?
> dave
Sorry....  put them in double quotes.

"-framework Cocoa" "-framework Carbon" should work.

-Bill



More information about the CMake mailing list