Cmake build problem with opencv (error LNK2019) in vscode - c++

So I've been trying to get started on opencv c++. I followed a tutorial on how to set it up, link here. I wrote a simple opencv script for an image display. I built the project after that and I got this error:
[build] main.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl cv::Mat::Mat(void)" (??0Mat#cv##QEAA#XZ) referenced in function main
[build] main.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl cv::Mat::~Mat(void)" (??1Mat#cv##QEAA#XZ) referenced in function main
[build] main.cpp.obj : error LNK2019: unresolved external symbol "public: class cv::Mat & __cdecl cv::Mat::operator=(class cv::Mat &&)" (??4Mat#cv##QEAAAEAV01#$$QEAV01##Z) referenced in function main
[build] mingw32-make[2]: *** [CMakeFiles\opencv.dir\build.make:152: opencv.exe] Error -1
[build] mingw32-make[1]: *** [CMakeFiles\Makefile2:838: CMakeFiles/opencv.dir/all] Error 2
[build] mingw32-make: *** [Makefile:120: all] Error 2
[build] main.cpp.obj : error LNK2019: unresolved external symbol "class cv::Mat __cdecl cv::imread(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (?imread#cv##YA?AVMat#1#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z) referenced in function main
[build] main.cpp.obj : error LNK2019: unresolved external symbol "void __cdecl cv::namedWindow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (?namedWindow#cv##YAXAEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z) referenced in function main
[build] main.cpp.obj : error LNK2019: unresolved external symbol "int __cdecl cv::waitKey(int)" (?waitKey#cv##YAHH#Z) referenced in function main
[build] main.cpp.obj : error LNK2019: unresolved external symbol "void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::debug_build_guard::_InputArray const &)" (?imshow#cv##YAXAEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##AEBV_InputArray#debug_build_guard#1##Z) referenced in function main
[build] opencv.exe : fatal error LNK1120: 7 unresolved externals
I did some research but most of the answers were for Visual Studio users and I'm using vscode, not that. Here's how my CMakeLists.txt look like:
cmake_minimum_required(VERSION 3.0.0)
project(opencv VERSION 0.1.0)
include(CTest)
enable_testing()
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
add_executable(opencv main.cpp)
target_link_libraries( opencv ${OpenCV_LIBS} )
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
How can I fix this error and what was the cause of it? By the way, I'm using VS Build tools 2019.
Edit:
So I tried changing my Cmake kit to my usual compiler, MingW64 and the code seems to be compiling fine. The error only really happens with the Visual Studio C++ compiler. Why does it only happen to the VS compiler though?

Related

Building GStreamer with CMake causes SDP & WebRTC unresolved external symbol errors

I'm building a C++ GStreamer project with CMake which depends on GStreamer, GLIB, Libsoup and json-glib. I'm new to CMake and having trouble setting up my project. I've managed to include many of the dependencies but some seem to remain unresolved even though they are part of GStreamer. All GStreamer methods and types are resolved with the exception of SDP and WebRTC. They are, to my understanding, part of GStreamer and are also located inside of the directory which GMake correctly "finds".
These are the errors that are occurring when trying to build the project.
[build] error LNK2019: unresolved external symbol __imp_gst_sdp_message_new referenced in function "void __cdecl soup_websocket_message_cb(struct _SoupWebsocketConnection *,enum SoupWebsocketDataType,struct _GBytes *,void *)" (?soup_websocket_message_cb##YAXPEAU_SoupWebsocketConnection##W4SoupWebsocketDataType##PEAU_GBytes##PEAX#Z)
[build] error LNK2019: unresolved external symbol __imp_gst_sdp_message_parse_buffer referenced in function "void __cdecl soup_websocket_message_cb(struct _SoupWebsocketConnection *,enum SoupWebsocketDataType,struct _GBytes *,void *)" (?soup_websocket_message_cb##YAXPEAU_SoupWebsocketConnection##W4SoupWebsocketDataType##PEAU_GBytes##PEAX#Z)
[build] error LNK2019: unresolved external symbol __imp_gst_sdp_message_as_text referenced in function "void __cdecl on_offer_created_cb(struct _GstPromise *,void *)" (?on_offer_created_cb##YAXPEAU_GstPromise##PEAX#Z)
[build] error LNK2019: unresolved external symbol __imp_gst_webrtc_session_description_get_type referenced in function "void __cdecl on_offer_created_cb(struct _GstPromise *,void *)" (?on_offer_created_cb##YAXPEAU_GstPromise##PEAX#Z)
[build] error LNK2019: unresolved external symbol __imp_gst_webrtc_session_description_new referenced in function "void __cdecl soup_websocket_message_cb(struct _SoupWebsocketConnection *,enum SoupWebsocketDataType,struct _GBytes *,void *)" (?soup_websocket_message_cb##YAXPEAU_SoupWebsocketConnection##W4SoupWebsocketDataType##PEAU_GBytes##PEAX#Z)
[build] error LNK2019: unresolved external symbol __imp_gst_webrtc_session_description_free referenced in function "void __cdecl on_offer_created_cb(struct _GstPromise *,void *)" (?on_offer_created_cb##YAXPEAU_GstPromise##PEAX#Z)
This is my CMakeLists.txt
# CMakeList.txt : CMake project for stream-project, include source and define
# project specific logic here.
#
cmake_minimum_required (VERSION 3.8)
project (stream-project LANGUAGES CXX)
# Packages
find_package(PkgConfig REQUIRED)
# Add source to this project's executable.
add_executable (${PROJECT_NAME} "main.cpp" "main.h")
# Search all modules that we so desire to use and "include_directories"
pkg_search_module(GST REQUIRED gstreamer-1.0 gstreamer-sdp-1.0 gstreamer-video-1.0 gstreamer-app-1.0 gstreamer-webrtc-1.0)
pkg_search_module(GLIB REQUIRED glib-2.0)
pkg_search_module(LIBSOUP REQUIRED libsoup-2.4)
pkg_search_module(JSONGLIB REQUIRED json-glib-1.0)
include_directories(
${GST_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
${LIBSOUP_INCLUDE_DIRS}
${JSONGLIB_INCLUDE_DIRS}
)
# Link target directories and libraries
target_link_directories(${PROJECT_NAME} PRIVATE
${GST_LIBRARY_DIRS}
${GLIB_LIBRARY_DIRS}
${LIBSOUP_LIBRARY_DIRS}
${JSONGLIB_LIBRARY_DIRS}
)
target_link_libraries(${PROJECT_NAME} PRIVATE
${GST_LIBRARIES}
${GLIB_LIBRARIES}
${LIBSOUP_LIBRARIES}
${JSONGLIB_LIBRARIES}
)
message(STATUS ${GST_INCLUDE_DIRS})
I've managed to solve it by using a premade find script I found online.
https://chromium.googlesource.com/external/Webkit/+/master/Source/cmake/FindGStreamer.cmake
It creates all necessary defines which I then include and link.
These are the defaults as specified in the FindGStreamer.cmake file
FIND_GSTREAMER_COMPONENT(GSTREAMER_APP gstreamer-app-1.0 gst/app/gstappsink.h gstapp-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_AUDIO gstreamer-audio-1.0 gst/audio/audio.h gstaudio-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_FFT gstreamer-fft-1.0 gst/fft/gstfft.h gstfft-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_PBUTILS gstreamer-pbutils-1.0 gst/pbutils/pbutils.h gstpbutils-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_VIDEO gstreamer-video-1.0 gst/video/video.h gstvideo-1.0)
I extended those above with:
FIND_GSTREAMER_COMPONENT(GSTREAMER_SDP gstreamer-sdp-1.0 gst/sdp/sdp.h gstsdp-1.0)
FIND_GSTREAMER_COMPONENT(GSTREAMER_WEBRTC gstreamer-webrtc-1.0 gst/webrtc/webrtc.h gstwebrtc-1.0)

__declspec(dllimport) in release mode and debug mode in QT

i want to use taglib in my QT project on windows, so i build taglib and zlib from source like below:
cmake CMakeLists.txt
cmake --build --config release
cmake command uses visual studio compiler, i build zlib and taglib from source with above command with no error, i added their include and lib path to QT project .pro file like below:
INCLUDEPATH+=F:\project\TAGLIB\taglib\taglib F:\project\TAGLIB\taglib\taglib\toolkit F:\project\TAGLIB\taglib F:\project\zlib-1.2.11\Release F:\project\zlib-1.2.11
LIBS+=-LF:\project\zlib-1.2.11\Release -lzlib
LIBS+= -LF:\project\TAGLIB\taglib\taglib\Release -ltag
LIBS+=-LF:\project\TAGLIB\taglib\taglib\Debug -ltag
LIBS+=-LF:\project\zlib-1.2.11\Debug -lzlibd
and in main.cpp i added:
#include<fileref.h>
#include<tag.h>
#include<QDebug>
and in main function:
TagLib::FileRef f("C:\\Users\\sub\\Downloads\\Mohsen Chavoshi - Sharhe Alef.mp3");
TagLib::String artist = f.tag()->artist();
when i run my application in debug mode,it doesn't run and give me below errors:
main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl TagLib::String::~String(void)" (__imp_??1String#TagLib##UEAA#XZ) referenced in function main
main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: char const * __cdecl TagLib::String::toCString(bool)const " (__imp_?toCString#String#TagLib##QEBAPEBD_N#Z) referenced in function main
main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl TagLib::FileName::FileName(char const *)" (__imp_??0FileName#TagLib##QEAA#PEBD#Z) referenced in function main
main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl TagLib::FileRef::FileRef(class TagLib::FileName,bool,enum TagLib::AudioProperties::ReadStyle)" (__imp_??0FileRef#TagLib##QEAA#VFileName#1#_NW4ReadStyle#AudioProperties#1##Z) referenced in function main
main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl TagLib::FileRef::~FileRef(void)" (__imp_??1FileRef#TagLib##UEAA#XZ) referenced in function main
main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: class TagLib::Tag * __cdecl TagLib::FileRef::tag(void)const " (__imp_?tag#FileRef#TagLib##QEBAPEAVTag#2#XZ) referenced in function main
debug\testTag2.exe:-1: error: LNK1120: 6 unresolved externals
but when i run application in Release mode,the above error are just some Warning and application run with no problem, why this is happening?
thank you.

VTK - Migrating from 6.1 to 8.2 [2]

Please see this post:
VTK - Migrating from 6.1 to 8.2
I setup all settings, and I get only 3 errors, and I cannot get rid of them for days:
1>------ Build started: Project: MyApp, Configuration: Debug x64 ------
1> Creating library F:\MyApp\x64\Debug\MyApp.lib and object F:\MyApp\x64\Debug\MyApp.exp
1>MyAppView.obj : warning LNK4217: locally defined symbol ??0vtkMFCWindow##QEAA#PEAVCWnd###Z (public: __cdecl vtkMFCWindow::vtkMFCWindow(class CWnd *)) imported in function "protected: __int64 __cdecl CMyAppView::OnPostInit(unsigned __int64,__int64)" (?OnPostInit#CMyAppView##IEAA_J_K_J#Z)
1>MyAppView.obj : warning LNK4217: locally defined symbol ??1vtkMFCWindow##UEAA#XZ (public: virtual __cdecl vtkMFCWindow::~vtkMFCWindow(void)) imported in function "public: virtual void * __cdecl vtkMFCWindow::`scalar deleting destructor'(unsigned int)" (??_GvtkMFCWindow##UEAAPEAXI#Z)
1>VTKView.obj : warning LNK4217: locally defined symbol ?DrawDC#vtkMFCWindow##QEAAXPEAVCDC###Z (public: void __cdecl vtkMFCWindow::DrawDC(class CDC *)) imported in function "public: virtual void __cdecl CVTKView::OnDraw(class CDC *)" (?OnDraw#CVTKView##UEAAXPEAVCDC###Z)
1>vtkRenderingOpenGL2-8.2.lib(vtkOpenGLState.obj) : error LNK2019: unresolved external symbol __imp_SymGetLineFromAddr64 referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl getProgramStack(void)" (?getProgramStack##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##XZ)
1>vtkRenderingOpenGL2-8.2.lib(vtkOpenGLState.obj) : error LNK2019: unresolved external symbol __imp_SymInitialize referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl getProgramStack(void)" (?getProgramStack##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##XZ)
1>vtkRenderingOpenGL2-8.2.lib(vtkOpenGLState.obj) : error LNK2019: unresolved external symbol __imp_SymFromAddr referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl getProgramStack(void)" (?getProgramStack##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##XZ)
1>F:\MyApp\x64\Debug\MyApp.exe : fatal error LNK1120: 3 unresolved externals
1>Done building project "MyApp.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
cand you give a hint to gt away of these links errors ?
Link your binary with dbghelp.lib
e.g. add something like the following line into your CMakeLists.txt if you are using CMake
target_link_libraries(${project_name} PRIVATE dbghelp.lib)
or add it into into project (Linker/Input/Additional Dependencies) if you are not using CMake
or the add the following into main.cpp somewhere below includes
#pragma comment(lib, "dbghelp.lib") //untested
Possibly turning off VTK error logging in VTK CMake may help as well (not sure)
VTK_REPORT_OPENGL_ERRORS [ ]

Unable to build *.dll for webrtc using ninja for windows machine

I need dll files as output for windows machines. Default GN configuration creates lib files only. So I changed target_type from static_library to loadable_module in webrtc.gni, but Ninja was not able to build it. Here is error snapshot
ninja: Entering directory `out\Release12'
[626/3359] LINK_MODULE(DLL) webrtc_common.dll webrtc_common.dll.pdb
FAILED: webrtc_common.dll webrtc_common.dll.pdb
C:/webRTC/depot_tools/python276_bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo /DLL /OUT:./webrtc_common.dll /PDB:./webrtc_common.dll.pdb #./webrtc_common.dll.rsp
common_types.obj : error LNK2019: unresolved external symbol "public: __cdecl rtc::FatalMessage::FatalMessage(char const *,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)" (??0FatalMessage#rtc##QEAA#PEBDHPEAV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z) referenced in function "public: unsigned int __cdecl webrtc::BitrateAllocation::GetBitrate(unsigned __int64,unsigned __int64)const " (?GetBitrate#BitrateAllocation#webrtc##QEBAI_K0#Z)
common_types.obj : error LNK2019: unresolved external symbol "public: __cdecl rtc::FatalMessage::~FatalMessage(void)" (??1FatalMessage#rtc##QEAA#XZ) referenced in function "public: unsigned int __cdecl webrtc::BitrateAllocation::GetBitrate(unsigned __int64,unsigned __int64)const " (?GetBitrate#BitrateAllocation#webrtc##QEBAI_K0#Z)
./webrtc_common.dll : fatal error LNK1120: 2 unresolved externals
[631/3359] CC obj/third_party/yasm/yasm/nasm-pp.obj
ninja: build stopped: subcommand failed.
Thanks,
Shashi

Failing to compile curlpp

I've been on this for a few hours now (and that's just today) so I could really use some help. I always code in a Windows environment so I am trying to add curlpp to my Code::Blocks project.
I downloaded curl-7.22.0-devel-mingw32 and added all those libraries to Code::Blocks project.
I downloaded curl-7.22.0 and compiled it using vc6curl.dsw which made libcurl.lib, added that to Code::Blocks project.
Downloaded curlpp-0.7.3
Added MinGW\lib\libwsock32.a to Code::Blocks project.
Added the following directories to the project:
curlpp-0.7.3\include and curl-7.22.0\include
But I get a lot of "undefined reference" errors, so I'm guessing that means curlpp needs compiling too. It contains a VC8 project, so I downloaded Visual C++ 2005 Express and installed.
First error I get when opening the project is that the examples couldn't be loaded. Not really a problem, I guess. Trying to build the project right away, gives the error "Cannot open include file: 'curl/curl.h'" so I add the cURL includes folder curl-7.22.0\include to the project and try again.
1>------ Build started: Project: curlpp, Configuration: DebugDynamic Win32 ------
1>Compiling...
1>cURLpp.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>Easy.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>Exception.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>Form.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>Info.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>Multi.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>OptionBase.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>Options.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>CurlHandle.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>OptionList.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>OptionSetter.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>SList.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>WIN32
1>c1xx : fatal error C1083: Cannot open source file: 'WIN32': Permission denied
1>Generating Code...
1>Project : warning PRJ0018 : The following environment variables were not found:
1>$(BOOST_PATH)
1>$(LIBCURL_PATH)
1>Build log was saved at "file://c:\Users\admin\Downloads\curlpp-0.7.3-2\curlpp-0.7.3\DebugDynamic\BuildLog.htm"
1>curlpp - 13 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Erorr upon error upon error, it's driving me nuts. Googeling that one doesn't really help either. I found some forum posts saying WS2_32.Lib had to be added, and that's in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib but adding that to the libraries folder in the VS2005 project doesn't seem to do anything.
I'm just losing track of it all.. how is this supposed to go? I thought it would be as simple as:
Compile curl
Compile curlpp
Profit!
But unfortunately it doesn't seem to be that easy.
UPDATE
Oh yeah, I forgot, initially I also got these errors:
c1xx : fatal error C1083: Cannot open source file: '.\src\curlpp\Infos.cpp': No such file or directory
c1xx : fatal error C1083: Cannot open source file: '.\src\curlpp\Option.cpp': No such file or directory
c1xx : fatal error C1083: Cannot open source file: '.\src\utilspp\singleton\LifetimeLibrary.cpp': No such file or directory
c1xx : fatal error C1083: Cannot open source file: '.\src\utilspp\singleton\PrivateMembers.cpp': No such file or directory
But in src\curlpp there are:
Info.cpp
Options.cpp
So I just copied them and renamed the copies to
Info2.cpp
Option.cpp
And in src\utilspp there are
LifetimeLibrary.cpp
PrivateMembers.cpp
So I just made a folder "singleton" there and copied the files in there.
It's as if curlpp is.. broken? But it must be something weird I am doing because someone would have noticed!
UPDATE2
Ok I started from scratch and figured out that I also had to add the includes folder from the windows SDK. This took care of the Cannot open include file: 'winsock2.h' errors. But now I'm getting a buttload of other errors:
1>------ Build started: Project: curlpp, Configuration: DebugDynamic Win32 ------
1>Linking...
1>Infos.obj : error LNK2005: "public: static void __cdecl curlpp::InfoTypeConverter<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::get(class curlpp::Easy &,enum CURLINFO,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" (?get#?$InfoTypeConverter#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###curlpp##SAXAAVEasy#2#W4CURLINFO##AAV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z) already defined in Info.obj
1>Infos.obj : error LNK2005: "public: static void __cdecl curlpp::InfoTypeConverter<class std::list<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > >::get(class curlpp::Easy &,enum CURLINFO,class std::list<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > &)" (?get#?$InfoTypeConverter#V?$list#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##V?$allocator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2##std###curlpp##SAXAAVEasy#2#W4CURLINFO##AAV?$list#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##V?$allocator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2##std###Z) already defined in Info.obj
1>Infos.obj : error LNK2005: "public: static void __cdecl curlpp::InfoTypeConverter<long>::get(class curlpp::Easy &,enum CURLINFO,long &)" (?get#?$InfoTypeConverter#J#curlpp##SAXAAVEasy#2#W4CURLINFO##AAJ#Z) already defined in Info.obj
1>Infos.obj : error LNK2005: "public: static void __cdecl curlpp::InfoTypeConverter<double>::get(class curlpp::Easy &,enum CURLINFO,double &)" (?get#?$InfoTypeConverter#N#curlpp##SAXAAVEasy#2#W4CURLINFO##AAN#Z) already defined in Info.obj
1>Options.obj : error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class curlpp::OptionTrait<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,10002> const &)" (??6#YAAAV?$basic_ostream#DU?$char_traits#D#std###std##AAV01#ABV?$OptionTrait#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##$0CHBC##curlpp###Z) already defined in Option.obj
1> Creating library DebugDynamic\curlpp.lib and object DebugDynamic\curlpp.exp
1>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_global_init referenced in function "void __cdecl curlpp::initialize(long)" (?initialize#curlpp##YAXJ#Z)
1>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_global_cleanup referenced in function "void __cdecl curlpp::terminate(void)" (?terminate#curlpp##YAXXZ)
1>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_free referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl curlpp::escape(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?escape#curlpp##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABV23##Z)
1>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_escape referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl curlpp::escape(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?escape#curlpp##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABV23##Z)
1>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_unescape referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl curlpp::unescape(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?unescape#curlpp##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABV23##Z)
1>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_getenv referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl curlpp::getenv(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?getenv#curlpp##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABV23##Z)
1>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_version referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl curlpp::libcurlVersion(void)" (?libcurlVersion#curlpp##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##XZ)
1>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_getdate referenced in function "__int64 __cdecl curlpp::getdate(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,__int64 *)" (?getdate#curlpp##YA_JABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##PA_J#Z)
1>Form.obj : error LNK2019: unresolved external symbol __imp__curl_formfree referenced in function "public: void __thiscall curlpp::HttpPost::clear(void)" (?clear#HttpPost#curlpp##QAEXXZ)
1>Form.obj : error LNK2019: unresolved external symbol __imp__curl_formadd referenced in function "private: virtual void __thiscall curlpp::FormParts::File::add(struct curl_httppost * *,struct curl_httppost * *)" (?add#File#FormParts#curlpp##EAEXPAPAUcurl_httppost##0#Z)
1>Info.obj : error LNK2019: unresolved external symbol __imp__curl_easy_getinfo referenced in function "public: void __thiscall curlpp::internal::CurlHandle::getInfo<char *>(enum CURLINFO,char * &)" (??$getInfo#PAD#CurlHandle#internal#curlpp##QAEXW4CURLINFO##AAPAD#Z)
1>Infos.obj : error LNK2001: unresolved external symbol __imp__curl_easy_getinfo
1>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_init referenced in function "public: __thiscall curlpp::Multi::Multi(void)" (??0Multi#curlpp##QAE#XZ)
1>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_cleanup referenced in function "public: __thiscall curlpp::Multi::~Multi(void)" (??1Multi#curlpp##QAE#XZ)
1>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_remove_handle referenced in function "public: __thiscall curlpp::Multi::~Multi(void)" (??1Multi#curlpp##QAE#XZ)
1>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_strerror referenced in function "public: void __thiscall curlpp::Multi::add(class curlpp::Easy const *)" (?add#Multi#curlpp##QAEXPBVEasy#2##Z)
1>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_add_handle referenced in function "public: void __thiscall curlpp::Multi::add(class curlpp::Easy const *)" (?add#Multi#curlpp##QAEXPBVEasy#2##Z)
1>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_perform referenced in function "public: bool __thiscall curlpp::Multi::perform(int *)" (?perform#Multi#curlpp##QAE_NPAH#Z)
1>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_fdset referenced in function "public: void __thiscall curlpp::Multi::fdset(struct fd_set *,struct fd_set *,struct fd_set *,int *)" (?fdset#Multi#curlpp##QAEXPAUfd_set##00PAH#Z)
1>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_info_read referenced in function "public: class std::list<struct std::pair<class curlpp::Easy const *,struct curlpp::Multi::Info>,class std::allocator<struct std::pair<class curlpp::Easy const *,struct curlpp::Multi::Info> > > __thiscall curlpp::Multi::info(void)" (?info#Multi#curlpp##QAE?AV?$list#U?$pair#PBVEasy#curlpp##UInfo#Multi#2##std##V?$allocator#U?$pair#PBVEasy#curlpp##UInfo#Multi#2##std###2##std##XZ)
1>Option.obj : error LNK2019: unresolved external symbol __imp__curl_easy_setopt referenced in function "public: void __thiscall curlpp::internal::CurlHandle::option<void *>(enum CURLoption,void *)" (??$option#PAX#CurlHandle#internal#curlpp##QAEXW4CURLoption##PAX#Z)
1>Options.obj : error LNK2001: unresolved external symbol __imp__curl_easy_setopt
1>CurlHandle.obj : error LNK2001: unresolved external symbol __imp__curl_easy_setopt
1>OptionSetter.obj : error LNK2001: unresolved external symbol __imp__curl_easy_setopt
1>CurlHandle.obj : error LNK2019: unresolved external symbol __imp__curl_easy_perform referenced in function "public: void __thiscall curlpp::internal::CurlHandle::perform(void)" (?perform#CurlHandle#internal#curlpp##QAEXXZ)
1>CurlHandle.obj : error LNK2019: unresolved external symbol __imp__curl_easy_reset referenced in function "public: void __thiscall curlpp::internal::CurlHandle::reset(void)" (?reset#CurlHandle#internal#curlpp##QAEXXZ)
1>CurlHandle.obj : error LNK2019: unresolved external symbol __imp__curl_easy_init referenced in function "public: __thiscall curlpp::internal::CurlHandle::CurlHandle(void)" (??0CurlHandle#internal#curlpp##QAE#XZ)
1>CurlHandle.obj : error LNK2019: unresolved external symbol __imp__curl_easy_duphandle referenced in function "public: class std::auto_ptr<class curlpp::internal::CurlHandle> __thiscall curlpp::internal::CurlHandle::clone(void)const " (?clone#CurlHandle#internal#curlpp##QBE?AV?$auto_ptr#VCurlHandle#internal#curlpp###std##XZ)
1>CurlHandle.obj : error LNK2019: unresolved external symbol __imp__curl_easy_cleanup referenced in function "public: virtual __thiscall curlpp::internal::CurlHandle::~CurlHandle(void)" (??1CurlHandle#internal#curlpp##UAE#XZ)
1>SList.obj : error LNK2019: unresolved external symbol __imp__curl_slist_free_all referenced in function "private: void __thiscall curlpp::internal::SList::clear(void)" (?clear#SList#internal#curlpp##AAEXXZ)
1>SList.obj : error LNK2019: unresolved external symbol __imp__curl_slist_append referenced in function "private: void __thiscall curlpp::internal::SList::update(void)" (?update#SList#internal#curlpp##AAEXXZ)
1>DebugDynamic\curlpp.dll : fatal error LNK1120: 27 unresolved externals
1>Project : warning PRJ0018 : The following environment variables were not found:
1>$(BOOST_PATH)
1>Build log was saved at "file://c:\Users\admin\Downloads\curlpp-0.7.3\curlpp-0.7.3\DebugDynamic\BuildLog.htm"
1>curlpp - 37 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Will this ever end?
Additional Libraries now looks like this:
"C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\lib\Debug";
"C:\Program Files (x86)\CodeBlocks\MinGW\lib";
"C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\lib";
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib";
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib"
And the includes:
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Include";
"C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include";
.\;
include\curlpp;
include;
"$(BOOST_PATH)"
What is BOOST PATH?
And also, to get rid of the "libcurl.lib not found" error, I opened the project I found in curl-7.22.0 and compiled it, but that means libcurl.lib is in the "lib\Debug" folder which I included as you can see above, did I do that correctly?
UPDATE3:
I noticed a file called create-vc-solution.bat so, after downloading "sed" for windows, I tried creating a vc solution for VS9 (There was no option for 10) hoping that would work, but here's what I get when I open the solution file that creates in VS2010:
Converting project file 'C:\Users\admin\Downloads\curlpp-0.7.3\curlpp-0.7.3\curlpp.examples.VC9.vcproj'.
File 'C:\Users\admin\Downloads\curlpp-0.7.3\curlpp-0.7.3\curlpp.examples.VC9.vcproj' was not found.
Project upgrade failed.
Converting project file 'C:\Users\admin\Downloads\curlpp-0.7.3\curlpp-0.7.3\curlpp.VC9.vcproj'.
File 'C:\Users\admin\Downloads\curlpp-0.7.3\curlpp-0.7.3\curlpp.VC9.vcproj' was not found.
Project upgrade failed.
curlpp.examples.VC9.vcproj and curlpp.VC9.vcproj were never even created. Has curlpp been tested at all? By anyone? I'm starting to think this isn't even my fault anymore.
I see you are compiling curlpp into dynamic library. Is that what you wanted? And you should add libcurl.lib to your linker input.