<div dir="ltr">Hi Jakub<div class="gmail_extra"><br><div class="gmail_quote">On 17 October 2013 15:18, Jakub Zakrzewski <span dir="ltr"><<a href="mailto:jzakrzewski@e2e.ch" target="_blank">jzakrzewski@e2e.ch</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi.<br>
<br>
I may be wrong, but I suppose, that CMake puts linker flags BEFORE all the files to link and you use the flags to link libraries. For linking libraries you should be using the target_link_libraries CMake command.<br></blockquote>
<div><br></div><div>You are rigth, I put "<span style="font-size:13px;color:rgb(80,0,80);font-family:arial,sans-serif">-lfusion_io -ladios -lmxml" as target libraries and now the order is correct to compile!</span><br>
</div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br></span></div><div>Thank you very much!</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
From: <a href="mailto:cmake-bounces@cmake.org">cmake-bounces@cmake.org</a> [mailto:<a href="mailto:cmake-bounces@cmake.org">cmake-bounces@cmake.org</a>] On Behalf Of Juan Pablo Hernandez Vogt<br>
Sent: Donnerstag, 17. Oktober 2013 12:01<br>
To: <a href="mailto:cmake@cmake.org">cmake@cmake.org</a><br>
Subject: [CMake] Object file as first one in link.txt file<br>
<div class=""><div class="h5"><br>
Hello everybody,<br>
<br>
I moving a makefile to cmake, and after errors I could check that order in link chain was important.<br>
<br>
1) CMake generates this link.txt (error when linking)<br>
/usr/bin/c++ -lfusion_io -ladios -lmxml -lmpi -lopen-rte -lopen-pal -lpthread -lstdc++ CMakeFiles/niio-main.dir/main.cpp.o -o niio-main -rdynamic -L/home/testuser/dev/niio/lib -L/home/testuser/dev/niio/openmpi/lib<br>
<br>
<br>
2) Desired linking that works:<br>
/usr/bin/c++ CMakeFiles/niio-main.dir/main.cpp.o -lfusion_io -ladios -lmxml -lmpi -lopen-rte -lopen-pal -lpthread -lstdc++ -o niio-main -rdynamic -L/home/testuser/dev/niio/lib -L/home/testuser/dev/niio/openmpi/lib<br>
<br>
</div></div></blockquote></div><br></div></div>