This question already has answers here:
Error in Release mode but not in Build mode
(3 answers)
Closed 8 years ago.
What is follow errors in opencv 247 and visual 2012?
------ Rebuild All started: Project: ConsoleApplication8, Configuration: Debug Win32 ------
Source.cpp
Source.obj : error LNK2019: unresolved external symbol _cvReleaseImage referenced in function _main
Source.obj : error LNK2019: unresolved external symbol _cvNamedWindow referenced in function _main
Source.obj : error LNK2019: unresolved external symbol _cvShowImage referenced in function _main
Source.obj : error LNK2019: unresolved external symbol _cvDestroyWindow referenced in function _main
Source.obj : error LNK2019: unresolved external symbol _cvLoadImage referenced in function _main
Source.obj : error LNK2019: unresolved external symbol _cvWaitKey referenced in function _main
C:\Users\a\documents\visual studio 2012\Projects\ConsoleApplication8\Debug\ConsoleApplication8.exe : fatal error LNK1120: 6 unresolved externals
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
you will have to link against opencv_core247d.lib and opencv_highgui247d.lib (without the d for release)
Related
I am trying to use the detours library in a visual studio empty windows project. I cloned the repository (https://github.com/microsoft/Detours), I added the include directory into Project Properties / C/C++ / Additional Include Directories, and I added the lib.X86 directory into Project Properties / Linker / Additional Library Directories. I get no errors visible on the file, but when I build I get
1>Source.cpp
1>Source.obj : error LNK2019: unresolved external symbol _DetourTransactionBegin#0 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol _DetourTransactionCommit#0 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol _DetourUpdateThread#4 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol _DetourAttach#8 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol _DetourDetach#8 referenced in function _main
1>Source.obj : error LNK2019: unresolved external symbol _DetourRestoreAfterWith#0 referenced in function _main
1>C:\Users\colel\source\repos\Project3\Debug\Project3.exe : fatal error LNK1120: 6 unresolved externals
1>Done building project "Project3.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped =========
Which looks like the library wasn't included correctly. How do I properly include the detours library into a visual studio project and what am I doing wrong?
You need to add the specific .lib file, which I'm guessing is "detours.lib" (or similar) to the "Additional Dependencies" line.
Properties->Linker->Input->Additional Dependencies.
I'm trying to run a program with GLFW in C++. I'm using visual studios 2019 on a windows 10 computer. I put the .h's and the .lib's in the proper folders and linked to them in the project settings. I'm running a minimal GLFW program I got off the internet. When I run it I get the following error:
1>------ Build started: Project: Riemannian, Configuration: Debug Win32 ------
1>Main.cpp
1>Main.obj : error LNK2019: unresolved external symbol __imp__glClear#4 referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _glfwInit referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _glfwTerminate referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _glfwCreateWindow referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _glfwWindowShouldClose referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _glfwPollEvents referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _glfwMakeContextCurrent referenced in function _main
1>Main.obj : error LNK2019: unresolved external symbol _glfwSwapBuffers referenced in function _main
1>C:\Users\Aaron\source\repos\Riemannian\Debug\Riemannian.exe : fatal error LNK1120: 8 unresolved externals
1>Done building project "Riemannian.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I tried adding glfw3.dll to system32, but that didn't change anything. (side note, GLFW came with a file glfw3dll.lib. Is that just a .lib file that serves the same purpose as glfw3.dll?) Next I tried linking to opengl32.lib in my project settings. This got rid of the first error, the one with the __imp__ prefix. After that there were only 7 unresolved external symbols. My project type is "Application (.exe)" if that's relevant. I'm out of ideas and tired of googling, does anyone know what to do?
On a broader note, I have wasted so many hours trying to get libraries to work in Python, Java, and C++. I am incredibly frustrated and I wish someone could just explain to me how libraries work once and for all so that next time I have a problem I won't be completely lost.
If all this setup is too complicated, you can also just take the Glitter project as a base. It takes care of all the boilerplate and just lets you get on with writing OpenGL. As a bonus, it is based on the cross-platform CMake build tool so your project should be easy to port to other operating systems.
I'm trying to compile tds_fdw for Windows 64bit using Visual Studio Community 2017, but I'm getting the errors below.
The C/C++ Additional Include Directories are:
E:\Downloads\FreeTDS-1.00-x86\freetds-1.00\include
C:\Apps\postgres\pgsql-10.0\include\server\port\win32_msvc
C:\Apps\postgres\pgsql-10.0\include\server\port\win32
C:\Apps\postgres\pgsql-10.0\include
C:\Apps\postgres\pgsql-10.0\include\server
E:\Workspace\git\tds_fdw\include
%(AdditionalIncludeDirectories)
The Linker Input has Additional Dependencies:
C:\Apps\postgres\pgsql-10.0\lib\postgres.lib
What am I missing?
1>------ Rebuild All started: Project: tds_fdw, Configuration: Release x64 ------
1>deparse.c
1>options.c
1>tds_fdw.c
1>Generating Code...
1> Creating library E:\Workspace\git\tds_fdw\x64\Release\tds_fdw.lib and object E:\Workspace\git\tds_fdw\x64\Release\tds_fdw.exp
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbbind referenced in function tdsGetRowCountShowPlanAll
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbclose referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbcmd referenced in function tdsExecuteQuery
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbcolname referenced in function tdsGetColumnMetadata
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbcoltype referenced in function tdsGetColumnMetadata
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbconvert referenced in function tdsConvertToCString
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbiscount referenced in function tdsGetRowCountExecute
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbcount referenced in function tdsGetRowCountExecute
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbdata referenced in function tdsIterateForeignScan
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbdatecrack referenced in function tdsDatetimeToDatum
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbdatlen referenced in function tdsIterateForeignScan
1>tds_fdw.obj : error LNK2019: unresolved external symbol dberrhandle referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbexit referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbinit referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dblogin referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbloginfree referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbmsghandle referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbnextrow referenced in function tdsGetRowCountExecute
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbnumcols referenced in function tdsGetRowCountShowPlanAll
1>tds_fdw.obj : error LNK2019: unresolved external symbol tdsdbopen referenced in function tdsSetupConnection
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbresults referenced in function tdsExecuteQuery
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbsqlexec referenced in function tdsExecuteQuery
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbuse referenced in function tdsSetupConnection
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbwillconvert referenced in function tdsConvertToCString
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbsetlname referenced in function tdsSetupConnection
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbsetlversion referenced in function tdsSetupConnection
1>E:\Workspace\git\tds_fdw\x64\Release\tds_fdw.dll : fatal error LNK1120: 26 unresolved externals
1>Done building project "tds_fdw.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Update: files from FreeTDS
freetds-1.00\bin
freetds-1.00\etc
freetds-1.00\include
freetds-1.00\lib
freetds-1.00\README.tests
freetds-1.00\sbin
freetds-1.00\var
freetds-1.00\bin\bsqldb.exe
freetds-1.00\bin\bsqlodbc.exe
freetds-1.00\bin\datacopy.exe
freetds-1.00\bin\defncopy.exe
freetds-1.00\bin\freebcp.exe
freetds-1.00\bin\osql
freetds-1.00\bin\sqsh.exe
freetds-1.00\bin\tsql.exe
freetds-1.00\etc\freetds.conf
freetds-1.00\etc\locales.conf
freetds-1.00\etc\pool.conf
freetds-1.00\include\bkpublic.h
freetds-1.00\include\cspublic.h
freetds-1.00\include\cstypes.h
freetds-1.00\include\ctpublic.h
freetds-1.00\include\odbcss.h
freetds-1.00\include\sqldb.h
freetds-1.00\include\sqlfront.h
freetds-1.00\include\sybdb.h
freetds-1.00\include\syberror.h
freetds-1.00\include\sybfront.h
freetds-1.00\include\tds_sysdep_public.h
freetds-1.00\lib\libct.a
freetds-1.00\lib\libct.la
freetds-1.00\lib\libsybdb.a
freetds-1.00\lib\libsybdb.la
freetds-1.00\lib\libtdsodbc.a
freetds-1.00\lib\libtdsodbc.la
freetds-1.00\lib\pkgconfig
freetds-1.00\lib\pkgconfig\freetds.pc
freetds-1.00\sbin\tdspool.exe
freetds-1.00\sbin\tdssrv.exe
freetds-1.00\var\log
You failed to link to the FreeTDS .lib. You'll also need to ensure the associated .dll is in your PATH or copied to the same directory as the extension you built.
I try to compile VC++ application and get the error message as below. Is there anyone who know what the library I may be missing? Any advice & suggestion are appreciated.
My Environment:
VC++ 2010
zlib-1.2.8
boost_1_57_0
icu
1>------ Build started: Project: paloserver, Configuration: Debug Win32 ------
1> Creating library C:/Users/a992788/Virtual Machines/Documents/Application/Palo/Palo 3.x Source Code/palo-code-546/molap/server/5.1/SourceCode/Debug/paloserver.lib and object C:/Users/a992788/Virtual Machines/Documents/Application/Palo/Palo 3.x Source Code/palo-code-546/molap/server/5.1/SourceCode/Debug/paloserver.exp
1>unzip.obj : error LNK2019: unresolved external symbol _inflateInit2_ referenced in function _unzOpenCurrentFile3
1>unzip.obj : error LNK2019: unresolved external symbol _inflate referenced in function _unzReadCurrentFile
1>unzip.obj : error LNK2019: unresolved external symbol _crc32 referenced in function _unzReadCurrentFile
1>zip.obj : error LNK2001: unresolved external symbol _crc32
1>unzip.obj : error LNK2019: unresolved external symbol _inflateEnd referenced in function _unzCloseCurrentFile
1>zip.obj : error LNK2019: unresolved external symbol _get_crc_table referenced in function _zipOpenNewFileInZip4_64
1>zip.obj : error LNK2019: unresolved external symbol _deflateInit2_ referenced in function _zipOpenNewFileInZip4_64
1>zip.obj : error LNK2019: unresolved external symbol _deflate referenced in function _zipWriteInFileInZip
1>zip.obj : error LNK2019: unresolved external symbol _deflateEnd referenced in function _zipCloseFileInZipRaw64
1>C:\Users\a992788\Virtual Machines\Documents\Application\Palo\Palo 3.x Source Code\palo-code-546\molap\server\5.1\SourceCode\Debug\paloserver.dll : fatal error LNK1120: 8 unresolved externals
Add reference to the zdll.lib in your source.
#pragma comment (lib, "zdll.lib")
I am writing a BCI game application in VC++ and require to implement Common Spatial Pattern Filtering (CSP) for feature extraction. Due to the hefty coding involved, I prefer to use an existing CSP Matlab function that I have. I followed the steps as given in here. However, I am getting the following Link error message:
1>------ Build started: Project: Test4, Configuration: Debug Win32 ------
1>test.obj : error LNK2019: unresolved external symbol _mxGetScalar referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _mxDestroyArray referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _mxCreateDoubleScalar referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _engEvalString referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _engOpen referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _engClose referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _engGetVariable referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _engPutVariable referenced in function _main
1>test.obj : error LNK2019: unresolved external symbol _engOutputBuffer referenced in function _main
1>D:\Test4\Debug\Test4.exe : fatal error LNK1120: 9 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Could anyone please help me fix the problem? Any comments would be appreciated. Thanks in advance.
As I said in the referred post, you have to keep the platforms consistent:
The platforms of MATLAB and VC++ compile platform must be the same, i.e. Win32/x86 VC++ compile platform can only use x86 MATLAB and x64 VC++ compile platform can only use x64 MATLAB.
You're using MATLAB x64, thus you have to build your VC project in x64 too.