卷曲 - 未定义的参考 - 使用RESTCLIENTCPP
Curl - undefined references - using RestClientCpp
我正在制作一个使用mingw在Windows上使用RESTCLENT-CPP的应用程序。我构建了OpenSSL,然后尝试动态地构建卷发,但这失败了,因此我现在可以静态地构建它。之后,我试图建立RESTCLIENT,这并没有给我任何警告。现在在Clion中,我正在使用此CMAKE文件;
cmake_minimum_required(VERSION 3.2)
project(project)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
# add_definitions(-DCURL_STATICLIB)
# find_library(curl NAMES curl libcurl)
# find_package(curl)
# add_definitions(-lcurl)
# find_library(restclient-cpp NAMES restclient restclient-cpp)
# add_library(curl STATIC IMPORTED)
# set_property(TARGET curl PROPERTY IMPORTED_LOCATION C:/MinGW/lib/libcurl.a)
add_executable(project ${SOURCE_FILES})
target_link_libraries(project restclient-cpp)
评论的行是我试图让它工作的一些东西,但是直到现在,还没有运气...我总是得到这个错误;
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../librestclient-cpp.a(librestclient_cpp_la-restclient.o): In function `ZN10RestClient3getERKSs':
c:MinGWstuffrestclient/source/restclient.cpp:45: undefined reference to `_imp__curl_easy_init'
c:MinGWstuffrestclient/source/restclient.cpp:49: undefined reference to `_imp__curl_easy_setopt'
c:MinGWstuffrestclient/source/restclient.cpp:66: undefined reference to `_imp__curl_easy_perform'
c:MinGWstuffrestclient/source/restclient.cpp:74: undefined reference to `_imp__curl_easy_getinfo'
c:MinGWstuffrestclient/source/restclient.cpp:77: undefined reference to `_imp__curl_easy_cleanup'
c:MinGWstuffrestclient/source/restclient.cpp:78: undefined reference to `_imp__curl_global_cleanup'
c:MinGWstuffrestclient/source/restclient.cpp:50: undefined reference to `_imp__curl_easy_setopt'
当我链接时...任何想法都受到欢迎...
已解决;Cmake从我的git中使用了libcurl.dll,因此首先是一个不同的版本。我还将libcurl.dll文件复制到/mingw/bin和/mingw/include,现在它可以按照
相关文章:
- 如何创建一个CMake变量,除非显式重写,否则使用默认值
- C++:TypeDef使用元组
- 使用std::multimap迭代器创建std::list
- 从不同线程使用int64的不同字节安全吗
- 比较并显示使用最小值(a,b)和最大值(a、b)升序排列的4个数字
- 为什么在全局范围内使用"extern int a"似乎不行?
- 在C#中处理C++指针而不使用unsafe的最佳方法
- 使用C++库在Android项目中修改gradle中的cmake参数,用于插入指令的测试
- 如何使用Google Mock来模拟gettimeofday()
- 如何使用默认参数等选择模板专业化
- 为什么使用 "this" 指针调用派生成员函数?
- 使用新行和不使用新行读取文件
- 如何使用 < 和 > 命令获取 c++ 中的输入和输出?
- 如何确定我已使用非编码文件到达 EOF?
- 如何在cuSparse中使用cusparseXcoo2csr从coo转换为csc
- 使用CMake创建QML插件
- 使用strcpy将char数组的元素复制到另一个数组
- 在c++中使用nlohmann从类到json的转换
- 使用指针从C++中的数组中获取最大值
- 卷曲 - 未定义的参考 - 使用RESTCLIENTCPP