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.
Related
------------------UPDATE on 5/20/2019------------------
Following the suggestion by Gilles Gouaillardet, I have compiled my Fortran code with the /NODEFAULTLIB option. Now, I get fewer error messages:
Error 1 error LNK2019: unresolved external symbol __intel_new_feature_proc_init referenced in function MAIN__Test.obj
Error 2 error LNK2019: unresolved external symbol for_set_reentrancy referenced in function MAIN__ Test.obj
Error 3 error LNK2019: unresolved external symbol for_write_seq_lis referenced in function MAIN__ Test.obj
Error 4 error LNK2001: unresolved external symbol mainCRTStartup LINK
Error 5 error LNK2001: unresolved external symbol _fltused msmpifmc.lib(mpifbind.obj)
Error 6 fatal error LNK1120: 5 unresolved externals x64\Release\Hello.exe
Thank you.
------------------UPDATE on 5/17/2019------------------
So this is a response to the comment by Gilles Gouaillardet. This is only an update to my original question and not an answer.
My code is:
program mpisimple
implicit none
integer ierr
include 'mpif.h'
call mpi_init(ierr)
! print message to screen
write(6,*) 'Hello World!'
call mpi_finalize(ierr)
end
Just to recap, I am using Visual Studio 2012 and I have downloaded Microsoft-MPI v.10.0.
The following directories have been added to the "Additional Include Directories" for Fortran tab:
C:\Program Files (x86)\Microsoft SDKs\MPI\Include\x64
C:\Program Files (x86)\Microsoft SDKs\MPI\Include
The following directories have been added to the "Additional Library Directories" for Linker tab:
C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x64
These two files have been added as the Additional Dependencies:
"msmpifmc.lib" "msmpi.lib" <- I also tried these without the quotation marks.
Now I am getting different errors, which have to do with things already defined elsewhere:
Error 1 error LNK2005: __crtSetUnhandledExceptionFilter already defined in MSVCRT.lib(MSVCR110.dll) LIBCMT.lib(winapisupp.obj)
Error 2 error LNK2005: _calloc_crt already defined in MSVCRT.lib(MSVCR110.dll) LIBCMT.lib(crtheap.obj)
Error 3 error LNK2005: _amsg_exit already defined in MSVCRT.lib(MSVCR110.dll) LIBCMT.lib(crt0dat.obj)
Error 4 error LNK2005: _cexit already defined in MSVCRT.lib(MSVCR110.dll) LIBCMT.lib(crt0dat.obj)
Error 5 error LNK2005: _exit already defined in MSVCRT.lib(MSVCR110.dll) LIBCMT.lib(crt0dat.obj)
Error 6 error LNK2005: _initterm_e already defined in MSVCRT.lib(MSVCR110.dll) LIBCMT.lib(crt0dat.obj)
Error 7 error LNK2005: exit already defined in MSVCRT.lib(MSVCR110.dll) LIBCMT.lib(crt0dat.obj)
Error 8 error LNK2005: _lock already defined in MSVCRT.lib(MSVCR110.dll) LIBCMT.lib(mlock.obj)
Error 9 error LNK2005: _unlock already defined in MSVCRT.lib(MSVCR110.dll) LIBCMT.lib(mlock.obj)
Error 10 error LNK2005: _XcptFilter already defined in MSVCRT.lib(MSVCR110.dll) LIBCMT.lib(winxfltr.obj)
Error 11 error LNK2005: _configthreadlocale already defined in MSVCRT.lib(MSVCR110.dll) LIBCMT.lib(wsetloca.obj)
Error 12 error LNK2005: "void __cdecl terminate(void)" (?terminate##YAXXZ) already defined in MSVCRT.lib(MSVCR110.dll) LIBCMT.lib(hooks.obj)
Error 13 error LNK2005: __xi_a already defined in MSVCRT.lib(cinitexe.obj) LIBCMT.lib(crt0init.obj)
Error 14 error LNK2005: __xi_z already defined in MSVCRT.lib(cinitexe.obj) LIBCMT.lib(crt0init.obj)
Error 15 error LNK2005: __xc_a already defined in MSVCRT.lib(cinitexe.obj) LIBCMT.lib(crt0init.obj)
Error 16 error LNK2005: __xc_z already defined in MSVCRT.lib(cinitexe.obj) LIBCMT.lib(crt0init.obj)
Error 17 error LNK2005: __set_app_type already defined in MSVCRT.lib(MSVCR110.dll) LIBCMT.lib(errmode.obj)
Warning 18 warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library LINK
Warning 19 warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library LINK
Error 20 fatal error LNK1169: one or more multiply defined symbols found x64\Release\Hello.exe
Thank you all for your help!
------------------ORIGINAL POST------------------
I have been trying to compile a Fortran code that uses MPI but I keep getting "unresolved external symbol" errors related to MPI. How do I link MPI libraries properly?
I am using the Intel Compiler with Visual Studio and MPI is provided by Microsoft MPI. The error messages are as follows
Error 1 error LNK2019: unresolved external symbol MPI_INIT referenced in function MAIN__ ex5f.obj
Error 2 error LNK2019: unresolved external symbol MPI_COMM_RANK referenced in function MAIN__ ex5f.obj
Error 3 error LNK2019: unresolved external symbol MPI_COMM_SIZE referenced in function MAIN__ ex5f.obj
Error 4 error LNK2019: unresolved external symbol HYPRE_IJMATRIXCREATE referenced in function MAIN__ ex5f.obj
Error 5 error LNK2019: unresolved external symbol HYPRE_IJMATRIXSETOBJECTTYPE referenced in function MAIN__ ex5f.obj
Error 6 error LNK2019: unresolved external symbol HYPRE_IJMATRIXINITIALIZE referenced in function MAIN__ ex5f.obj
Error 7 error LNK2019: unresolved external symbol HYPRE_IJMATRIXSETVALUES referenced in function MAIN__ ex5f.obj
Error 8 error LNK2019: unresolved external symbol HYPRE_IJMATRIXASSEMBLE referenced in function MAIN__ ex5f.obj
Error 9 error LNK2019: unresolved external symbol HYPRE_IJMATRIXGETOBJECT referenced in function MAIN__ ex5f.obj
Error 10 error LNK2019: unresolved external symbol HYPRE_IJVECTORCREATE referenced in function MAIN__ ex5f.obj
Error 11 error LNK2019: unresolved external symbol HYPRE_IJVECTORSETOBJECTTYPE referenced in function MAIN__ ex5f.obj
Error 12 error LNK2019: unresolved external symbol HYPRE_IJVECTORINITIALIZE referenced in function MAIN__ ex5f.obj
Error 13 error LNK2019: unresolved external symbol HYPRE_IJVECTORSETVALUES referenced in function MAIN__ ex5f.obj
Error 14 error LNK2019: unresolved external symbol HYPRE_IJVECTORASSEMBLE referenced in function MAIN__ ex5f.obj
Error 15 error LNK2019: unresolved external symbol HYPRE_IJVECTORGETOBJECT referenced in function MAIN__ ex5f.obj
Error 16 error LNK2019: unresolved external symbol HYPRE_BOOMERAMGCREATE referenced in function MAIN__ ex5f.obj
Error 17 error LNK2019: unresolved external symbol HYPRE_BOOMERAMGSETPRINTLEVEL referenced in function MAIN__ ex5f.obj
Error 18 error LNK2019: unresolved external symbol HYPRE_BOOMERAMGSETOLDDEFAULT referenced in function MAIN__ ex5f.obj
Error 19 error LNK2019: unresolved external symbol HYPRE_BOOMERAMGSETRELAXTYPE referenced in function MAIN__ ex5f.obj
Error 20 error LNK2019: unresolved external symbol HYPRE_BOOMERAMGSETRELAXORDER referenced in function MAIN__ ex5f.obj
Error 21 error LNK2019: unresolved external symbol HYPRE_BOOMERAMGSETNUMSWEEPS referenced in function MAIN__ ex5f.obj
Error 22 error LNK2019: unresolved external symbol HYPRE_BOOMERAMGSETMAXLEVELS referenced in function MAIN__ ex5f.obj
Error 23 error LNK2019: unresolved external symbol HYPRE_BOOMERAMGSETTOL referenced in function MAIN__ ex5f.obj
Error 24 error LNK2019: unresolved external symbol HYPRE_BOOMERAMGSETUP referenced in function MAIN__ ex5f.obj
Error 25 error LNK2019: unresolved external symbol HYPRE_BOOMERAMGSOLVE referenced in function MAIN__ ex5f.obj
Error 26 error LNK2019: unresolved external symbol HYPRE_BOOMERAMGGETNUMITERATIONS referenced in function MAIN__ ex5f.obj
Error 27 error LNK2019: unresolved external symbol HYPRE_BOOMERAMGGETFINALRELTVRES referenced in function MAIN__ ex5f.obj
Error 28 error LNK2019: unresolved external symbol HYPRE_BOOMERAMGDESTROY referenced in function MAIN__ ex5f.obj
Error 29 error LNK2019: unresolved external symbol HYPRE_IJMATRIXDESTROY referenced in function MAIN__ ex5f.obj
Error 30 error LNK2019: unresolved external symbol HYPRE_IJVECTORDESTROY referenced in function MAIN__ ex5f.obj
Error 31 error LNK2019: unresolved external symbol MPI_FINALIZE referenced in function MAIN__ ex5f.obj
Error 32 error LNK2001: unresolved external symbol MPI_DUP_FN ex5f.obj
Error 33 error LNK2001: unresolved external symbol MPI_NULL_DELETE_FN ex5f.obj
Error 34 error LNK2001: unresolved external symbol MPI_NULL_COPY_FN ex5f.obj
Error 35 error LNK2001: unresolved external symbol MPI_COMM_DUP_FN ex5f.obj
Error 36 error LNK2001: unresolved external symbol MPI_COMM_NULL_DELETE_FN ex5f.obj
Error 37 error LNK2001: unresolved external symbol MPI_COMM_NULL_COPY_FN ex5f.obj
Error 38 error LNK2001: unresolved external symbol MPI_WIN_DUP_FN ex5f.obj
Error 39 error LNK2001: unresolved external symbol MPI_WIN_NULL_DELETE_FN ex5f.obj
Error 40 error LNK2001: unresolved external symbol MPI_WIN_NULL_COPY_FN ex5f.obj
Error 41 error LNK2001: unresolved external symbol MPI_TYPE_DUP_FN ex5f.obj
Error 42 error LNK2001: unresolved external symbol MPI_TYPE_NULL_DELETE_FN ex5f.obj
Error 43 error LNK2001: unresolved external symbol MPI_TYPE_NULL_COPY_FN ex5f.obj
Error 44 error LNK2001: unresolved external symbol MPI_CONVERSION_FN_NULL ex5f.obj
Error 45 fatal error LNK1120: 44 unresolved externals x64\Release\Test_MPI.exe
The code also uses the Hypre library, developed at the Lawrence Livermore National Laboratory (hence those unresolved external symbols that begin with "HYPRE_"). When I first ran into this issue, I figured it had to do with filename mangling. However, when asked the Hypre library developers, the response I received was:
"These are MPI issues that don't have anything to do with name mangling in hypre (as far as I can see). The hypre library is looking for the C MPI routines while your main program is looking for the Fortran MPI routines, but it's finding neither. My guess is that you probably don't have the MPI library on your link line. You might try looking at some forums that discuss how to use MPI with Visual Studio."
I have tried several combinations of directory paths for "Additional Include Directories" and "Additional Library Directories" in Visual Studio, but that didn't help. The paths linked are:
C:\Program Files (x86)\Microsoft SDKs\MPI\Include
C:\Program Files (x86)\Microsoft SDKs\MPI\Include\x64
C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\
C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x64
I should note that the code I have been trying to compile is actually an example file included in the Hypre library distribution, and thus I doubt that the issue comes from any coding error. Nevertheless, in case it helps. the code begins with
program ex5f
implicit none
include 'mpif.h'
All I am trying to do is to compile the code. I have found past posts discussing similar issues but they weren't 100% relevant to the issue I am having. Your help and time will be greatly appreciated.
Thank you.
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"
I built ffmpeg 1.2.1 as a static lib - x64, debug. And I tried to open one of my older projects that links against it. After modifying some changed APIs and similar in my source, it compiled fine, but I have major problems with linking.
EDITED: the complete latest build output:
1>libavformat.a(mov.o) : error LNK2019: unresolved external symbol __imp__gmtime64 referenced in function mov_read_mvhd
1>libavutil.a(parseutils.o) : error LNK2001: unresolved external symbol __imp__gmtime64
1>libavformat.a(os_support.o) : error LNK2019: unresolved external symbol __imp__wsopen referenced in function ff_win32_open
1>libavcodec.a(pthread.o) : error LNK2019: unresolved external symbol __imp__beginthreadex referenced in function ff_thread_init
1>libavcodec.a(frame_thread_encoder.o) : error LNK2001: unresolved external symbol __imp__beginthreadex
1>libavutil.a(parseutils.o) : error LNK2019: unresolved external symbol __imp__localtime64 referenced in function av_parse_time
1>libavutil.a(parseutils.o) : error LNK2019: unresolved external symbol __imp__time64 referenced in function av_parse_time
1>libavutil.a(parseutils.o) : error LNK2019: unresolved external symbol __imp__mktime64 referenced in function av_parse_time
1>libmingwex.a(lib64_libmingwex_a-mingw_output_format.o) : error LNK2019: unresolved external symbol __mingw_get_msvcrt_handle referenced in function __mingw_set_output_format
1>libmingwex.a(lib64_libmingwex_a-mingw_get_codepage.o) : error LNK2001: unresolved external symbol __mingw_get_msvcrt_handle
What am I doing wrong? What am I missing here?
Does ffmpeg even work today on Windows platform as a static lib, or it becomes less functional on Windows with each new version?
First 8 errors could be solved by manually inserting
#define _CRTIMP
in some files. This will prevent incorrect use of declspec(__dllimport). We are building a static lib, not a DLL, so it shouldn't be there. I also tried using --extra-cflags='-D_CRTIMP' while running configure before building ffmpeg, but it brakes the build totally. So, manual way is the only way.
The last 2 errors are total bitch:
libmingwex.a(lib64_libmingwex_a-mingw_output_format.o) : error LNK2019: unresolved external symbol __mingw_get_msvcrt_handle referenced in function __mingw_set_output_format
1>libmingwex.a(lib64_libmingwex_a-mingw_get_codepage.o) : error LNK2001: unresolved external symbol __mingw_get_msvcrt_handle
I found these symbols in libmingw32.a (if I remember correctly). But, when I link it, I have conflicts with LIBCMTD.lib. Removing the LIBCMTD.lib creates tons of unresolved externals.So, I would say that today we are not able to build ffmpeg as static x64 lib on Windows. It was in a way expected, because each new version was less Windows friendly.
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.
Does any one know an easy way to fix the followoing errors:
1>matrixmul.cu.obj : error LNK2019: unresolved external symbol __imp_cutComparefe referenced in function main
1>matrixmul.cu.obj : error LNK2019: unresolved external symbol __imp_cutDeleteTimer referenced in function main
1>matrixmul.cu.obj : error LNK2019: unresolved external symbol __imp_cutGetTimerValue referenced in function main
1>matrixmul.cu.obj : error LNK2019: unresolved external symbol __imp_cutStopTimer referenced in function main
1>matrixmul.cu.obj : error LNK2019: unresolved external symbol __imp_cutStartTimer referenced in function main
1>matrixmul.cu.obj : error LNK2019: unresolved external symbol __imp_cutCreateTimer referenced in function main
1>matrixmul.cu.obj : error LNK2019: unresolved external symbol __imp_cutReadFilei referenced in function main
1>matrixmul.cu.obj : error LNK2019: unresolved external symbol __imp_cutReadFilef referenced in function "int __cdecl ReadFile(struct Matrix *,char *)" (?ReadFile##YAHPEAUMatrix##PEAD#Z)
1>matrixmul.cu.obj : error LNK2019: unresolved external symbol __imp_cutWriteFilef referenced in function "void __cdecl WriteFile(struct Matrix,char *)" (?WriteFile##YAXUMatrix##PEAD#Z)
I've already tried adding the lib directories in:
C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\common\lib\x64
C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\CUDALibraries\common\lib\x64
Any help is apreciated
Those symbols look like functions from the "cutil" library which is included with the CUDA SDK, so you ought to make sure that Visual Studio is set up to link against cutil.lib.