error LNK2001: unresolved external symbol __CxxFrameHandler3 - visual-studio

I am migrating Qt to Qt 5.10.1 from VS 2013 to VS 2015. Getting following multiple link errors.
error LNK2001: unresolved external symbol __CxxFrameHandler3
error LNK2001: unresolved external symbol strcmp
error LNK2001: unresolved external symbol __imp__invalid_parameter_noinfo_noreturn
error LNK2001: unresolved external symbol memcpy
error LNK2001: unresolved external symbol _CxxThrowException
error LNK2001: unresolved external symbol __imp_calloc
error LNK2001: unresolved external symbol fabs
error LNK2001: unresolved external symbol __imp___stdio_common_vsprintf
error LNK2001: unresolved external symbol __std_terminate
error LNK2001: unresolved external symbol memset
error LNK2001: unresolved external symbol strlen
error LNK2001: unresolved external symbol __C_specific_handler
error LNK2001: unresolved external symbol _initialize_narrow_environment
Note:In order to migrate to VS 2015, I have right clicked on project and upgraded to latest, in my case VS 2015

In my project following link property was set to "Yes",
I have updated to "No" fixed my link error.
Project->Properties->Linker->Input->IngoreAllDefaultLibraries to "NO"

Related

OpenBLAS compilation with Visual studio 2017

I am compiling OpenBLAS with Visual Studio 2017, using this tutorial: https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio#cmake-and-visual-studio. It works perfectly. However, when I try to link to a project that is using OpenBLAS, I have errors during the link.
error LNK2019: unresolved external symbol spotrf_
error LNK2019: unresolved external symbol dpotrf_
error LNK2019: unresolved external symbol spotri_
error LNK2019: unresolved external symbol dpotri_
error LNK2019: unresolved external symbol sgeqrf_
error LNK2019: unresolved external symbol dgeqrf_
error LNK2019: unresolved external symbol sorgqr_
error LNK2019: unresolved external symbol dorgqr_
error LNK2019: unresolved external symbol ssyevd_
error LNK2019: unresolved external symbol dsyevd_
This project was working perfectly with the downloaded binary version of OpenBLAS. The only notable difference is, I changed the include path to the one generated by CMake. And instead of linking to libopenblas.dll.a, I link to openblas.lib, which should be a more Visual-Studio-friendly way of linking...
I noticed that all these functions seems to come from Fortran files. Could that be the reason? And since OpenBLAS seems to be compilable with Visual Studio, how to fix the problem?

Build Perl from Source for Windows 10 using Visual Studio 2017

