Hi Ankit.<br><br><br>Did you try TARGET_LINK_LIBRARIES?<br><br>TARGET_LINK_LIBRARIES( myexe ${myobj} )<br><br><div class="gmail_quote">2009/5/19 ankit jain <span dir="ltr"><<a href="mailto:ankitguddu@gmail.com">ankitguddu@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi all,<br><br>My Cmakelists contains:<br><br>set(myobj ${CMAKE_CURRENT_SOURCE_DIR}/../objfolder/myfile.obj)<br>
add_executable(myexe main.c ${myobj})<br><br>This myfile.obj object file is generated while building objfolder before creating this executable<br>
<br>Now on building this executable i got a warning:<br><br>main.obj: warning: earlier declaration of a function f1() found in myfile.obj: second definition ignored..<br><br>This means it is taking the f1() function from myfile.obj but i want f1() function to be taken from main.obj..<br>
<br>What to do?<br><br>Also it is imp. to link this myfile.obj file to myexe executable since it depends on other functions of this object file..<br>So this object file has to be there.<br>Just tell me how function f1() can be taken from main.c rahter than from myfile.obj evenif it still gives warning as:<br>
<br>myfile.obj:warning: earlier definition of function f1() found in main.c (since if it takes f1() from main.c): second def. ignored<br><br>Regards-<br><font color="#888888">Ankit Jain<br><br><br>
</font><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br>