[CMake] linking

Bill Hoffman bill.hoffman at kitware.com
Thu Feb 8 19:52:37 EST 2007


Hector Franco Penya wrote:
> \
> SET(CMAKE_CXX_FLAGS "-fPIC -D_REENTRANT -g -c -I./binreloc
> -I../../include -I./Counters -Wall -Wextra -shared
> -DGCC_HASCLASSVISIBILITY -DAUTILITYLIB_API_EXPORTS -DENABLE_BINRELOC
> ") #these sentence pass parameters to the compiler gcc
>
Your problem is that you have set -shared as a compile flag for .o 
files.  That tells gcc to create a shared library.  So, the compiler is 
trying to make each .o file into its own shared library.  Take that out 
of CXX_FLAGS and you should be OK.


-Bill



More information about the CMake mailing list