I was reading this post.
http://www.cpan.org/src/README.html
and
http://search.cpan.org/~rjbs/perl-5.16.0/README.win32#Building
I extracted the files to: c:\Sources\perl-5.26.0\ Now I want to build it.
I set CCTYPE = MSVC141
Now I run:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2017\Visual Studio Tools\VC\x64 Native Tools Command Prompt for VS 2017
Later:
C:\Sources\perl-5.26.0>win32\Makefile
'win32\Makefile' is not recognized as an internal or external command,
operable program or batch file.
C:\Sources\perl-5.26.0>nmake -f win32\Makefile
Microsoft (R) Program Maintenance Utility Version 14.10.25019.0
Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fatal error U1073: don't know how to make 'config_H.vc'
Stop.
C:\Sources\perl-5.26.0>
With CMAKE:
mkdir c:\Sources\perl-5.26.0\bld
cd /d c:\Sources\perl-5.26.0\bld
cmake . -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX="c:\Custom\perl" -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
CMake Error: The source directory "C:/Sources/perl-5.26.0/bld" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
c:\Sources\perl-5.26.0\bld>
Sorry I forget to check the existence of: CMakeLists.txt file
Is it possible to build perl instead of obtain downloading from ActivePerl (The installer is not working properly) or Strawberry-perl (the site was down) ?
Please tell me.
How I must define this variables:
MSVCDIR = ???
CCHOME = $(MSVCDIR)
CCINCDIR = $(CCHOME)\include
CCLIBDIR = $(CCHOME)\lib
My Output.
generate_uudmap.c
link -out:..\generate_uudmap.exe #C:\Users\...\AppData\Local\Temp\nmFB0B.tmp
generate_uudmap.obj : error LNK2001: unresolved external symbol __imp_exit
generate_uudmap.obj : error LNK2001: unresolved external symbol __imp_fputc
generate_uudmap.obj : error LNK2001: unresolved external symbol __imp_fopen
generate_uudmap.obj : error LNK2001: unresolved external symbol __imp___acrt_iob_func
generate_uudmap.obj : error LNK2001: unresolved external symbol __imp_fclose
generate_uudmap.obj : error LNK2001: unresolved external symbol __imp___stdio_common_vfprintf
generate_uudmap.obj : error LNK2001: unresolved external symbol __imp__errno
generate_uudmap.obj : error LNK2001: unresolved external symbol __imp_fputs
generate_uudmap.obj : error LNK2001: unresolved external symbol __imp_strerror
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol _seh_filter_exe
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol _set_app_type
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol __setusermatherr
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol _configure_narrow_argv
msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol _configure_narrow_argv
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol _initialize_narrow_environment
msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol _initialize_narrow_environment
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol _get_initial_narrow_environment
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol _initterm
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol _initterm_e
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol exit
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol _exit
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol _set_fmode
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol __p___argc
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol __p___argv
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol _cexit
msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol _cexit
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol _c_exit
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol _register_thread_local_exe_atexit_callback
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol _configthreadlocale
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol _set_new_mode
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol __p__commode
msvcrt.lib(exe_main.obj) : error LNK2001: unresolved external symbol __C_specific_handler
msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol __C_specific_handler
msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol _seh_filter_dll
msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol _initialize_onexit_table
msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol _register_onexit_function
msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol _execute_onexit_table
msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol _crt_atexit
msvcrt.lib(utility.obj) : error LNK2001: unresolved external symbol _crt_at_quick_exit
msvcrt.lib(tncleanup.obj) : error LNK2001: unresolved external symbol __std_type_info_destroy_list
msvcrt.lib(utility_desktop.obj) : error LNK2001: unresolved external symbol terminate
msvcrt.lib(utility_desktop.obj) : error LNK2001: unresolved external symbol memset
..\generate_uudmap.exe : fatal error LNK1120: 38 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\link.EXE"' : return code '0x460'
Stop.
c:\Sources\perl-5.26.0\win32>
win32/Makefile does not officially have support for building with Visual Studio 2017. But, it does have support for building with VS 2015. The reason building with Visual Studio 2015 tools require a separate configuration than with building with Visual Studio 2013 tools is the same for Visual Studio 2017 tools, so you can use the same configuration.
To do so:
Open a "x64 Native Command Tools Command Prompt for VS 2017" command window from Start.
Go to the directory in which you extracted the Perl 5.26.0 sources, and edit win32/Makefile:
Set:
CCTYPE = MSVC140
...
CCHOME = C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017
CCINCDIR = $(CCHOME)\include
CCLIBDIR = $(CCHOME)\lib\x64
Noting the version dependent directory in CCHOME. Make sure you use the version that corresponds to what you have.
Run nmake in <perl source directory>\win32. Now, I usually make some more changes, but this is the minimal amount of changes necessary to have a build.
Then, nmake test, nmake install.
Note that perls built with Visual Studio 2015 and 2017 may end up being rather useless because they link with the new platform runtime which OpenSSL does not work with. I think this means you are not going to be able to use modules such as LWP, HTTP::Tiny etc with https. I haven't investigated this a lot, so if I am wrong, I would love to be corrected.
Note that Visual Studio 2013 tools are also installed when you install Visual Studio 2017, so if you can live with certain bugs and the fact that Perl's build config for VS 2013 by default ignores the C99 features included in VS 2013, or if you are willing to hand-edit config files, I have found building with that to be more reliable.
In general, you are better off using Strawberry Perl. Using the MinGW toolchain saves a lot of time if you want to use modules that depend on C libraries.

LNK2019: unresolved external symbol __imp__dclass

I am trying to build ffmpeg on visual studio for ARM architecture. I run into following linker errors:
Error 58 error LNK2019: unresolved external symbol __imp__dclass referenced in function mov_read_tkhd avformat.lib(mov.o)
Error 59 error LNK2001: unresolved external symbol __imp__dclass avformat.lib(thp.o)
Error 60 error LNK2001: unresolved external symbol __imp__dclass avutil.lib(rational.o)
Error 61 error LNK2001: unresolved external symbol __imp__dclass avutil.lib(eval.o)
What is __imp__dclass and where it is defined in Visual Studio / FFMPEG?
I get the following when I do "dumpbin /symbols mov.o"
22D 00000000 UNDEF notype External | __imp__dclass
Any ideas?
This particular issue was due to missing isnan and isinf methods in FFMPEG. There was a problem in bringing math.obj and float.obj dependencies.

wxWidgets 2.9.4 built under Visual C++ Express 2010 gives unresolved external errors

I have been trying to upgrade to wxWidgets 2.9.4 over my old 2.8.12 and have run into problems. I compiled it without errors from the command line but when I try to use them in the program that worked just fine under the previous version I get unresolved externals. I cut it down to just a bare frame and TextCtrl object and it still does this (it's basically identical to one of the sample codes at the moment).
I tried the following commands to build the static libraries:
nmake -f makefile.vc SHARED=0 BUILD=release + nmake -f makefile.vc SHARED=0 BUILD=debug
nmake -f makefile.vc SHARED=0 MONOLITHIC=0 BUILD=release + nmake -f makefile.vc SHARED=0 MONOLITHIC=0 BUILD=debug
nmake -f makefile.vc SHARED=0 BUILD=release UNICODE=0 + nmake -f makefile.vc SHARED=0 BUILD=debug UNICODE=0
nmake -f makefile.vc SHARED=0 BUILD=release UNICODE=0 MONOLITHIC=0 + nmake -f makefile.vc SHARED=0 BUILD=debug UNICODE=0 MONOLITHIC=0
Note that I tried using them with both the recommended unicode and no longer supported non-unicode (changed the project properties in Configuration Properties->General accordingly). Also, I used multi-threaded DLL /MD and /MDd linking as recommended by the wxWidgets manual.
Edit: Tried using \MT and \MTd as well, same effect.
From all of the above I get the same linker errors listed below when compiling my application. Please advise me what to do because I have ran out of ideas...
Additionally, as a final resort I built the whole thing using the converted MSVS project from the ../build/msw folder but it gave me the same results.
Debug compile
1>hworld.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall wxApp::Initialize(int &,unsigned short * *)" (?Initialize#wxApp##UAE_NAAHPAPAG#Z)
1>hworld.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsoleBase::OnAssertFailure(unsigned short const *,int,unsigned short const *,unsigned short const *,unsigned short const *)" (?OnAssertFailure#wxAppConsoleBase##UAEXPBGH000#Z)
1>hworld.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall wxAppConsoleBase::OnAssert(unsigned short const *,int,unsigned short const *,unsigned short const *)" (?OnAssert#wxAppConsoleBase##UAEXPBGH00#Z)
1>hworld.obj : error LNK2001: unresolved external symbol "unsigned short const * const wxEmptyString" (?wxEmptyString##3PBGB)
1>hworld.obj : error LNK2019: unresolved external symbol "private: static struct wxString::SubstrBufFromType<class wxScopedCharTypeBuffer<unsigned short> > __cdecl wxString::ConvertStr(char const *,unsigned int,class wxMBConv const &)" (?ConvertStr#wxString##CA?AU?$SubstrBufFromType#V?$wxScopedCharTypeBuffer#G###1#PBDIABVwxMBConv###Z) referenced in function "private: static class wxScopedCharTypeBuffer<unsigned short> __cdecl wxString::ImplStr(char const *,class wxMBConv const &)" (?ImplStr#wxString##CA?AV?$wxScopedCharTypeBuffer#G##PBDABVwxMBConv###Z)
1>hworld.obj : error LNK2019: unresolved external symbol "void __cdecl wxOnAssert(char const *,int,char const *,char const *,unsigned short const *)" (?wxOnAssert##YAXPBDH00PBG#Z) referenced in function "public: void __thiscall wxControlContainerBase::SetContainerWindow(class wxWindow *)" (?SetContainerWindow#wxControlContainerBase##QAEXPAVwxWindow###Z)
1>wxpngd.lib(wxpng_pngread.obj) : error LNK2019: unresolved external symbol _inflateInit_ referenced in function _png_create_read_struct_2
1>wxpngd.lib(wxpng_pngread.obj) : error LNK2019: unresolved external symbol _inflate referenced in function _png_read_row
1>wxpngd.lib(wxpng_pngrutil.obj) : error LNK2001: unresolved external symbol _inflate
1>wxpngd.lib(wxpng_pngread.obj) : error LNK2019: unresolved external symbol _inflateEnd referenced in function _png_read_destroy
1>wxpngd.lib(wxpng_png.obj) : error LNK2019: unresolved external symbol _crc32 referenced in function _png_reset_crc
1>wxpngd.lib(wxpng_png.obj) : error LNK2019: unresolved external symbol _inflateReset referenced in function _png_reset_zstream
1>wxpngd.lib(wxpng_pngrutil.obj) : error LNK2001: unresolved external symbol _inflateReset
1>wxpngd.lib(wxpng_pngwrite.obj) : error LNK2019: unresolved external symbol _deflate referenced in function _png_write_flush
1>wxpngd.lib(wxpng_pngwutil.obj) : error LNK2001: unresolved external symbol _deflate
1>wxpngd.lib(wxpng_pngwrite.obj) : error LNK2019: unresolved external symbol _deflateEnd referenced in function _png_write_destroy
1>wxpngd.lib(wxpng_pngwutil.obj) : error LNK2001: unresolved external symbol _deflateEnd
1>wxpngd.lib(wxpng_pngwutil.obj) : error LNK2019: unresolved external symbol _deflateInit2_ referenced in function _png_zlib_claim
1>wxpngd.lib(wxpng_pngwutil.obj) : error LNK2019: unresolved external symbol _deflateReset referenced in function _png_zlib_release
Release compile
1>wxpng.lib(wxpng_png.obj) : error LNK2001: unresolved external symbol _crc32
1>wxpng.lib(wxpng_png.obj) : error LNK2001: unresolved external symbol _inflateReset
1>wxpng.lib(wxpng_pngrutil.obj) : error LNK2001: unresolved external symbol _inflateReset
1>wxpng.lib(wxpng_pngread.obj) : error LNK2001: unresolved external symbol inflateInit
1>wxpng.lib(wxpng_pngread.obj) : error LNK2001: unresolved external symbol _inflate
1>wxpng.lib(wxpng_pngrutil.obj) : error LNK2001: unresolved external symbol _inflate
1>wxpng.lib(wxpng_pngread.obj) : error LNK2001: unresolved external symbol _inflateEnd
1>wxpng.lib(wxpng_pngwrite.obj) : error LNK2001: unresolved external symbol _deflate
1>wxpng.lib(wxpng_pngwutil.obj) : error LNK2001: unresolved external symbol _deflate
1>wxpng.lib(wxpng_pngwrite.obj) : error LNK2001: unresolved external symbol _deflateEnd
1>wxpng.lib(wxpng_pngwutil.obj) : error LNK2001: unresolved external symbol _deflateEnd
1>wxpng.lib(wxpng_pngwutil.obj) : error LNK2001: unresolved external symbol deflateInit2
1>wxpng.lib(wxpng_pngwutil.obj) : error LNK2001: unresolved external symbol _deflateReset
1>MSVCRT.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main
All errors coming from libpng are due to not linking with wxzlib[d].lib, simply add it to the list of libraries in your project. Or use the recommended way to build wxWidgets projects with MSVC and use auto-linking by prepending -I$(WXWIN)/include/msvc to your compiler header files search path.
The rest of the errors (which you only get in debug build which is suspicious on its own) are due to a mismatch between ANSI and Unicode builds. I don't know which version do you use finally as you seem to have built all of them at one moment or the other but if you use the default build, then you need to have _UNICODE and/or UNICODE defined in your project options.
Finally, to avoid such build mismatches in the future, either do nmake -f makefile.vc clean or use different build directories by using unique COMPILER_PREFIX for each build in the future. This is really not rocket science, you just need to avoid confusing yourself by doing too many things at once. Good luck!
Go to your project's settings and change General -> Character Set property accordingly. If you compiled the wx libs with UNICODE=0 (however recommended value is 1) then you need to use Multi-Byte Character set. If compiled ith UNICODE=1 then set that property to Unicode
As for runtime libs, if you compiled with SHARED=0 then in your project settings you will need to use C++ -> Code Generation -> Runtime Libraries property with 'Multi-Threaded Debug' and 'Multi-Threaded' for Debug and Release build accordingly.
The easiest way is to build wxWidgets libs from Visual Studio (there is a build/msw folder which contains solution file for VS2010) and in your project set the same properties as wx libs projects have.
I had this problem as well. I solved it by changing the setting in:
C/C++ | Language | Treat WChar_t as built in type
to Yes.

How to build this project? (jpeg lib)

Edit: im now using http://code.google.com/p/jpeg-compressor/ so i dont care about making this work anymore.
I downloaded the http://ijg.org/ source code, i tried to build it as a DLL file.
This is farthest i could build until i went into dead-end.
I noticed there was some .c files which i had to delete, but i dont know if i deleted the correct ones, there was at least these files jmemmac.c and jmemdos.c which i figured i dont need. I had to delete jmemmac.c because i compile on windows, but it gave more errors so i kept deleting those useless files, but now i dont know what to do anymore.
Here are all the errors i got when building:
1>.\ansi2knr.c(273) : warning C4013: 'exit' undefined; assuming extern returning int
1>.\example.c(116) : warning C4013: 'exit' undefined; assuming extern returning int
1>.\example.c(379) : warning C4013: 'put_scanline_someplace' undefined; assuming extern returning int
1>ckconfig.obj : error LNK2005: _main already defined in wrjpgcom.obj
1>djpeg.obj : error LNK2005: _main already defined in wrjpgcom.obj
1>rdjpgcom.obj : error LNK2005: _main already defined in wrjpgcom.obj
1>jpegtran.obj : error LNK2005: _main already defined in wrjpgcom.obj
1>cjpeg.obj : error LNK2005: _main already defined in wrjpgcom.obj
1>ansi2knr.obj : error LNK2005: _main already defined in wrjpgcom.obj
1>jmemmgr.obj : error LNK2001: unresolved external symbol _jpeg_open_backing_store
1>jmemmgr.obj : error LNK2001: unresolved external symbol _jpeg_get_small
1>jmemmgr.obj : error LNK2001: unresolved external symbol _jpeg_mem_term
1>jmemmgr.obj : error LNK2001: unresolved external symbol _jpeg_free_large
1>jmemmgr.obj : error LNK2001: unresolved external symbol _jpeg_get_large
1>jmemmgr.obj : error LNK2001: unresolved external symbol _jpeg_mem_available
1>jmemmgr.obj : error LNK2001: unresolved external symbol _jpeg_free_small
1>jmemmgr.obj : error LNK2001: unresolved external symbol _jpeg_mem_init
1>example.obj : error LNK2001: unresolved external symbol _image_height
1>example.obj : error LNK2001: unresolved external symbol _image_buffer
1>example.obj : error LNK2001: unresolved external symbol _put_scanline_someplace
1>example.obj : error LNK2001: unresolved external symbol _image_width
Ok, if you're compiling a DLL, you generally don't want any "main" functions. I assume the source files referencing a a function called "main" or "_main" are examples of how to use the library, so it should be save to get rid of those.
In jmemmac.c, there is a function called "jpeg_open_backing_store", which is one of the unresolved external symbols jmemmgr is complaining about. The function appears to have platform-dependant calls, such as the "FindFolder" function for mac.
The only thing I can think of to do is to study jmemmac.c, jmemdos.c and jmemansi.c and rewrite those functions so they will work on a windows platform.
Oh, and as for "exit" being undefined, include "stdlib.h", as it defines the exit function.

Resources