I recently made a project using opencv and c++ in visual 2008
When i build the project in Debug mode - i don't face any issues - but when i build it in release mode i get the following errors:
1>test.obj : error LNK2001: unresolved external symbol _cvHaarDetectObjects
1>test.obj : error LNK2001: unresolved external symbol _cvCvtColor
1>test.obj : error LNK2001: unresolved external symbol _cvCreateImage
1>test.obj : error LNK2001: unresolved external symbol _cvDestroyWindow
1>test.obj : error LNK2001: unresolved external symbol _cvWaitKey
1>test.obj : error LNK2001: unresolved external symbol _cvGetSize
1>test.obj : error LNK2001: unresolved external symbol _cvReleaseCapture
1>test.obj : error LNK2001: unresolved external symbol _cvCreateMemStorage
1>test.obj : error LNK2001: unresolved external symbol _cvClone
1>test.obj : error LNK2001: unresolved external symbol _cvNamedWindow
1>test.obj : error LNK2001: unresolved external symbol _cvQueryFrame
1>test.obj : error LNK2001: unresolved external symbol _cvLoad
1>test.obj : error LNK2001: unresolved external symbol _cvRectangle
1>test.obj : error LNK2001: unresolved external symbol _cvCreateCameraCapture
1>test.obj : error LNK2001: unresolved external symbol _cvGetSeqElem
1>test.obj : error LNK2001: unresolved external symbol _cvShowImage
Check Linker->Input->Additional Dependencies settings in the Release configuration ; you have undoubtedly forgotten to include the OpenCV libraries. Just copy-paste them from the Debug configuration, but don't forget to remove the d suffix.
E.g. cv210.lib : Release mode and cv210d.lib : Debug mode.
You are not including the same libraries in your release build that you include in your debug build. "unresolved external symbol" means it cannot find the implementation for a function you are referencing.
This happens when you give Additional Dependencies to Debug mode but not in Release.
Related
I have an issue when trying to use Zbar library in visual studios 2015.
I have installed the library using the ZBar 0.10 Windows installer from the link: http://zbar.sourceforge.net/download.htm.
Then i link the source folder of Zbar into my project by going to:
"Project -> Properties -> C/C++" and added installed zbar folder to "Additional Include Directories".
Apperently it finds the zbar when i include with "#include "zbar.h"" but, when i run i get the errors:
"1>------ Build started: Project: test, Configuration: Release Win32 ------
1>main.obj : error LNK2001: unresolved external symbol _zbar_image_set_data
1>main.obj : error LNK2001: unresolved external symbol
_zbar_symbol_get_loc_y
1>main.obj : error LNK2001: unresolved external symbol _zbar_image_ref
1>main.obj : error LNK2001: unresolved external symbol
_zbar_image_get_symbols
1>main.obj : error LNK2001: unresolved external symbol
_zbar_symbol_set_first_symbol
1>main.obj : error LNK2001: unresolved external symbol _zbar_symbol_get_data
1>main.obj : error LNK2001: unresolved external symbol
_zbar_image_set_userdata
1>main.obj : error LNK2001: unresolved external symbol _zbar_image_create
1>main.obj : error LNK2001: unresolved external symbol
_zbar_image_scanner_set_config
1>main.obj : error LNK2001: unresolved external symbol
_zbar_image_scanner_create
1>main.obj : error LNK2001: unresolved external symbol _zbar_symbol_get_type
1>main.obj : error LNK2001: unresolved external symbol
_zbar_image_scanner_destroy
1>main.obj : error LNK2001: unresolved external symbol _zbar_symbol_next
1>main.obj : error LNK2001: unresolved external symbol
_zbar_symbol_get_loc_size
1>main.obj : error LNK2001: unresolved external symbol _zbar_get_symbol_name
1>main.obj : error LNK2001: unresolved external symbol
_zbar_image_set_format
1>main.obj : error LNK2001: unresolved external symbol
_zbar_symbol_set_get_size
1>main.obj : error LNK2001: unresolved external symbol
_zbar_image_get_userdata
1>main.obj : error LNK2001: unresolved external symbol
_zbar_symbol_get_loc_x
1>main.obj : error LNK2001: unresolved external symbol
_zbar_symbol_get_data_length
1>main.obj : error LNK2001: unresolved external symbol _zbar_image_set_size
1>main.obj : error LNK2001: unresolved external symbol _zbar_symbol_ref
1>main.obj : error LNK2001: unresolved external symbol _zbar_symbol_set_ref
1>main.obj : error LNK2001: unresolved external symbol _zbar_scan_image
1>..\..\bin\vs2015\test.exe : fatal error LNK1120: 24 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped =========="
When i press "Local windows debuggger" aka run the code, it is set to "win32".
I've looked online for help, but nothing i found fixed the problem..
Any help is appreciated!
When you add #include <some_header_file.h> in your source code then you don't actually add the implementation to your program as long as the header file contains only inline functions.
Usually the header files contain an interface description, but little or no implementation.
Your need to add the library/libraries that contain the implementation. Then you link actually the code.
I've got an project that started as a client program. Later on I decided to implement some client to server communication to make kind of a login system. I developed it in plain HTTP post requests and it worked.
Recently I've updated my server to HTTPS and now the plain HTTP post request doesn't work any more, and since I'm going to transfer sensitive data over the web I decided to implement SSL also on my client. The alternatives I've seen includes Libcurl with OpenSSL/WolfSSL or Boost with OpenSSL. I decided to go on the Libcurl way.
So now, I've tried downloading some precompiled libcurl builds and such and with no success on linking to it, giving me some kind of this error:
1>Attacker.obj : error LNK2001: unresolved external symbol __imp__PostMessageW#16
1>GEFunc.obj : error LNK2001: unresolved external symbol __imp__EnableWindow#8
1>GEFunc.obj : error LNK2001: unresolved external symbol __imp__GetWindowTextLengthA#4
1>GEFunc.obj : error LNK2001: unresolved external symbol __imp__GetOpenFileNameA#4
1>GEFunc.obj : error LNK2001: unresolved external symbol __imp__GetClientRect#8
1>GEFunc.obj : error LNK2001: unresolved external symbol __imp__SendMessageA#16
1>GEFunc.obj : error LNK2001: unresolved external symbol __imp__SetWindowTextA#8
1>GEFunc.obj : error LNK2001: unresolved external symbol __imp__GetWindowTextA#12
1>GEFunc.obj : error LNK2001: unresolved external symbol __imp__RedrawWindow#16
1>GEFunc.obj : error LNK2001: unresolved external symbol __imp__ShowWindow#8
1>GEFunc.obj : error LNK2001: unresolved external symbol __imp__SetWindowPos#28
1>GEFunc.obj : error LNK2001: unresolved external symbol __imp__DestroyWindow#4
1>FormVarClass.obj : error LNK2001: unresolved external symbol __imp__CreateSolidBrush#4
1>FormVarClass.obj : error LNK2001: unresolved external symbol __imp__CreatePen#12
1>FormVarClass.obj : error LNK2001: unresolved external symbol __imp__CreateFontW#56
1>GameClient.obj : error LNK2001: unresolved external symbol __imp__SetParent#8
1>GameClient.obj : error LNK2001: unresolved external symbol __imp__MoveWindow#24
1>GameClient.obj : error LNK2001: unresolved external symbol __imp__AttachThreadInput#12
1>GameClient.obj : error LNK2001: unresolved external symbol __imp__GetWindowLongA#8
1>GameClient.obj : error LNK2001: unresolved external symbol __imp__SetWindowLongA#12
1>GameClient.obj : error LNK2001: unresolved external symbol __imp__GetWindowRect#8
1>GUI.obj : error LNK2001: unresolved external symbol __imp__EndPaint#8
1>GUI.obj : error LNK2001: unresolved external symbol __imp__BeginPaint#8
1>GUI.obj : error LNK2001: unresolved external symbol __imp__PostQuitMessage#4
1>GUI.obj : error LNK2001: unresolved external symbol __imp__LoadCursorW#8
1>GUI.obj : error LNK2001: unresolved external symbol __imp__LoadIconW#8
1>GUI.obj : error LNK2001: unresolved external symbol __imp__TranslateMessage#4
1>GUI.obj : error LNK2001: unresolved external symbol __imp__CreateWindowExA#48
1>GUI.obj : error LNK2001: unresolved external symbol __imp__IsDialogMessageW#8
1>GUI.obj : error LNK2001: unresolved external symbol __imp__DispatchMessageW#4
1>GUI.obj : error LNK2001: unresolved external symbol __imp__RegisterClassExW#4
1>GUI.obj : error LNK2001: unresolved external symbol __imp__CloseWindow#4
1>GUI.obj : error LNK2001: unresolved external symbol __imp__DefWindowProcW#16
1>GUI.obj : error LNK2001: unresolved external symbol __imp__GetMessageW#16
1>Main.obj : error LNK2001: unresolved external symbol __imp__SHGetFolderPathA#20
1>Mem.obj : error LNK2001: unresolved external symbol __imp__EnumWindows#8
1>Mem.obj : error LNK2001: unresolved external symbol __imp__IsWindowVisible#4
1>Mem.obj : error LNK2001: unresolved external symbol __imp__GetWindow#8
1>Mem.obj : error LNK2001: unresolved external symbol __imp__GetWindowThreadProcessId#8
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__InvalidateRect#12
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__ExtTextOutW#32
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__FillRgn#12
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__RoundRect#28
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__CombineRgn#16
1>Overrides.obj : error LNK2001: unresolved external symbol enter code here__imp__ScrollWindow#20
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__SetScrollPos#16
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__DeleteObject#4
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__SetBkColor#8
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__EnableScrollBar#12
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__SetCursor#4
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__SetBkMode#8
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__SetTextColor#8
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__GetSysColor#4
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__CreateRectRgn#16
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__CreateRoundRectRgn#24
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__DrawTextA#20
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__SendMessageW#16
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__UnionRect#12
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__FillRect#12
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__InflateRect#12
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__SelectObject#8
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__SetScrollInfo#16
1>Overrides.obj : error LNK2001: unresolved external symbol __imp__GetWindowTextLengthW#4
1>Window.obj : error LNK2001: unresolved external symbol __imp__TrackMouseEvent#4
1>libcurl.lib(strerror.obj) : error LNK2001: unresolved external symbol __imp__strerror
1>libcurl.lib(strerror.obj) : error LNK2001: unresolved external symbol __imp__strncpy
1>libcurl.lib(url.obj) : error LNK2001: unresolved external symbol __imp__strncpy
1>libcurl.lib(ftp.obj) : error LNK2001: unresolved external symbol __imp__strncpy
1>libcurl.lib(telnet.obj) : error LNK2001: unresolved external symbol __imp__strncpy
1>libcurl.lib(strerror.obj) : error LNK2001: unresolved external symbol __imp____sys_nerr
1>libcurl.lib(cookie.obj) : error LNK2001: unresolved external symbol __imp__fgets
1>libcurl.lib(netrc.obj) : error LNK2001: unresolved external symbol __imp__fgets
1>libcurl.lib(cookie.obj) : error LNK2001: unresolved external symbol __imp__fputs
1>libcurl.lib(telnet.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurl.lib(rtsp.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurl.lib(http_proxy.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurl.lib(transfer.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurl.lib(parsedate.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurl.lib(imap.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurl.lib(ftp.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurl.lib(cookie.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurl.lib(hostip.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurl.lib(url.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurl.lib(http.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurl.lib(ftp.obj) : error LNK2001: unresolved external symbol __imp__strstr
1>libcurl.lib(tftp.obj) : error LNK2001: unresolved external symbol __imp__strstr
1>libcurl.lib(digest.obj) : error LNK2001: unresolved external symbol __imp__strstr
1>libcurl.lib(ftplistparser.obj) : error LNK2001: unresolved external symbol __imp__strstr
1>libcurl.lib(vtls.obj) : error LNK2001: unresolved external symbol __imp__strstr
1>libcurl.lib(url.obj) : error LNK2001: unresolved external symbol __imp__strstr
1>libcurl.lib(http.obj) : error LNK2001: unresolved external symbol __imp__strstr
1>libcurl.lib(transfer.obj) : error LNK2001: unresolved external symbol __imp__strstr
1>libcurl.lib(vtls.obj) : error LNK2001: unresolved external symbol __imp__fread
1>libcurl.lib(url.obj) : error LNK2001: unresolved external symbol __imp__fread
1>libcurl.lib(transfer.obj) : error LNK2001: unresolved external symbol __imp__fread
1>libcurl.lib(formdata.obj) : error LNK2001: unresolved external symbol __imp__fread
1>libcurl.lib(warnless.obj) : error LNK2001: unresolved external symbol __imp__read
1>OLDNAMES.lib(read.obi) : error LNK2001: unresolved external symbol __imp__read
1>libcurl.lib(warnless.obj) : error LNK2001: unresolved external symbol __imp__write
1>OLDNAMES.lib(write.obi) : error LNK2001: unresolved external symbol __imp__write
1>libcurl.lib(curl_threads.obj) : error LNK2001: unresolved external symbol __imp___beginthreadex
1>libcurl.lib(file.obj) : error LNK2001: unresolved external symbol __imp__close
1>OLDNAMES.lib(close.obi) : error LNK2001: unresolved external symbol __imp__close
1>libcurl.lib(file.obj) : error LNK2001: unresolved external symbol __imp__open
1>OLDNAMES.lib(open.obi) : error LNK2001: unresolved external symbol __imp__open
1>libcurl.lib(file.obj) : error LNK2001: unresolved external symbol __imp___fstat64
1>libcurl.lib(smb.obj) : error LNK2001: unresolved external symbol __imp___getpid
1>libcurl.lib(system_win32.obj) : error LNK2001: unresolved external symbol __imp___mbspbrk
1>libcurl.lib(formdata.obj) : error LNK2001: unresolved external symbol __imp__feof
1>libcurl.lib(formdata.obj) : error LNK2001: unresolved external symbol __imp__ferror
1>libcurl.lib(formdata.obj) : error LNK2001: unresolved external symbol __imp___stat64
Then I tried building the Libcurl from myself and downloaded the latest version from their site and built it from scratch, using the "LIB Debug - LIB OpenSSL" build option. Linked to OpenSSL libs and pointed to their include directories, it compiled and built me the libcurl.lib file.
So, in my main project, now I included both the libcurl include dir and the openssl include dir, then I linked both of these corresponding Lib folder so it should be alright.
http://prntscr.com/eg389b.
Then in the linker additional dependencies I've set to "crypt32.lib;ws2_32.lib;wldap32.lib;libeay32.lib;ssleay32.lib;libcurld.lib". This is all the steps I've found that should be done to work, but even then I've been getting the exactly same unresolved external symbol error.
PS: Starting from scratch wouldn't be an option.
PS2: For the sake of portability, I would prefer building my program as himself without the need of external DLLs other than the VC++ redist.
EDIT 1
By now, using the method described here LibCurl - Release Static Lib linking problems I've reduced the number of unresolved external symbols drastically and traced them back to the libcurld.lib, OLDNAMES.lib and MSVCRTD.lib. So only the three of those are appearing and bugging me out.
1>libcurld.lib(strerror.obj) : error LNK2019: unresolved external symbol __imp__strerror referenced in function _Curl_strerror
1>libcurld.lib(curl_gethostname.obj) : error LNK2001: unresolved external symbol __imp__strncpy
1>libcurld.lib(strerror.obj) : error LNK2001: unresolved external symbol __imp__strncpy
1>libcurld.lib(url.obj) : error LNK2001: unresolved external symbol __imp__strncpy
1>libcurld.lib(ftp.obj) : error LNK2001: unresolved external symbol __imp__strncpy
1>libcurld.lib(telnet.obj) : error LNK2001: unresolved external symbol __imp__strncpy
1>libcurld.lib(rand.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(http_ntlm.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(http_proxy.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(ntlm.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(pingpong.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(openssl.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(imap.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(telnet.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(rtsp.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(conncache.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(warnless.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(curl_addrinfo.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(inet_ntop.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(connect.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(transfer.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(http.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(wildcard.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(hostip.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(vtls.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(url.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(sendf.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(strerror.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(slist.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(multi.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(asyn-thread.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libcurld.lib(strerror.obj) : error LNK2019: unresolved external symbol __imp____sys_nerr referenced in function _Curl_strerror
1>libcurld.lib(cookie.obj) : error LNK2019: unresolved external symbol __imp__fgets referenced in function _get_line
1>libcurld.lib(netrc.obj) : error LNK2001: unresolved external symbol __imp__fgets
1>libcurld.lib(cookie.obj) : error LNK2019: unresolved external symbol __imp__fputs referenced in function _cookie_output
1>libcurld.lib(telnet.obj) : error LNK2019: unresolved external symbol __imp____stdio_common_vsscanf referenced in function _sendsuboption
1>libcurld.lib(rtsp.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurld.lib(http_proxy.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurld.lib(http.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurld.lib(parsedate.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurld.lib(imap.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurld.lib(ftp.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurld.lib(cookie.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurld.lib(hostip.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurld.lib(url.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurld.lib(transfer.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
1>libcurld.lib(ftp.obj) : error LNK2019: unresolved external symbol __imp__strstr referenced in function _ftp_statemach_act
1>libcurld.lib(tftp.obj) : error LNK2001: unresolved external symbol __imp__strstr
1>libcurld.lib(digest.obj) : error LNK2001: unresolved external symbol __imp__strstr
1>libcurld.lib(ftplistparser.obj) : error LNK2001: unresolved external symbol __imp__strstr
1>libcurld.lib(vtls.obj) : error LNK2001: unresolved external symbol __imp__strstr
1>libcurld.lib(url.obj) : error LNK2001: unresolved external symbol __imp__strstr
1>libcurld.lib(transfer.obj) : error LNK2001: unresolved external symbol __imp__strstr
1>libcurld.lib(http.obj) : error LNK2001: unresolved external symbol __imp__strstr
1>libcurld.lib(vtls.obj) : error LNK2019: unresolved external symbol __imp__fread referenced in function _Curl_pin_peer_pubkey
1>libcurld.lib(url.obj) : error LNK2001: unresolved external symbol __imp__fread
1>libcurld.lib(transfer.obj) : error LNK2001: unresolved external symbol __imp__fread
1>libcurld.lib(formdata.obj) : error LNK2001: unresolved external symbol __imp__fread
1>libcurld.lib(warnless.obj) : error LNK2019: unresolved external symbol __imp__read referenced in function _curlx_read
1>OLDNAMES.lib(read.obi) : error LNK2001: unresolved external symbol __imp__read
1>libcurld.lib(warnless.obj) : error LNK2019: unresolved external symbol __imp__write referenced in function _curlx_write
1>OLDNAMES.lib(write.obi) : error LNK2001: unresolved external symbol __imp__write
1>libcurld.lib(curl_threads.obj) : error LNK2019: unresolved external symbol __imp___beginthreadex referenced in function _Curl_thread_create
1>libcurld.lib(file.obj) : error LNK2019: unresolved external symbol __imp__close referenced in function _file_done
1>OLDNAMES.lib(close.obi) : error LNK2001: unresolved external symbol __imp__close
1>libcurld.lib(file.obj) : error LNK2019: unresolved external symbol __imp__open referenced in function _file_connect
1>OLDNAMES.lib(open.obi) : error LNK2001: unresolved external symbol __imp__open
1>libcurld.lib(file.obj) : error LNK2019: unresolved external symbol __imp___fstat64 referenced in function _file_do
1>libcurld.lib(smb.obj) : error LNK2019: unresolved external symbol __imp___getpid referenced in function _smb_format_message
1>libcurld.lib(system_win32.obj) : error LNK2019: unresolved external symbol __imp___mbspbrk referenced in function __tcspbrk
1>libcurld.lib(formdata.obj) : error LNK2019: unresolved external symbol __imp__feof referenced in function _Curl_getformdata
1>libcurld.lib(formdata.obj) : error LNK2019: unresolved external symbol __imp__ferror referenced in function _Curl_getformdata
1>libcurld.lib(formdata.obj) : error LNK2019: unresolved external symbol __imp___stat64 referenced in function _AddFormData
1>MSVCRTD.lib(_chandler4gs_.obj) : error LNK2019: unresolved external symbol __except_handler4_common referenced in function __except_handler4
You must change the libcurl compile option to Mtd/Mt.
Can you describe how you built libcurl?
It looks like you are not using the same version of the c library in your project and in libcurl. Are you using the same compiler? Visual Studio calls this the "Platform Toolset". I remember compiling libcurl in the past, but I didn't go the static lib route. It seems to be a problem with a mismatch of the C library. When you try to link this library to another program with a different version of the C library, it becomes ambiguous which functions you are referring to.
I just checked the libcurl bundle from their website. There is a sln project curl-7.53.1\projects\Windows\VC14 that you should open. From there, make sure that you select "LIB Debug - [ssl library choice]" and that you're using the same arch, like 32 bits or 64 bits, in both projects.
I don't think that simply adding a single switch to the compiler is enough.
Something I've just seen on curl website :
As a general rule, building a DLL with static CRT linkage is highly
discouraged, and intermixing CRTs in the same app is something to
avoid at any cost.
This is in Visual Studio 2010. I can't find any documentation anywhere that says which library contains these functions. I'm already listing these libraries as dependencies:
Qt5OpenGL.lib;Qt5Gui.lib;Qt5Widgets.lib;qtmaind.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5OpenGLd.lib;Qt5Sqld.lib;Qt5Networkd.lib;opengl32.lib;glu32.lib
I appreciate any help here, as I'm stuck.
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glDeleteProgramsARB#8
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glDeleteShader#4
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glDeleteProgram#4
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glDetachShader#8
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glDeleteBuffersARB#8
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glUnmapBufferARB#4
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glBindBufferARB#8
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glMapBufferARB#8
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glActiveTexture#4
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glUseProgram#4
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glProgramLocalParameter4fARB#24
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glUniform4f#20
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glGetUniformLocation#8
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glUniform1i#8
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glLinkProgram#4
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glAttachShader#8
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glCreateProgram#0
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glCompileShader#4
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glShaderSource#16
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glCreateShader#4
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glGetShaderInfoLog#16
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glGetShaderiv#12
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glGetProgramInfoLog#16
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glGetProgramiv#12
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glProgramStringARB#16
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glBindProgramARB#8
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glGenProgramsARB#8
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glBufferDataARB#16
1>videograph_opengld.lib(videorenderer.obj) : error LNK2001: unresolved external symbol _glGenBuffersARB#8
The symbols your linker reports missing are actually not contained in any library you could link to in Windows. They're modern OpenGL profile and extension functions which need to be loaded at runtime after a OpenGL context has been created.
That you get reported those symbols missing indicates, that something has been messed up very seriously when building the videograph library you're using; or the author of that library didn't care much for seamless integration into other projects.
Note that using an extension loader-wrapper library like GLEW may not help you there, because those must be initialized, e.g. by calling glewInit, but libraries are kind of black boxes, so you don't know when to call it. You can try linking with GLEW and call glewInit() at a point where you have an OpenGL context, but YMMV.
There was an #ifdef Q_WS_WIN wrapper to name the functions for the DLL, and it was not defined. Qt changed to Q_OS_WIN in Qt5, so making that substitution fixed the problem.
You might be missing some other key dependencies, open up Properties -> Linker -> Input and set Additional Dependencies to
opengl32.lib
glu32.lib
delayimp.lib
imm32.lib
winmm.lib
plus whatever you currently have, the reference im using might be dated though, you can find it here
The setup:
I have successfully compiled DarkGDK, a library designed for use with DirectX SDK 2007 and VS 2008, in VS 2013 with DirectX SDK 2010. I replaced one of the component libraries with a custom dummy library to resolve DirectX conflicts. I was able to successfully compile all of these component libraries.
The Problem:
When I compile my project that makes use of the DarkGDK libraries in Release mode, everything works as expected. I do get an message box complaining that the binary was built without debug information, but my program runs. However, in Debug mode, I get a number of errors. Below find a sample that I believe represents the lot well:
1>convmdl.lib(ConvMDL.obj) : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "void __cdecl QuaternionSlerp(float const * const,float * const,float,float * const)" (?QuaternionSlerp##YAXQBMQAMM1#Z)
1>libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>system.lib(CSystemC.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>system.lib(dxdiaginfo.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>convx.lib(ConvX.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>convmd3.lib(ConvMD3.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(CBSPTree.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(CCompiler.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(ProcessHSR.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>world.lib(Patch.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(Universe.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(cLightMaps.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(CSG.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(NVMeshMenderD3DX.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>image.lib(CImageC.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>animation.lib(CAnimation.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(DBOFormat.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>basic3D.lib(CObjectManagerC.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>core.lib(RenderList.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>display.lib(CGfxC.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>file.lib(CFileC.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>sprites.lib(CSpriteManagerC.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>Debug\Weapon Creator 2 - Project Golden Girl.exe : fatal error LNK1120: 1 unresolved externals
I have been searching about this issue for a few days now. I have have checked all the projects' settings that belong to the DarkGDK library and my own project's settings. In Debug configuration they are all using "Multi-threaded Debug (/MTd)".
TL;DR
I am getting the above errors when attempting to compile a project in Debug configuration that uses the DarkGDK Library. All projects have the same Windows Library and C run time settings.
Thank you!
Edit: Errors changed to reflect Dauphic's contribution.
You're mixing debug and release runtimes.
__CrtDbgReportW only exists in the debug runtime. If it's unresolved, it means you're probably compiling using the release runtime, but one of your libraries is using the debug runtime. You have to recompile one or the other, so they both use the same version.
You can find the runtime property at Project Properties -> C/C++ -> Code Generation -> Runtime Library
For the unresolved ATL symbol, I believe you need to link atls.lib.
I wrote a code in C++ called FaceTracker.cpp and other code in Matlab that do some analyzes and statics.
What I need to do is adding a button in matlab that calls the FaceTracker when being pressed. I tried to use the following command:
system (['FaceTracker.exe <' nameOfVideo]);
but it doesn't work. It opens the FaceTracker.exe GUI, then it stops ! (Like when internet explorer or any other program does sometimes\hang) with the msg "FaceTracker.exe stoped working.
When I tried to run the .exe from command prompt it showed me the following error:
Assertion Faile: Type == IO::TRACKER ... Debug error! R6010 - abort() has been called.
From what i understd from the answers\ other sites is that I need to statically link libraries.
I read in one site that I need to make the following changes:
The CRT:
• Configuration Properties -> C/C++ -> Code Generation: Where it reads Runtime Library, change to Multi-Threaded (/MT).
The manifest must go:
• Configuration Properties -> Manifest Tool -> Input and Output: Where it reads Embed Manifest, change to No.
But when I do it (Change to /MT) I start getting the following errors:
1> Generating Code... 1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library 1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW 1>Tracker.obj : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "public: void
__thiscall FACETRACKER::Tracker::Load(char const *)" (?Load#Tracker#FACETRACKER##QAEXPBD#Z) 1>libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW 1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
__CrtDbgReportW 1>libcpmtd.lib(cin.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW 1>IO.obj : error LNK2001: unresolved external symbol __CrtDbgReportW 1>Patch.obj : error LNK2001: unresolved external symbol __CrtDbgReportW 1>PAW.obj : error LNK2001: unresolved external symbol __CrtDbgReportW 1>PDM.obj : error LNK2001: unresolved external symbol __CrtDbgReportW 1>CLM.obj : error LNK2001: unresolved external symbol __CrtDbgReportW 1>FaceTracker.obj : error LNK2001: unresolved external symbol __CrtDbgReportW 1>FCheck.obj : error LNK2001: unresolved external symbol __CrtDbgReportW 1>FDet.obj : error LNK2001: unresolved external symbol __CrtDbgReportW 1>libcpmtd.lib(cin.obj) : error LNK2001: unresolved external symbol
__free_dbg 1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __free_dbg 1>Tracker.obj : error LNK2001: unresolved external symbol __free_dbg 1>libcpmtd.lib(xdebug.obj) : error LNK2001: unresolved external symbol __free_dbg 1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external symbol __free_dbg 1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol
__free_dbg 1>IO.obj : error LNK2001: unresolved external symbol __free_dbg 1>Patch.obj : error LNK2001: unresolved external symbol __free_dbg 1>PAW.obj : error LNK2001: unresolved external symbol __free_dbg 1>PDM.obj : error LNK2001: unresolved external symbol __free_dbg 1>CLM.obj : error LNK2019: unresolved external symbol __free_dbg referenced in function "private: void __thiscall std::_Yarn<char>::_Tidy(void)" (?_Tidy#?$_Yarn#D#std##AAEXXZ) 1>FaceTracker.obj : error LNK2001: unresolved external symbol
__free_dbg 1>FCheck.obj : error LNK2001: unresolved external symbol __free_dbg 1>FDet.obj : error LNK2001: unresolved external symbol __free_dbg 1>libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char
*,int)" (??2#YAPAXIABU_DebugHeapTag_t#std##PADH#Z) 1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external symbol __malloc_dbg 1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __malloc_dbg 1>libcpmtd.lib(_tolower.obj) : error LNK2019: unresolved external symbol __calloc_dbg referenced in function __Getctype 1>C:\Users\wew\Documents\Jam3a\PROJECT-2012!!\FindSymetryInFaces\FaceTracker\Debug\FaceTracker.exe : fatal error LNK1120: 4 unresolved externals
Any Suggestions?
What do I Have to do in order to be able to use the FaceTracker.exe in every computer, also the ones that doesn't have c++\vs compiler?
besides, why does my program OPENS when I call it from matlab but then Hangs\stops working?
Thank in advance.
This almost certainly has nothing to do with debug versus release or whether mt is enabled. You are not making a matlab extension, just using a binary from the command line. If the program works when you type things in from the command line, it should work when called from Matlab unless you are running low on memory (highly unlikely also).
I would examine the contents of . .
['FaceTracker.exe < ' InputVid]
...and copy and paste the string directly into the command line (system, not Matlab) to see if you can replicate the error. The error is most likely occurring because your exe is not handling the file string well.
Try putting the inputvid, calling m file, and FaceTracker.exe in the working directory to make the most simple scenario. If that works, make things more complex by placing input vid into another directory and bug hunt from there.
Best of luck!
I think this exe file depends on some other libraries. You should copy them into one of the directories in your system parameter PATH. Or you can use the static link option when build your project.
Your applications don't require the entire Visual C++ compiler to be installed, just the runtime library. Microsoft has a free redistributable which can add this runtime library to any computer. You can find vcredist_x86.exe in your Visual C++ install path, or download it from http://www.microsoft.com/en-us/download/details.aspx?id=8328