[CMake] Linking object file with executable

Tyler Roscoe tyler at cryptio.net
Tue May 19 10:45:16 EDT 2009


On Tue, May 19, 2009 at 05:38:15PM +0530, ankit jain wrote:
> add_executable(myexe  main.c ${myobj})
> 
> main.obj: warning: earlier declaration of a function f1() found in
> myfile.obj: second definition ignored..
> 
> This means it is taking the f1() function from myfile.obj but i want f1()
> function to be taken from main.obj..

Did you try changing the order to:

    add_executable(myexe  ${myobj} main.c)

?

tyler


More information about the CMake mailing list