I'm trying to compile an igraph C code in the Visual Studio 2013, already got all libraries included in the properties, just as some examples that come with the distribution of igraph C, but i still got the following problems in the output window:
1>igraph.lib(prpack.obj) : error LNK2001: unresolved external symbol "public: __thiscall prpack::prpack_base_graph::~prpack_base_graph(void)" (??1prpack_base_graph#prpack##QAE#XZ)
1>igraph.lib(prpack.obj) : error LNK2001: unresolved external symbol "public: __thiscall prpack::prpack_igraph_graph::prpack_igraph_graph(struct igraph_s const *,struct igraph_vector_t const *,int)" (??0prpack_igraph_graph#prpack##QAE#PBUigraph_s##PBUigraph_vector_t##H#Z)
1>igraph.lib(prpack.obj) : error LNK2001: unresolved external symbol "public: __thiscall prpack::prpack_result::~prpack_result(void)" (??1prpack_result#prpack##QAE#XZ)
1>igraph.lib(prpack.obj) : error LNK2001: unresolved external symbol "public: __thiscall prpack::prpack_solver::prpack_solver(class prpack::prpack_base_graph *,bool)" (??0prpack_solver#prpack##QAE#PAVprpack_base_graph#1#_N#Z)
1>igraph.lib(prpack.obj) : error LNK2001: unresolved external symbol "public: __thiscall prpack::prpack_solver::~prpack_solver(void)" (??1prpack_solver#prpack##QAE#XZ)
1>igraph.lib(prpack.obj) : error LNK2001: unresolved external symbol "public: class prpack::prpack_result * __thiscall prpack::prpack_solver::solve(double,double,double const *,double const *,char const *)" (?solve#prpack_solver#prpack##QAEPAVprpack_result#2#NNPBN0PBD#Z)
1>C:\Users\Tradeli\Documents\Visual Studio 2013\Projects\igraph C\igraph c\Release\igraph c.exe : fatal error LNK1120: 6 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Obviously it's something related to the prpack, but i have no clue of which library do i need to include, does anyone knows how to solve this?
This is a bug in the MSVC release of igraph; try adding /DPRPACK_IGRAPH_SUPPORT=1 to the compiler options and also add PRPACK's source files from the src/ folder (basically everything that matches prpack_*.cpp) to the list of source files in the project, then recompile.
Related
I built libcurl following the instructions for building libcurl as a static library in the curl/winbuild directory to the letter. It spat out a libcurl_a.lib, a collection of .h files, which I moved into folders that I promptly added to the PATH. I then attempt to build my program with the command
cl (*my source files*) /IC:/PATH_addon/include libcurl_a.lib Ws2_32.lib Wldap32.lib /DCURL_STATICLIB /link /LIBPATH:C:/PATH_addon/lib
Note:
I am building from the command line as the code was not written in an IDE, or on this machine
C:/PATH_addon/ is a folder where I dump all the things that need to be linked into path (it is linked to my path) so that I don't pollute the default path, or my system32 folder
However when I run the command, it tells me that there are 12 unresolved symbols:
libcurl_a.lib(tftp.obj) : error LNK2001: unresolved external symbol __imp___time64
libcurl_a.lib(cookie.obj) : error LNK2001: unresolved external symbol __imp___time64
libcurl_a.lib(hostip.obj) : error LNK2001: unresolved external symbol __imp___time64
libcurl_a.lib(http.obj) : error LNK2001: unresolved external symbol __imp___time64
libcurl_a.lib(ftp.obj) : error LNK2001: unresolved external symbol __imp___time64
libcurl_a.lib(telnet.obj) : error LNK2001: unresolved external symbol __imp__strncpy
libcurl_a.lib(curl_sspi.obj) : error LNK2001: unresolved external symbol __imp__strncpy
libcurl_a.lib(url.obj) : error LNK2001: unresolved external symbol __imp__strncpy
libcurl_a.lib(strerror.obj) : error LNK2001: unresolved external symbol __imp__strncpy
libcurl_a.lib(ftp.obj) : error LNK2001: unresolved external symbol __imp__strncpy
libcurl_a.lib(warnless.obj) : error LNK2019: unresolved external symbol __imp__read referenced in function _curlx_read
OLDNAMES.lib(read.obi) : error LNK2001: unresolved external symbol __imp__read
libcurl_a.lib(warnless.obj) : error LNK2019: unresolved external symbol __imp__write referenced in function _curlx_write
OLDNAMES.lib(write.obi) : error LNK2001: unresolved external symbol __imp__write
libcurl_a.lib(parsedate.obj) : error LNK2019: unresolved external symbol __imp___gmtime64 referenced in function _Curl_gmtime
libcurl_a.lib(strerror.obj) : error LNK2019: unresolved external symbol __imp__strerror referenced in function _Curl_strerror
libcurl_a.lib(curl_threads.obj) : error LNK2019: unresolved external symbol __imp___beginthreadex referenced in function _Curl_thread_create
libcurl_a.lib(smb.obj) : error LNK2019: unresolved external symbol __imp___getpid referenced in function _smb_format_message
libcurl_a.lib(file.obj) : error LNK2019: unresolved external symbol __imp__close referenced in function _file_done
OLDNAMES.lib(close.obi) : error LNK2001: unresolved external symbol __imp__close
libcurl_a.lib(file.obj) : error LNK2019: unresolved external symbol __imp__open referenced in function _file_connect
OLDNAMES.lib(open.obi) : error LNK2001: unresolved external symbol __imp__open
libcurl_a.lib(mime.obj) : error LNK2019: unresolved external symbol __imp__access referenced in function _curl_mime_filedata
OLDNAMES.lib(access.obi) : error LNK2001: unresolved external symbol __imp__access
MSVCRT.lib(_chandler4gs_.obj) : error LNK2019: unresolved external symbol __except_handler4_common referenced in function __except_handler4
Why can't these symbols be resolved, and is there a way to fix this?
Solution (thanks in part to the incredible #Hans Passant):
Adding the /NODEFAULTLIB:LIBCMT flag fixed the issue and allowed for a successful compile and execution.
Yesterday, I installed Visual Studio 2015 RC Community Edition. As a first test, I tried building GVim from source.
I opened a command window using "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2015\Visual Studio Tools\Windows Desktop Command Prompts\VS2015 x64 Native Tools Command Prompt.lnk", set
set include=%include%;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include
so Make_mvc.mak picks up the Win32.mak file. Also, I set:
set MSVCVER=12.0
as the make file does not detect the new Visual Studio version at this point.
After this, I have:
Framework40Version=v4.0
FrameworkDir=C:\Windows\Microsoft.NET\Framework64
FrameworkDIR64=C:\Windows\Microsoft.NET\Framework64
FrameworkVersion=v4.0.30319
FrameworkVersion64=v4.0.30319
FSHARPINSTALLDIR=C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\
INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\10\\include\10.0.10056.0\ucrt;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\winrt;;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include
LIB=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files (x86)\Windows Kits\10\\lib\10.0.10056.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64;
LIBPATH=C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral;\Microsoft.VCLibs\14.0\References\CommonConfiguration\neutral;
MSVCVER=12.0
Platform=X64
PROCESSOR_ARCHITECTURE=AMD64
UniversalCRTSdkDir=C:\Program Files (x86)\Windows Kits\10\
VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\
VisualStudioVersion=14.0
VS100COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\
VS110COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\
VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 14.0\
windir=C:\Windows
WindowsSdkDir=C:\Program Files (x86)\Windows Kits\8.1\
WindowsSDK_ExecutablePath_x64=C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\
WindowsSDK_ExecutablePath_x86=C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\
I am able to build a simple program:
C:\...\Temp> type t.c
#include
int main(void) {
printf("Hello %s\n", "Stackoverflow.com");
return 0;
}
C:\...\Temp> cl t.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.22816 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
t.c
Microsoft (R) Incremental Linker Version 14.00.22816.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:t.exe
t.obj
C:\...\Temp> t.exe
Hello Stackoverflow.com
However, when I issue the command to build my GVim (something which works fine with Visual Studio 2013 CE tools), the compilation goes fine, but I get the following link errors:
C:\...\vim\src> nmake -f Make_mvc.mak CPU=AMD64 OPTIMIZE=SPACE GETTEXT=no NETBEANS=no CSCOPE=no DIRECTX=yes GUI=yes
I am snipping most of the error messages because there are a lot of them:
gui_dwrite.obj : error LNK2001: unresolved external symbol memcmp
blowfish.obj : error LNK2001: unresolved external symbol memcmp
crypt.obj : error LNK2001: unresolved external symbol memcmp
sha256.obj : error LNK2001: unresolved external symbol memcmp
undo.obj : error LNK2001: unresolved external symbol memcmp
blowfish.obj : error LNK2019: unresolved external symbol memcpy referenced in function bf_e_cblock
winclip.obj : error LNK2001: unresolved external symbol memcpy
screen.obj : error LNK2001: unresolved external symbol memcpy
sha256.obj : error LNK2001: unresolved external symbol memcpy
gui.obj : error LNK2001: unresolved external symbol memmove
gui_w32.obj : error LNK2001: unresolved external symbol memmove
tag.obj : error LNK2001: unresolved external symbol memmove
term.obj : error LNK2001: unresolved external symbol memmove
ui.obj : error LNK2001: unresolved external symbol memmove
undo.obj : error LNK2001: unresolved external symbol memmove
screen.obj : error LNK2001: unresolved external symbol memmove
search.obj : error LNK2001: unresolved external symbol memmove
spell.obj : error LNK2001: unresolved external symbol memmove
syntax.obj : error LNK2001: unresolved external symbol memmove
os_mswin.obj : error LNK2001: unresolved external symbol memmove
os_win32.obj : error LNK2001: unresolved external symbol memmove
quickfix.obj : error LNK2001: unresolved external symbol memmove
regexp.obj : error LNK2001: unresolved external symbol memmove
misc2.obj : error LNK2001: unresolved external symbol memmove
normal.obj : error LNK2001: unresolved external symbol memmove
ops.obj : error LNK2001: unresolved external symbol memmove
option.obj : error LNK2001: unresolved external symbol memmove
memline.obj : error LNK2001: unresolved external symbol memmove
menu.obj : error LNK2001: unresolved external symbol memmove
message.obj : error LNK2001: unresolved external symbol memmove
misc1.obj : error LNK2001: unresolved external symbol memmove
getchar.obj : error LNK2001: unresolved external symbol memmove
hashtab.obj : error LNK2001: unresolved external symbol memmove
mark.obj : error LNK2001: unresolved external symbol memmove
...
misc2.obj : error LNK2001: unresolved external symbol fwrite
spell.obj : error LNK2001: unresolved external symbol fwrite
edit.obj : error LNK2019: unresolved external symbol isalnum referenced in function ins_ctrl_ey
regexp.obj : error LNK2001: unresolved external symbol isalnum
ui.obj : error LNK2001: unresolved external symbol strncpy
gui_w32.obj : error LNK2001: unresolved external symbol strncpy
libXpm.lib(parse.obj) : error LNK2001: unresolved external symbol strncpy
libXpm.lib(data.obj) : error LNK2001: unresolved external symbol strncpy
regexp.obj : error LNK2001: unresolved external symbol strncpy
screen.obj : error LNK2001: unresolved external symbol strncpy
...
main.obj : error LNK2001: unresolved external symbol close
memfile.obj : error LNK2001: unresolved external symbol close
libXpm.lib(parse.obj) : error LNK2001: unresolved external symbol free
libXpm.lib(hashtab.obj) : error LNK2001: unresolved external symbol free
libXpm.lib(data.obj) : error LNK2001: unresolved external symbol free
libXpm.lib(misc.obj) : error LNK2001: unresolved external symbol free
...
eval.obj : error LNK2001: unresolved external symbol free
misc2.obj : error LNK2001: unresolved external symbol free
os_win32.obj : error LNK2001: unresolved external symbol free
gui_w32.obj : error LNK2001: unresolved external symbol free
libcmt.lib(new_scalar.obj) : error LNK2001: unresolved external symbol malloc
libXpm.lib(simx.obj) : error LNK2001: unresolved external symbol malloc
eval.obj : error LNK2001: unresolved external symbol malloc
misc2.obj : error LNK2001: unresolved external symbol malloc
os_win32.obj : error LNK2001: unresolved external symbol malloc
gui_w32.obj : error LNK2001: unresolved external symbol malloc
normal.obj : error LNK2001: unresolved external symbol realloc
regexp.obj : error LNK2001: unresolved external symbol realloc
libXpm.lib(simx.obj) : error LNK2001: unresolved external symbol realloc
eval.obj : error LNK2001: unresolved external symbol realloc
memline.obj : error LNK2001: unresolved external symbol realloc
misc1.obj : error LNK2001: unresolved external symbol realloc
misc2.obj : error LNK2001: unresolved external symbol realloc
...
ex_docmd.obj : error LNK2001: unresolved external symbol stricmp
ops.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf
option.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf
search.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf
spell.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf
fold.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf
getchar.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf
main.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf
mark.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf
eval.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf
ex_cmds.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf
ex_docmd.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf
ex_getln.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf
window.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf
gui.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf
gui_w32.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf
version.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf
spell.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf
syntax.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf
tag.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf
term.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf
regexp.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf
screen.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf
search.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf
sha256.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf
ops.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf
option.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf
...
_crt_atexit referenced in function _onexit
libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol _crt_at_quick_exit referenced in function at_quick_exit
libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol _cexit referenced in function __scrt_dllmain_uninitialize_c
libcmt.lib(exe_winmain.obj) : error LNK2001: unresolved external symbol _cexit
libcmt.lib(new_scalar.obj) : error LNK2019: unresolved external symbol _callnewh referenced in function "void * __cdecl operator new(unsigned __int64)" (??2#YAPEAX_K#Z)
libcmt.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol _seh_filter_exe referenced in function "int `int __cdecl __scrt_common_main_seh(void)'::`1'::filt$0" (?filt$0#?0??__scrt_common_main_seh##YAHXZ#4HA)
libcmt.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol _set_app_type referenced in function "int __cdecl pre_c_initialization(void)" (?pre_c_initialization##YAHXZ)
libcmt.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol __setusermatherr referenced in function "int __cdecl pre_c_initialization(void)" (?pre_c_initialization##YAHXZ)
libcmt.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol _configure_narrow_argv referenced in function "int __cdecl pre_c_initialization(void)" (?pre_c_initialization##YAHXZ)
libcmt.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol _get_narrow_winmain_command_line referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh##YAHXZ)
libcmt.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol _initterm referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh##YAHXZ)
...
libXpm.lib(rgb.obj) : error LNK2019: unresolved external symbol strdup referenced in function xpmGetRGBfromName
oldnames.lib(strdup.obj) : error LNK2001: unresolved external symbol strdup
oldnames.lib(strdup.obj) : error LNK2001: unresolved external symbol _strdup
gvim.exe : fatal error LNK1120: 183 unresolved externals
I feel like I am missing something obvious. What changed between VS 2013 and VS 2015?
It turns out this had already been reported on vim_dev mailing list, and is due to the re-organization of the C runtime.
Specifically, the /nodefaultlib option for the linker seems to cause the problem.
The patch included in Paul Moore's follow-up worked for me.
The pre-compiled XPM library included with Vim seems to statically link to MSVCRT. This issue is mentioned in CRT Library Features:
If you have more than one DLL or EXE, then you may have more than one CRT, whether or not you are using different versions of Visual C++. For example, statically linking the CRT into multiple DLLs can present the same problem. Developers encountering this problem with static CRTs have been instructed to compile with /MD to use the CRT DLL. Now that the CRT DLL has been renamed to msvcr110.dll, applications may have some components linked to msvcrt.dll and others to msvcr110.dll. If your DLLs pass CRT resources across the msvcrt.dll and msvcr110.dll boundary, you will encounter issues with mismatched CRTs and need to recompile your project with Visual C++.
I haven't tried to re-compile the included XPM library with VS2015, so XPM support is disabled in my GVim for now.
I'm trying to build VTK with VTK_WRAP_TCL=ON and VTK_USE_TK=ON but having following linker errors:
> Compiling...
vtkTkAppInit.cxx
Compiling resources...
Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
Copyright (C) Microsoft Corporation. All rights reserved.
Compiling manifest to resources...
Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
Copyright (C) Microsoft Corporation. All rights reserved.
Linking...
Creating library D:\VTK\bin\bin\Debug\vtk.lib and object D:\VTK\bin\bin\Debug\vtk.exp
vtkTkAppInit.obj : error LNK2019: unresolved external symbol __imp__Tk_MainEx referenced in function _main
vtkTkAppInit.obj : error LNK2019: unresolved external symbol __imp__Tcl_CreateInterp referenced in function _main
vtkCommonTCL.lib(vtkTclUtil.obj) : error LNK2001: unresolved external symbol __imp__Tcl_CreateInterp
vtkTkAppInit.obj : error LNK2019: unresolved external symbol __imp__Tcl_SetVar referenced in function _Tcl_AppInit
vtkCommonTCL.lib(vtkTclUtil.obj) : error LNK2001: unresolved external symbol __imp__Tcl_SetVar
vtkTkAppInit.obj : error LNK2019: unresolved external symbol __imp__Tcl_Eval referenced in function _Tcl_AppInit
vtkTkAppInit.obj : error LNK2019: unresolved external symbol __imp__Tk_Init referenced in function _Tcl_AppInit
vtkTkAppInit.obj : error LNK2019: unresolved external symbol __imp__Tcl_Init referenced in function _Tcl_AppInit
vtkCommonTCL.lib(vtkTclUtil.obj) : error LNK2019: unresolved external symbol __imp__Tcl_GetAssocData referenced in function "struct vtkTclInterpStruct * __cdecl vtkGetInterpStruct(struct Tcl_Interp *)" (?vtkGetInterpStruct##YAPAUvtkTclInterpStruct##PAUTcl_Interp###Z)
vtkFilteringTCL.lib(vtkSourceTcl.obj) : error LNK2019: unresolved external symbol __imp__Tcl_DeleteCommand referenced in function "int __cdecl vtkSourceCppCommand(class vtkSource *,struct Tcl_Interp *,int,char * * const)" (?vtkSourceCppCommand##YAHPAVvtkSource##PAUTcl_Interp##HQAPAD#Z)
vtkRenderingTCL.lib(vtkAbstractVolumeMapperTcl.obj) : error LNK2001: unresolved external symbol __imp__Tcl_DeleteCommand
vtkRenderingTCL.lib(vtkImporterTcl.obj) : error LNK2001: unresolved external symbol __imp__Tcl_DeleteCommand
vtkWidgetsTCL.lib(vtkContinuousValueWidgetRepresentationTcl.obj) : error LNK2001: unresolved external symbol __imp__Tcl_DeleteCommand
vtkFilteringTCL.lib(vtkProcessObjectTcl.obj) : error LNK2001: unresolved external symbol __imp__Tcl_DeleteCommand
vtkFilteringTCL.lib(vtkMapper2DTcl.obj) : error LNK2001: unresolved external symbol __imp__Tcl_DeleteCommand
vtkFilteringTCL.lib(vtkViewportTcl.obj) : error LNK2001: unresolved external symbol __imp__Tcl_DeleteCommand
vtkFilteringTCL.lib(vtkAbstractMapperTcl.obj) : error LNK2001: unresolved external symbol __imp__Tcl_DeleteCommand
vtkFilteringTCL.lib(vtkThreadedImageAlgorithmTcl.obj) : error LNK2001: unresolved external symbol __imp__Tcl_DeleteCommand
vtkFilteringTCL.lib(vtkImageInPlaceFilterTcl.obj) : error LNK2001: unresolved external symbol __imp__Tcl_DeleteCommand
vtkFilteringTCL.lib(vtkRectilinearGridSourceTcl.obj) : error LNK2001: unresolved external symbol __imp__Tcl_DeleteCommand
.
.
D:\VTK\bin\bin\Debug\vtk.exe : fatal error LNK1120: 65 unresolved externals
Results
Build log was saved at "file://d:\VTK\bin\Wrapping\Tcl\vtk.dir\Debug\BuildLog.htm"
vtk - 22432 error(s), 0 warning(s)
Please help to solve.
Thanks.
I installed Tclx64 version and was trying to build it with 32 bit compiler.
Problem is solved by installing x86 version and compiled it with Debug|Win32.
http://public.kitware.com/pipermail/vtkusers/2011-September/118696.html this post helped me to understand the problem.
I got a linking problem with atls.lib lately. I updated my linker's additional dependencies lines with:
comctl32.lib
C:\WinDDK\7600.16385.1\lib\ATL\i386\atls.lib
C:\WinDDK\7600.16385.1\lib\ATL\i386\atl.lib
C:\WinDDK\7600.16385.1\lib\ATL\i386\atlsd.lib
However, now, I started getting these errors.
What can cause these problems?
Thank you very much.
------ Build started: Project: hede, Configuration: Debug Win32 ------
Linking...
atlsd.lib(externs.obj) : error LNK2005: "char const * const g_pszUpdateEventName" (?g_pszUpdateEventName##3PBDB) already defined in atls.lib(externs.obj)
atlsd.lib(externs.obj) : error LNK2005: "char const * const g_pszAllocFileMapName" (?g_pszAllocFileMapName##3PBDB) already defined in atls.lib(externs.obj)
atlsd.lib(externs.obj) : error LNK2005: "char const * const g_pszKernelObjFmt" (?g_pszKernelObjFmt##3PBDB) already defined in atls.lib(externs.obj)
atlsd.lib(externs.obj) : error LNK2005: "class CAtlAllocator g_Allocator" (?g_Allocator##3VCAtlAllocator##A) already defined in atls.lib(externs.obj)
SettingPropPage.obj : error LNK2001: unresolved external symbol __forceAtlDllManifest
stdafx.obj : error LNK2001: unresolved external symbol __forceAtlDllManifest
trace.obj : error LNK2001: unresolved external symbol __forceAtlDllManifest
util.obj : error LNK2001: unresolved external symbol __forceAtlDllManifest
genericpropclasses.obj : error LNK2001: unresolved external symbol __forceAtlDllManifest
hede.obj : error LNK2001: unresolved external symbol __forceAtlDllManifest
hede2.obj : error LNK2001: unresolved external symbol __forceAtlDllManifest
propclasses.obj : error LNK2001: unresolved external symbol __forceAtlDllManifest
propclasses.obj : error LNK2019: unresolved external symbol __imp__AtlWinModuleAddCreateWndData#12 referenced in function "public: void __thiscall ATL::CAtlWinModule::AddCreateWndData(struct ATL::_AtlCreateWndData *,void *)" (?AddCreateWndData#CAtlWinModule#ATL##QAEXPAU_AtlCreateWndData#2#PAX#Z)
propclasses.obj : error LNK2019: unresolved external symbol "void __stdcall ATL::__FreeStdCallThunk(void *)" (?__FreeStdCallThunk#ATL##YGXPAX#Z) referenced in function "public: static void __cdecl ATL::_stdcallthunk::operator delete(void *)" (??3_stdcallthunk#ATL##SAXPAX#Z)
propclasses.obj : error LNK2019: unresolved external symbol __imp__AtlWinModuleExtractCreateWndData#4 referenced in function "public: void * __thiscall ATL::CAtlWinModule::ExtractCreateWndData(void)" (?ExtractCreateWndData#CAtlWinModule#ATL##QAEPAXXZ)
propclasses.obj : error LNK2019: unresolved external symbol "void * __stdcall ATL::__AllocStdCallThunk(void)" (?__AllocStdCallThunk#ATL##YGPAXXZ) referenced in function "public: static void * __cdecl ATL::_stdcallthunk::operator new(unsigned int)" (??2_stdcallthunk#ATL##SAPAXI#Z)
stdafx.obj : error LNK2019: unresolved external symbol __imp__AtlUpdateRegistryFromResourceD#20 referenced in function "public: long __stdcall ATL::CAtlModule::UpdateRegistryFromResourceDHelper(wchar_t const *,int,struct ATL::_ATL_REGMAP_ENTRY *)" (?UpdateRegistryFromResourceDHelper#CAtlModule#ATL##QAGJPB_WHPAU_ATL_REGMAP_ENTRY#2##Z)
stdafx.obj : error LNK2019: unresolved external symbol __imp__AtlCreateRegistrar#4 referenced in function "public: long __stdcall ATL::CAtlModule::UpdateRegistryFromResourceDHelper(wchar_t const *,int,struct ATL::_ATL_REGMAP_ENTRY *)" (?UpdateRegistryFromResourceDHelper#CAtlModule#ATL##QAGJPB_WHPAU_ATL_REGMAP_ENTRY#2##Z)
stdafx.obj : error LNK2019: unresolved external symbol __imp__AtlCallTermFunc#4 referenced in function "public: void __thiscall ATL::CAtlModule::Term(void)" (?Term#CAtlModule#ATL##QAEXXZ)
Debug/hede.exe : fatal error LNK1120: 8 unresolved externals
Build log was saved at "file://c:\Users\JohnDoe\Desktop\myproject\hede\Debug\BuildLog.htm"
hede- 20 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
In project settings change "Use of ATL" from "Dynamic Link to ATL" to "Static Link to ATL".
I had to debug this issue as well. Seems the DLL bulid is not working since a number of functions are missing in atl.lib.
I switched "Use of ATL" to "Static link to ATL". After that I had only 3 missing symbols left and I found that these are defined within atlthunk.lib. This one is never referenced in atlbase.h. That's why I added
#pragma comment(lib, "atlthunk.lib")
to atlbase.h right before the debug yes/no section for atls.lib/atlsd.lib
After that the build was successfull.
atls.lib is ATL's static library. atlsd.lib is that library's debug version. You're linking to both on the same build, so you get multiple definitions. In addition, atl.lib is what you should link to if you want to use ATL's dynamic library. So, either use atl.lib, or use atls.lib in your release build and atlsd.lib in your debug build. But don't mix them together.
I am trying to run the code which is written using C and that is for a dialogic board dmv 960A 4T1pci. I am trying to convert that code to a DLL but I am facing 34 errors which are almost same , here is the list of them:
Linking...
Creating library Debug/drivendll.lib and object Debug/drivendll.exp
drivendll.obj : error LNK2001: unresolved external symbol _sr_waitevt
drivendll.obj : error LNK2001: unresolved external symbol _gc_CCLibStatusEx
drivendll.obj : error LNK2001: unresolved external symbol _gc_Start
drivendll.obj : error LNK2001: unresolved external symbol _sr_setparm
drivendll.obj : error LNK2001: unresolved external symbol _gc_DropCall
drivendll.obj : error LNK2001: unresolved external symbol _gc_WaitCall
drivendll.obj : error LNK2001: unresolved external symbol _gc_ResetLineDev
drivendll.obj : error LNK2001: unresolved external symbol _gc_Close
drivendll.obj : error LNK2001: unresolved external symbol _gc_ResultInfo
drivendll.obj : error LNK2001: unresolved external symbol _gc_util_delete_parm_blk
drivendll.obj : error LNK2001: unresolved external symbol _gc_SetUserInfo
drivendll.obj : error LNK2001: unresolved external symbol _gc_util_insert_parm_val
drivendll.obj : error LNK2001: unresolved external symbol _gc_GetMetaEvent
drivendll.obj : error LNK2001: unresolved external symbol _gc_AlarmSourceObjectName
drivendll.obj : error LNK2001: unresolved external symbol _gc_AlarmSourceObjectID
drivendll.obj : error LNK2001: unresolved external symbol _gc_AlarmName
drivendll.obj : error LNK2001: unresolved external symbol _gc_AlarmNumber
drivendll.obj : error LNK2001: unresolved external symbol _gc_ReleaseCallEx
drivendll.obj : error LNK2001: unresolved external symbol _gc_AnswerCall
drivendll.obj : error LNK2001: unresolved external symbol _gc_AcceptCall
drivendll.obj : error LNK2001: unresolved external symbol _gc_GetCallInfo
drivendll.obj : error LNK2001: unresolved external symbol _gc_SetAlarmNotifyAll
drivendll.obj : error LNK2001: unresolved external symbol _gc_GetResourceH
drivendll.obj : error LNK2001: unresolved external symbol _gc_MakeCall
drivendll.obj : error LNK2001: unresolved external symbol _gc_OpenEx
drivendll.obj : error LNK2001: unresolved external symbol _gc_LoadDxParm
drivendll.obj : error LNK2001: unresolved external symbol __imp__inet_ntoa#4
drivendll.obj : error LNK2001: unresolved external symbol __imp__gethostbyname#4
drivendll.obj : error LNK2001: unresolved external symbol __imp__gethostname#8
drivendll.obj : error LNK2001: unresolved external symbol _gc_util_insert_parm_ref
drivendll.obj : error LNK2001: unresolved external symbol _gc_SetCallingNum
drivendll.obj : error LNK2001: unresolved external symbol _gc_ErrorInfo
drivendll.obj : error LNK2001: unresolved external symbol _gc_Stop
Debug/drivendll.dll : fatal error LNK1120: 33 unresolved externals
Error executing link.exe.
Update
It appears you are using the following library:
http://threebit.net/projects/jvr/download/
Ensure that you are linking to the appropriate library object for your platform, as mentioned here in another answer. There is a linux version, a windows version, and a jar for java dev. Ensure you have included the right one in your linker settings. For example, here is how we would do this in eclipse.
http://wiki.eclipse.org/CDT/User/FAQ#How_do_I_add_an_external_library_to_my_C.2B.2B_project.3F
Original Answer*
"unresolved external symbol" would suggest that in your project you're requiring and or using classes linked to some library that you are not properly including in your project. Whatever IDE you're using OR in your makefiles, ensure that you have properly included any library files required for your project.
It seems you are not using the correct compiler. A DLL should only work on windows based systems and it seems that the compiler cannot find the methods and constants that are available on the board you are working with.