Dlib LNK2001 unresolved external symbol USER_ERROR__inconsistent_build_configuration__see_dlib_faq_2 - c++

I am trying to implement the DLIB 19.15 library to my app. I generated the dlib project for Windows Visual Studio 15 2017 Win64 and made a Release build using CMAKE.
In the project I have added directories and additional dependencies.
But during compilation I have following error
LNK2001 unresolved external symbol USER_ERROR__inconsistent_build_configuration__see_dlib_faq_2
How Can I solve this problem?

Meet the same problem. You need to add one cpp file named dlib_path\dlib\all\source.cpp from the dlib source directory to your project and re-compile it. Do not copy it to your project path, just add it from dlib source directory.

Related

Dlib error LNK2001 unresolved external symbol

I'm currently trying to implement the DLIB library to my UWP application. I followed the Dlib compile instructions from http://dlib.net/compile.html. I generated the dlib project for "Windows Visual Studio 15 2017 Win64" and made a Release build using CMAKE.
In the project I want to use the Dlib library I added a C++ Runtime Component project and set the following properties for the project:
\...\dlib-19.9\source to VC++ Directories->Include Directories
\...\dlib-19.9\build\dlib\Release to VC++ Directories->Library Directories
dlib_release_64bit_msvc1912.lib to Linker->Input->Additional Dependencies
I've also added the following Preprocessor Definitions:
DLIB_NO_GUI_SUPPORT
DLIB_PNG_SUPPORT
DLIB_JPEG_SUPPORT
NDEBUG
But now the Runtime Component project won't compile anymore and gives me the following error:
Error LNK2001 unresolved external symbol __imp_ExitProcess in \...\dlib_release_64bit_msvc1912.lib(pngerror.obj)
When I remove the DLIB_PNG_SUPPORT from the Preprocessor Definitions it will compile, but of course it will say that I need to add DLIB_PNG_SUPPORT to the Preprocessor Definitions.
I have no clue how to solve this error. Am I doing something wrong or how can I solve this error?
Add source.cpp file from dlib/all/source.cpp directory.

SCIP and Visual Studi: error LNK2019

I want to solve the n-queens problem using SCIP (version 3.2.1) in Visual Studio 2010 (version 10.0.40219.1).
Source files can be found here: http://scip.zib.de/download/files/Queens.tgz
I did not write any code myself, but just included queens.hpp, scip_exceptions.hpp, queens.cpp and queens_main.cpp in my VS project.
In the project properties I did the following:
C/C++ -> General -> Additional Include Directories -> C:\scipoptsuite-3.2.1\scip-3.2.1\src\.
When building, I get errors like:
LNK2019: unresolved external symbol SCIPaddCons referenced in function "public: __thiscall cipexamples::QueensSolver::QueensSolver(unsigned int)"
I understand that I will have to link SCIP libraries to my project? But I do not know which ones and where to find them?
You need to compile the SCIP Optimization Suite first to obtain the libscipopt that you need to link to your project. It will contain everything necessary to work with SCIP.
Alternatively, you may also just use the precompiled dlls from the webpage:
http://scip.zib.de/#download

Link error jpeg.lib visual studio

I have a Visual Studio 2012 console application project where I want to include the jpeg lib (http://www.ijg.org). I downloaded version 9b and I followed these tutorial (http://www.dahlsys.com/misc/compiling_ijg_libjpeg/index.html) .
To use the library…
I added the “Additional Include Directories” path,
I added the “Additional Library Directories” path,
and I added the name of the library to “Input -> Additional
dependencies”.
If I compile the project, I get a link error “error lnk2001 unresolved external symbol”. I spend the whole day to fix this problem. Finally, I setup a new clean VC project an included only the jpeg lib and afterwards I can compile and run the project. Does anyone know what could be the problem?

Linking a DLLs in visual studio 2013

I've already looked for solution, without a success.
I need to use a DLL supplied by third parties on Visual Studio 2013(running on (x64) Windows 10).
On machine there are both OpenCV 3.0.0 and OpenCV2.410 installed and working.
The DLL's author has provided a .lib file and He says that in order to use this DLLs in your project, you need to put some others OpenCV's dlls in the project folder( I've tried to put these DLLs in every project folder[yes I know, it has no sense, but after a lot of tries i've lost my patience])
What he supplies is an .dll and an example project( that doesn't work for me because it needs OpenCV2.1 and there are instructions needs to be translate in newest version [and I prefered don't translate nothing]).
The errors in this example project are of this kind:
error LNK2001: unresolved external symbol
fatal error LNK1120: unresolved externals
The most of them are caused by the miss of OpenCV2.1, that I don't want to install, because I'll have to use it on a program using with OpenCV 3.0.0.
In the example project folder there are:
The upper mentioned .dll
A .lib file
The header file .h
These DLLs: cv210.dll, cxcore210.dll, highgui210.dll, ...(eg. cv210d.dll)
What I've done is this:
A folder called "lib" where I insert all .dll, .lib, .h files.
Put the "lib" folder in Project properties>linker> General> Additional Library Directories
Writing the .lib file in properties>linker> Input> Additional Dependencies
Put the 'lib' pathproperties>C/C++>Additional Include Directories[I know, this has no sense too]
I get these kind of errors:
error LNK2001: unresolved external symbol
I've tried #pragma comment(lib, 'file.lib') way too.
Someone can help me?

Implementing CURL with Visual Studio 2010

I am trying to compile a program that uses Curl in Visual Studio 2010 on Windows Vista x64. I downloaded the latest version of Curl 7.23.1 from the official website and unzipped it to C:Program Files. From there, I opened the VCProject file in the lib directory, converted it, and built it in Visual C++ Express Version. This resulted in the creation of a debug folder in the lib folder with object files, sbr files, and a libcurl.lib file. After that I opened a W32 Console Application in Visual Studio, added the include folder to include directories, added the debug folder to library directories and additional library directories under Linker, and added libcurl.lib to additional dependencies. When trying to compile my code, I received the following errors:
Error 1 error LNK2001: unresolved external symbol __imp__curl_easy_setopt C:\Users\********\Documents\Visual Studio 2010\Projects\MainProject\Run\Run\Run.obj
Error 2 error LNK2001: unresolved external symbol __imp__curl_easy_perform C:\Users\********\Documents\Visual Studio 2010\Projects\MainProject\Run\Run\Run.obj
Error 4 error LNK2001: unresolved external symbol __imp__curl_easy_init C:\Users\********\Documents\Visual Studio 2010\Projects\MainProject\Run\Run\Run.obj
Error 3 error LNK2001: unresolved external symbol __imp__curl_easy_cleanup C:\Users\********\Documents\Visual Studio 2010\Projects\MainProject\Run\Run\Run.obj
Error 5 error LNK1120: 4 unresolved externals C:\Users\********\Documents\Visual Studio 2010\Projects\MainProject\Run\Release\Run.exe Run
I have tried following some tutorials online but they are all outdated. The procedure I followed is supposed to work on Visual Studio 2008. I thought that maybe I may be missing some header files or have not built/compiled parts of Curl. Thanks for any help.
I have faced almost the same issue while trying to statically link the libcurl.lib using vs2010 professional edition.
try performing a pragma link like this one in the source file. It worked for me.
#pragma comment(lib, "libcurl.lib")
or
if the path is missing in search..
#pragma comment(lib, "<full_path>/libcurl.lib")