Hi Jakub On 17 October 2013 15:18, Jakub Zakrzewski <[email protected]> wrote:
> Hi. > > 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. > You are rigth, I put "-lfusion_io -ladios -lmxml" as target libraries and now the order is correct to compile! Thank you very much! > From: [email protected] [mailto:[email protected]] On Behalf > Of Juan Pablo Hernandez Vogt > Sent: Donnerstag, 17. Oktober 2013 12:01 > To: [email protected] > Subject: [CMake] Object file as first one in link.txt file > > Hello everybody, > > I moving a makefile to cmake, and after errors I could check that order in > link chain was important. > > 1) CMake generates this link.txt (error when linking) > /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 > > > 2) Desired linking that works: > /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 > >
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
