vlfeat / vlfeat

An open library of computer vision algorithms

Home Page:http://vlfeat.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error LNK2001 Unresolved External Symbol when Compiling on Windows (version 0.9.21)

ziyuedang opened this issue · comments

I am recompiling on windows using the Makefile.mak.

I changed the paths and versions to matlab and visual studio as instructed in the comments (Changes are in bold):

The changes to makefile:
`
VER = 0.9.21
ARCH = win64
DEBUG = no
BRANCH = v$(VER)-$(ARCH)
MSVSVER = 140
MSVCROOT = $(VCINSTALLDIR)
WINSDKROOT = $(WINDOWSSDKDIR)
GIT = git

!if "$(MSVCROOT)" == ""
MSVCROOT = C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
!endif

!if "$(WINSDKROOT)" == ""
WINSDKROOT = C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A
!endif

!include make/nmake_helper.mak

MATLABROOT = C:\Program Files\MATLAB\R2016a
MATLABVER =90000
MEX = "$(MATLABROOT)\bin\mex.bat"`

However, whenever I try to execute "nmake /f Makefile.mak on visual studio command prompt, the following errors occur:

mathop.obj : error LNK2001: unresolved external symbol log scalespace.obj : error LNK2001: unresolved external symbol log sift.obj : error LNK2001: unresolved external symbol log svm.obj : error LNK2001: unresolved external symbol log aib.obj : error LNK2001: unresolved external symbol log covdet.obj : error LNK2001: unresolved external symbol log gmm.obj : error LNK2001: unresolved external symbol log homkermap.obj : error LNK2001: unresolved external symbol log kmeans.obj : error LNK2019: unresolved external symbol __imp_abort referenced in function _vl_kmeans_refine_centers_lloyd_d mathop.obj : error LNK2001: unresolved external symbol __imp_abort svmdataset.obj : error LNK2001: unresolved external symbol __imp_abort vlad.obj : error LNK2001: unresolved external symbol __imp_abort hog.obj : error LNK2001: unresolved external symbol __imp_abort homkermap.obj : error LNK2001: unresolved external symbol __imp_abort ikmeans.obj : error LNK2001: unresolved external symbol __imp_abort kdtree.obj : error LNK2001: unresolved external symbol __imp_abort array.obj : error LNK2001: unresolved external symbol __imp_abort covdet.obj : error LNK2001: unresolved external symbol __imp_abort fisher.obj : error LNK2001: unresolved external symbol __imp_abort gmm.obj : error LNK2001: unresolved external symbol __imp_abort covdet.obj : error LNK2019: unresolved external symbol __imp_qsort referenced in function vl_covdet_extract_orientations_for_frame ikmeans.obj : error LNK2001: unresolved external symbol __imp_qsort kdtree.obj : error LNK2001: unresolved external symbol __imp_qsort covdet.obj : error LNK2019: unresolved external symbol atan2 referenced in function vl_covdet_extract_orientations_for_frame liop.obj : error LNK2001: unresolved external symbol atan2 sift.obj : error LNK2001: unresolved external symbol ceil slic.obj : error LNK2001: unresolved external symbol ceil svm.obj : error LNK2001: unresolved external symbol ceil covdet.obj : error LNK2001: unresolved external symbol ceil hog.obj : error LNK2001: unresolved external symbol ceil imopv.obj : error LNK2001: unresolved external symbol ceil quickshift.obj : error LNK2001: unresolved external symbol ceil rodrigues.obj : error LNK2001: unresolved external symbol cos sift.obj : error LNK2001: unresolved external symbol cos covdet.obj : error LNK2001: unresolved external symbol cos hog.obj : error LNK2001: unresolved external symbol cos homkermap.obj : error LNK2001: unresolved external symbol cos liop.obj : error LNK2001: unresolved external symbol cos quickshift.obj : error LNK2001: unresolved external symbol exp sift.obj : error LNK2001: unresolved external symbol exp svm.obj : error LNK2001: unresolved external symbol exp covdet.obj : error LNK2001: unresolved external symbol exp gmm.obj : error LNK2001: unresolved external symbol exp homkermap.obj : error LNK2001: unresolved external symbol exp imopv.obj : error LNK2001: unresolved external symbol exp covdet.obj : error LNK2019: unresolved external symbol floor referenced in function vl_covdet_extract_patch_helper scalespace.obj : error LNK2001: unresolved external symbol floor sift.obj : error LNK2001: unresolved external symbol floor slic.obj : error LNK2001: unresolved external symbol floor covdet.obj : error LNK2019: unresolved external symbol pow referenced in function vl_covdet_new homkermap.obj : error LNK2001: unresolved external symbol pow scalespace.obj : error LNK2001: unresolved external symbol pow sift.obj : error LNK2001: unresolved external symbol pow rodrigues.obj : error LNK2001: unresolved external symbol sin sift.obj : error LNK2001: unresolved external symbol sin covdet.obj : error LNK2001: unresolved external symbol sin hog.obj : error LNK2001: unresolved external symbol sin homkermap.obj : error LNK2001: unresolved external symbol sin liop.obj : error LNK2001: unresolved external symbol sin vlad.obj : error LNK2001: unresolved external symbol sqrt rodrigues.obj : error LNK2001: unresolved external symbol sqrt scalespace.obj : error LNK2001: unresolved external symbol sqrt sift.obj : error LNK2001: unresolved external symbol sqrt svm.obj : error LNK2001: unresolved external symbol sqrt kmeans.obj : error LNK2001: unresolved external symbol sqrt liop.obj : error LNK2001: unresolved external symbol sqrt mathop.obj : error LNK2001: unresolved external symbol sqrt quickshift.obj : error LNK2001: unresolved external symbol sqrt covdet.obj : error LNK2001: unresolved external symbol sqrt fisher.obj : error LNK2001: unresolved external symbol sqrt hog.obj : error LNK2001: unresolved external symbol sqrt homkermap.obj : error LNK2001: unresolved external symbol sqrt dsift.obj : error LNK2019: unresolved external symbol expf referenced in function _vl_dsift_new_kernel mathop.obj : error LNK2019: unresolved external symbol sqrtf referenced in function vl_solve_linear_system_3 scalespace.obj : error LNK2001: unresolved external symbol sqrtf vlad.obj : error LNK2001: unresolved external symbol sqrtf fisher.obj : error LNK2001: unresolved external symbol sqrtf hog.obj : error LNK2001: unresolved external symbol sqrtf kmeans.obj : error LNK2001: unresolved external symbol sqrtf lbp.obj : error LNK2001: unresolved external symbol sqrtf generic.obj : error LNK2019: unresolved external symbol __imp_calloc referenced in function vl_constructor generic.obj : error LNK2019: unresolved external symbol __imp_free referenced in function vl_thread_specific_state_delete kmeans.obj : error LNK2001: unresolved external symbol __imp_free generic.obj : error LNK2019: unresolved external symbol __imp_malloc referenced in function vl_get_thread_specific_statekmeans.obj : error LNK2001: unresolved external symbol __imp_malloc generic.obj : error LNK2019: unresolved external symbol __imp_realloc referenced in function vl_constructor generic.obj : error LNK2019: unresolved external symbol __imp___acrt_iob_func referenced in function printf getopt_long.obj : error LNK2001: unresolved external symbol __imp___acrt_iob_func generic.obj : error LNK2019: unresolved external symbol __imp___stdio_common_vfprintf referenced in function _vfprintf_lgetopt_long.obj : error LNK2001: unresolved external symbol __imp___stdio_common_vfprintf pgm.obj : error LNK2001: unresolved external symbol __imp___stdio_common_vfprintf generic.obj : error LNK2019: unresolved external symbol __imp___stdio_common_vsprintf referenced in function vl_set_last_error host.obj : error LNK2001: unresolved external symbol __imp___stdio_common_vsprintf generic.obj : error LNK2019: unresolved external symbol __imp_QueryPerformanceCounter referenced in function vl_tic MSVCRT.lib(gs_support.obj) : error LNK2001: unresolved external symbol __imp_QueryPerformanceCounter generic.obj : error LNK2019: unresolved external symbol __imp_QueryPerformanceFrequency referenced in function vl_get_thread_specific_state generic.obj : error LNK2019: unresolved external symbol __imp_InitializeCriticalSection referenced in function vl_constructor generic.obj : error LNK2019: unresolved external symbol __imp_EnterCriticalSection referenced in function vl_set_alloc_func generic.obj : error LNK2019: unresolved external symbol __imp_LeaveCriticalSection referenced in function vl_set_alloc_func generic.obj : error LNK2019: unresolved external symbol __imp_DeleteCriticalSection referenced in function vl_destructorgeneric.obj : error LNK2019: unresolved external symbol __imp_TlsAlloc referenced in function vl_constructor generic.obj : error LNK2019: unresolved external symbol __imp_TlsGetValue referenced in function vl_get_thread_specific_state generic.obj : error LNK2019: unresolved external symbol __imp_TlsSetValue referenced in function vl_get_thread_specific_state generic.obj : error LNK2019: unresolved external symbol __imp_TlsFree referenced in function vl_destructor generic.obj : error LNK2019: unresolved external symbol __imp_GetSystemInfo referenced in function vl_constructor getopt_long.obj : error LNK2019: unresolved external symbol __imp_strcspn referenced in function getopt_long getopt_long.obj : error LNK2019: unresolved external symbol __imp_strncmp referenced in function getopt_long stringop.obj : error LNK2001: unresolved external symbol __imp_strncmp hog.obj : error LNK2019: unresolved external symbol acosf referenced in function vl_hog_put_image hog.obj : error LNK2019: unresolved external symbol fmod referenced in function vl_hog_new homkermap.obj : error LNK2019: unresolved external symbol __imp_frexp referenced in function vl_homogeneouskernelmap_evaluate_d homkermap.obj : error LNK2019: unresolved external symbol __imp_ldexp referenced in function vl_homogeneouskernelmap_newlbp.obj : error LNK2019: unresolved external symbol __imp_exit referenced in function vl_lbp_new mathop.obj : error LNK2019: unresolved external symbol logf referenced in function vl_log2_f pgm.obj : error LNK2019: unresolved external symbol __imp_fclose referenced in function vl_pgm_write pgm.obj : error LNK2019: unresolved external symbol __imp_fgetc referenced in function vl_pgm_extract_head pgm.obj : error LNK2019: unresolved external symbol __imp_fopen referenced in function vl_pgm_write pgm.obj : error LNK2019: unresolved external symbol __imp_fread referenced in function vl_pgm_extract_head pgm.obj : error LNK2019: unresolved external symbol __imp_fwrite referenced in function vl_pgm_insert pgm.obj : error LNK2019: unresolved external symbol __imp_ungetc referenced in function remove_blanks pgm.obj : error LNK2019: unresolved external symbol __imp___stdio_common_vfscanf referenced in function _vfscanf_l rodrigues.obj : error LNK2019: unresolved external symbol acos referenced in function vl_irodrigues sift.obj : error LNK2019: unresolved external symbol powf referenced in function vl_sift_process_next_octave stringop.obj : error LNK2019: unresolved external symbol __imp_tolower referenced in function vl_string_casei_cmp svm.obj : error LNK2019: unresolved external symbol ceilf referenced in function vl_svm_new_with_abstract_data MSVCRT.lib(dll_dllmain.obj) : error LNK2019: unresolved external symbol _initterm referenced in function "int __cdecl dllmain_crt_process_attach(struct HINSTANCE__ * const,void * const)" (?dllmain_crt_process_attach@@YAHQEAUHINSTANCE__@@QEAX@Z) MSVCRT.lib(dll_dllmain.obj) : error LNK2019: unresolved external symbol _initterm_e referenced in function "int __cdecl dllmain_crt_process_attach(struct HINSTANCE__ * const,void * const)" (?dllmain_crt_process_attach@@YAHQEAUHINSTANCE__@@QEAX@Z) MSVCRT.lib(gs_report.obj) : error LNK2019: unresolved external symbol __imp_RtlCaptureContext referenced in function capture_current_context MSVCRT.lib(utility_desktop.obj) : error LNK2001: unresolved external symbol __imp_RtlCaptureContext MSVCRT.lib(gs_report.obj) : error LNK2019: unresolved external symbol __imp_RtlLookupFunctionEntry referenced in function capture_current_context MSVCRT.lib(utility_desktop.obj) : error LNK2001: unresolved external symbol __imp_RtlLookupFunctionEntry MSVCRT.lib(gs_report.obj) : error LNK2019: unresolved external symbol __imp_RtlVirtualUnwind referenced in function capture_current_context MSVCRT.lib(utility_desktop.obj) : error LNK2001: unresolved external symbol __imp_RtlVirtualUnwind MSVCRT.lib(gs_report.obj) : error LNK2019: unresolved external symbol __imp_UnhandledExceptionFilter referenced in function __raise_securityfailure MSVCRT.lib(utility_desktop.obj) : error LNK2001: unresolved external symbol __imp_UnhandledExceptionFilter MSVCRT.lib(gs_report.obj) : error LNK2019: unresolved external symbol __imp_SetUnhandledExceptionFilter referenced in function __raise_securityfailure MSVCRT.lib(utility_desktop.obj) : error LNK2001: unresolved external symbol __imp_SetUnhandledExceptionFilter MSVCRT.lib(gs_report.obj) : error LNK2019: unresolved external symbol __imp_GetCurrentProcess referenced in function __raise_securityfailure MSVCRT.lib(gs_report.obj) : error LNK2019: unresolved external symbol __imp_TerminateProcess referenced in function __raise_securityfailure MSVCRT.lib(gs_report.obj) : error LNK2019: unresolved external symbol IsProcessorFeaturePresent referenced in function __report_gsfailure MSVCRT.lib(utility_desktop.obj) : error LNK2001: unresolved external symbol IsProcessorFeaturePresent MSVCRT.lib(utility.obj) : error LNK2019: unresolved external symbol _seh_filter_dll referenced in function __scrt_dllmain_exception_filter MSVCRT.lib(utility.obj) : error LNK2019: unresolved external symbol _configure_narrow_argv referenced in function "public: static int __cdecl __scrt_narrow_argv_policy::configure_argv(void)" (?configure_argv@__scrt_narrow_argv_policy@@SAHXZ) MSVCRT.lib(utility.obj) : error LNK2019: unresolved external symbol _initialize_narrow_environment referenced in function __scrt_dllmain_after_initialize_c MSVCRT.lib(utility.obj) : error LNK2019: unresolved external symbol _initialize_onexit_table referenced in function __scrt_initialize_onexit_tables MSVCRT.lib(utility.obj) : error LNK2019: unresolved external symbol _register_onexit_function referenced in function _onexit MSVCRT.lib(utility.obj) : error LNK2019: unresolved external symbol _execute_onexit_table referenced in function __scrt_dllmain_uninitialize_c MSVCRT.lib(utility.obj) : error LNK2019: unresolved external symbol _crt_atexit referenced in function _onexit MSVCRT.lib(utility.obj) : error LNK2019: unresolved external symbol _crt_at_quick_exit referenced in function at_quick_exit MSVCRT.lib(utility.obj) : error LNK2019: unresolved external symbol _cexit referenced in function __scrt_dllmain_uninitialize_c MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetCurrentProcessId referenced in function __security_init_cookie MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetCurrentThreadId referenced in function __security_init_cookie MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetSystemTimeAsFileTime referenced in function __security_init_cookie MSVCRT.lib(tncleanup.obj) : error LNK2019: unresolved external symbol __imp_InitializeSListHead referenced in function "void __cdecl __scrt_initialize_type_info(void)" (?__scrt_initialize_type_info@@YAXXZ) MSVCRT.lib(utility_desktop.obj) : error LNK2019: unresolved external symbol __imp_IsDebuggerPresent referenced in function __scrt_fastfail MSVCRT.lib(utility_desktop.obj) : error LNK2019: unresolved external symbol __imp_GetStartupInfoW referenced in function __scrt_get_show_window_mode MSVCRT.lib(utility_desktop.obj) : error LNK2019: unresolved external symbol __imp_GetModuleHandleW referenced in function __scrt_is_managed_app MSVCRT.lib(utility_desktop.obj) : error LNK2019: unresolved external symbol terminate referenced in function __scrt_unhandled_exception_filter C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\uuid.lib : warning LNK4272: library machine type 'X86' conflicts with target machine type 'x64' C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86\kernel32.lib : warning LNK4272: library machine type 'X86' conflicts with target machine type 'x64' C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x86\ucrt.lib : warning LNK4272: library machine type 'X86' conflicts with target machine type 'x64' bin\win64\vl.dll : fatal error LNK1120: 77 unresolved externals NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\\bin\amd64\link.exe"' : return code '0x460' Stop.

I have done some search online and it seems like it is not including the vcruntime library? But I thought it should be already set up in the makefile?

Any help would be appreciated, thanks!

It turns out I was using "Developer Command Prompt", now I am using Native Tools Command Prompt. It works now.