简体   繁体   中英

CMake Error: Please set them or make sure they are set and tested correctly in the CMake files: QUICKFIX_LIBRARY linked by target "run" in directory

I try to build a project on CLion with Cygwin and I got this error:

 -- Found Boost: /usr/include (found version "1.66.0") found components: system thread regex iostreams chrono date_time atomic -- Configuring done CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: QUICKFIX_LIBRARY linked by target "run_engine" in directory /cygdrive/c/Users/33671/Desktop/main_program -- Generating done CMake Generate step failed. Build files cannot be regenerated correctly.

I try to generate the.exe fail but nothing appeared because of this error. Any idea?

So I found the issue. I Had to change the path manually in the CMakeCache.txt file of QUICKFIX_LIBRARY. Then, rebuild.

So I changed the Path of QUICKFIX_LIBRARY in the CmakeCache.txt and then I don't have the error. But in reality it's still not finding it because once it's written in CMakeCache.txt, it doesn't check anymore if it's really include or not.

My lib is located like this: project_name/exchanges/quickfix/lib/cygquickfix-16.dll.

The lib is cygquickfix-16.dll.

I added a control message to see if he found or not the library.

I still have an ERROR at the end.

 cmake_minimum_required(VERSION 3.5) project(test) set(CMAKE_CXX_STANDARD 14) SET(Boost_USE_STATIC_LIBS OFF) SET(Boost_USE_MULTITHREAD ON) SET(CMAKE_PREFIX_PATH /lib/) FIND_PACKAGE(Boost REQUIRED COMPONENTS system thread regex iostreams)# 1.66.0 IF(Boost_FOUND) INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) ENDIF(Boost_FOUND) SET(USED_LIBS ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_IOSTREAMS_LIBRARY}) add_executable(run_engine main_poco.cpp....) include_directories(.) include_directories(./exchanges/quickfix/include) find_library(QUICKFIX_LIBRARY quickfix HINTS./exchanges/quickfix/lib) message("-- QUICKFIX_LIBRARY: ${QUICKFIX_LIBRARY}") target_link_libraries(run_engine ${QUICKFIX_LIBRARY} -lPocoDataMySql -l...)

And then I get this in CMake Debug:

 C:\Users\33671\AppData\Local\JetBrains\CLion2022.1\cygwin_cmake\bin\cmake.exe -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/usr/bin/make.exe -DCMAKE_C_COMPILER=/usr/bin/gcc.exe -DCMAKE_CXX_COMPILER=/usr/bin/c++.exe -G "CodeBlocks - Unix Makefiles" -S /cygdrive/c/Users/33671/Desktop/project -B /cygdrive/c/Users/33671/Desktop/project/cmake-build-debug -- QUICKFIX_LIBRARY: QUICKFIX_LIBRARY-NOTFOUND -- Configuring done CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: QUICKFIX_LIBRARY linked by target "run_engine" in directory /cygdrive/c/Users/33671/Desktop/project -- Generating done CMake Generate step failed. Build files cannot be regenerated correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM