[CMake] Why are my static libs not being read?
The qt libraries are included in the target link flag (this project uses qt of course), however the two lib files that exist in the lib folder in the same directory are either not recognized. They draw up linker issues in the compiler, even though I can tell through the cmake gui that it does find those paths. Any input at all would be great. Below I have included the CMakeLists.txt, a screenshot of the cmake gui as well as a sample of the linking errors being drawn. PROJECT(CppSampleQt01) FIND_PACKAGE(Qt4 REQUIRED) //These are the lines I am concerned do not function appropriately. However you can http://i.imgur.com/EDrHR.png see here that they are recognized by CMake FIND_LIBRARY(SIMPLONLIB lv.simplon lib) FIND_LIBRARY(SIMPLONIMGPROC lv.simplon.imgproc lib) SET(CppSampleQt01_SOURCES include/lv.simplon.class.cpp camera.cpp main.cpp mainwindow.cpp osdep.cpp paint.cpp) SET(CppSampleQt01_HEADERS include/lv.simplon.class.h camera.h mainwindow.h osdep.h paint.h) SET(CppSampleQt01_RESOURCES icons.qrc) INCLUDE(${QT_USE_FILE}) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_EXECUTABLE(CppSampleQt01 ${CppSampleQt01_SOURCES} ${CppSampleQt01_HEADERS_MOC} ${CppSampleQt01_RESOURCES_RCC}) TARGET_LINK_LIBRARIES(CppSampleQt01 ${QT_LIBRARIES}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} include QExtSerialPort/src) And here are some of the relevant linker errors that are drawn: 2lv.simplon.class.obj : error LNK2019: unresolved external symbol __imp__LvEventKill@4 referenced in function public: unsigned int __thiscall LvEvent::Kill(void) (?Kill@LvEvent@@QAEIXZ) 2lv.simplon.class.obj : error LNK2019: unresolved external symbol __imp__LvEventFlush@4 referenced in function public: unsigned int __thiscall LvEvent::Flush(void) (?Flush@LvEvent@@QAEIXZ)... -- View this message in context: http://cmake.3232098.n2.nabble.com/Why-are-my-static-libs-not-being-read-tp7581042.html Sent from the CMake mailing list archive at Nabble.com. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Why are my static libs not being read?
The qt libraries are included in the target link flag (this project uses qt of course), however the two lib files that exist in the lib folder in the same directory are either not recognized. They draw up linker issues in the compiler, even though I can tell through the cmake gui that it does find those paths. Any input at all would be great. Below I have included the CMakeLists.txt, a screenshot of the cmake gui as well as a sample of the linking errors being drawn. PROJECT(CppSampleQt01) FIND_PACKAGE(Qt4 REQUIRED) //These are the lines I am concerned do not function appropriately. However you can http://i.imgur.com/EDrHR.png see here that they are recognized by CMake FIND_LIBRARY(SIMPLONLIB lv.simplon lib) FIND_LIBRARY(SIMPLONIMGPROC lv.simplon.imgproc lib) SET(CppSampleQt01_SOURCES include/lv.simplon.class.cpp camera.cpp main.cpp mainwindow.cpp osdep.cpp paint.cpp) SET(CppSampleQt01_HEADERS include/lv.simplon.class.h camera.h mainwindow.h osdep.h paint.h) SET(CppSampleQt01_RESOURCES icons.qrc) INCLUDE(${QT_USE_FILE}) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_EXECUTABLE(CppSampleQt01 ${CppSampleQt01_SOURCES} ${CppSampleQt01_HEADERS_MOC} ${CppSampleQt01_RESOURCES_RCC}) TARGET_LINK_LIBRARIES(CppSampleQt01 ${QT_LIBRARIES}) You need to add your 2 libraries in TARGET_LINK_LIBRARIES. CMake will not do that automatically. John -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Why are my static libs not being read?
Include it using the flags? Like so: TARGET_LINK_LIBRARIES(CppSampleQt01 ${QT_LIBRARIES} SIMPLONLIB SIMPLONIMGPROC) ? Because when I did this, the libs were not found either. -- View this message in context: http://cmake.3232098.n2.nabble.com/Why-are-my-static-libs-not-being-read-tp7581042p7581044.html Sent from the CMake mailing list archive at Nabble.com. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Why are my static libs not being read?
On Tue, Jul 31, 2012 at 2:21 PM, Toronto Andrew andrew.loui...@gmail.com wrote: Include it using the flags? Like so: TARGET_LINK_LIBRARIES(CppSampleQt01 ${QT_LIBRARIES} SIMPLONLIB SIMPLONIMGPROC) ? Because when I did this, the libs were not found either. I think it should be: TARGET_LINK_LIBRARIES(CppSampleQt01 ${QT_LIBRARIES} ${SIMPLONLIB} ${SIMPLONIMGPROC}) since both of these should be variables. John -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Why are my static libs not being read?
Thank you John, this did work. I get the idea now, thank you. I have another concern though, that I hope I can be helped with though it's doesn't fall under the original problem. So I am using a project within my project: http://i.imgur.com/bqqnp.png, and I found a custom https://qextserialport.googlegroups.com/attach/9b25d0e5e8974d99/CMakeLists.txt?view=1part=4 CMakeLists.txt for it created by the developers, and I was wondering how would I go about integrating that into my existing CMakeLists.txt, any input regarding how to go about doing this will be greatly appreciated. Thank you guys once again! -- View this message in context: http://cmake.3232098.n2.nabble.com/Why-are-my-static-libs-not-being-read-tp7581042p7581048.html Sent from the CMake mailing list archive at Nabble.com. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Why are my static libs not being read?
On Tue, Jul 31, 2012 at 2:54 PM, Toronto Andrew andrew.loui...@gmail.com wrote: Thank you John, this did work. I get the idea now, thank you. I have another concern though, that I hope I can be helped with though it's doesn't fall under the original problem. So I am using a project within my project: http://i.imgur.com/bqqnp.png, and I found a custom https://qextserialport.googlegroups.com/attach/9b25d0e5e8974d99/CMakeLists.txt?view=1part=4 CMakeLists.txt for it created by the developers, and I was wondering how would I go about integrating that into my existing CMakeLists.txt, any input regarding how to go about doing this will be greatly appreciated. Thank you guys once again! One way is to put this file along with the sources in a subdirectory of your project and use the add_subdirectory cmake command to add that to your project. Then add qextserialport to your TARGET_LINK_LIBRARIES. This time just use qextserialport since it is not a variable but a target. You will also have to add a entry to your include_directories for the location of the .h file in this subdirectory. John -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake