I am trying to compile Live555 test programs in Visual Studio 2010, but I wasn't able to do so.
I compiled the libraries without any problems
BasicUsageEnvironment.lib
groupsock.lib
liveMedia.lib
UsageEnvironment.lib
but when it comes to the test programs, I just couldn't get anywhere. Here is the compiler message when I compile files in the mediaServer.
Has anyone encountered this problem before?
error LNK2001: unresolved external symbol "void __cdecl operator delete(void *)" (??3#YAXPAX#Z)
error LNK2001: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2#YAPAXI#Z)
error LNK2001: unresolved external symbol ___security_cookie
error LNK2001: unresolved external symbol ___CxxFrameHandler3
error LNK2001: unresolved external symbol #__security_check_cookie#4
error LNK2001: unresolved external symbol __RTC_CheckEsp
error LNK2001: unresolved external symbol __RTC_Shutdown
error LNK2001: unresolved external symbol __RTC_Shutdown
error LNK2001: unresolved external symbol __RTC_InitBase
error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info##6B#)
error LNK2001: unresolved external symbol "public: virtual bool __thiscall Medium::isSource(void)const " (?isSource#Medium##UBE_NXZ)
<more errors>
Complete dump here: http://pastebin.com/4bVQAcdp
Update
I failed to build the project earlier because I unchecked the "Precompiled header" option when creating projects for all the libraries. When linking the libraries to my mediaServer project, VS was unable to resolve all the functions.
I was able to make it work by rebuilding them with "Precompiled header" option checked, and add #include "stdafx.h" to each and every *.cpp file.
Afterthought: I have a feeling that I only need to turn on "Precompiled header" option for the mediaServer project. Let me know if you have tried and succeeded. ;-)
Update 2
Nope. I had to turn on Precompiled Header for each and every one of the static library projects. And add #include "stdafx.h" to ~200 *.cpp files. Yep.
Update
I took a look at your full dump:
1>UsageEnvironment.lib(HashTable.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *)" (??3#YAXPAX#Z)
Based on this first error, what ever source you compiled for your UsageEnviroment Lib, has a reference to a delete operator function. My guess is that either you don't have the correct source code you altered it. Can paste the UsageEnvironment.hh file contents?
I happened to be working on building this right now, I just got it working this morning, and per your request I compiled the Test Program "mediaServer". We are operating on a few assumptions here, we are assuming that you built the static libraries correctly.
Assuming the static libraries are correct this is the solution your looking for:
Include:
c:\Live555\BasicUsageEnvironment\include
c:\Live555\liveMedia\include
c:\Live555\UsageEnvironment\include;
c:\Live555\groupsock\include
$(IncludePath)
Lib Paths:
"*Insert path to your lib files here*";
$(LibraryPath)
Linker input:
Ws2_32.lib
groupsock.lib
BasicUsageEnvironment.lib
liveMedia.lib
UsageEnvironment.lib
libBasicUsageEnvironment.lib
libgroupsock.lib
Your solution folder should look like this:
Make sure the files in Bold are there.
your Source Folder should have the following files:
mediaServer:
**DynamicRTSPServer.cpp**
**DynamicRTSPServer.hh**
**live555MediaServer.cpp**
mediaServer.vcxproj
mediaServer.vcxproj.filters
ReadMe.txt
**rtcp_from_spec.c**
**rtcp_from_spec.h**
stdafx.cpp
stdafx.h
targetver.h
**version.hh**
Based on your errors its looks like you have incorrect source files included in your project, those unresolved reference don't appear anywhere in the live555 project tar file.
http://live555.com/liveMedia/public/live555-latest.tar.gz
If this solution doesn't work, please provide screen shots of your project settings for the following tabs:
include directories
Linker Input
File listing for your project folder.
Let me know if this helps, if this doesn't work we will have to look into how your static libraries were built. We need to see where in your code, those external references are being made, and what ever is making those references need to be excluded as they don't appear in the live555 archive referenced in the link below.
Related
all.
I’m compiling Ipopt-3.9.3 in Windows 10 & Visual C++ 2010 Express.
I’ve built the projects of libCoinBlas, libConHSL, libCoinLapack as well as libIpopt, and generated libCoinBlas.lib, libCoinHSL.lib, libCoinLapack.lib as well as libIpopt.lib in the correct paths but with some warnings.
While when I tried to build the projects of IpoptAmplSolver and hs071_cpp, there exists the following fatal errors.
5> Generating Code...
5> Creating library Release\IpoptAmplSolver.lib and object Release\IpoptAmplSolver.exp
5>dlarf.obj : error LNK2019: unresolved external symbol _iladlr_ referenced in function _dlarf_
5>dlarfb.obj : error LNK2001: unresolved external symbol _iladlr_
5>dlarf.obj : error LNK2019: unresolved external symbol _iladlc_ referenced in function _dlarf_
5>dlarfb.obj : error LNK2001: unresolved external symbol _iladlc_
5>dlascl.obj : error LNK2019: unresolved external symbol _disnan_ referenced in function _dlascl_
5>dpotf2.obj : error LNK2001: unresolved external symbol _disnan_
5>Release\IpoptAmplSolver.exe : fatal error LNK1120: 3 unresolved externals
========== Rebuild All: 4 succeeded, 1 failed, 0 skipped ==========
5>------ Rebuild All started: Project: hs071_cpp, Configuration: Release Win32 ------
5> hs071_main.cpp
5> hs071_nlp.cpp
5> Generating Code...
5>dlarf.obj : error LNK2019: unresolved external symbol _iladlr_ referenced in function _dlarf_
5>dlarfb.obj : error LNK2001: unresolved external symbol _iladlr_
5>dlarf.obj : error LNK2019: unresolved external symbol _iladlc_ referenced in function _dlarf_
5>dlarfb.obj : error LNK2001: unresolved external symbol _iladlc_
5>dlascl.obj : error LNK2019: unresolved external symbol _disnan_ referenced in function _dlascl_
5>dpotf2.obj : error LNK2001: unresolved external symbol _disnan_
5>LIBCMT.lib(wincrt0.obj) : error LNK2019: unresolved external symbol _WinMain#16 referenced in function ___tmainCRTStartup
5>Release\hs071_cpp.exe : fatal error LNK1120: 4 unresolved externals
========== Rebuild All: 4 succeeded, 1 failed, 0 skipped ==========
Is there anyone who can kindly tell me how should I deal with it?
Thank you very much for your attention, and I’m looking forward to your kind aid.
Finally, I've solved this problem which is due to the undefined functions. I think my case is about a released software package rather than some specific procedure code, hence, it's a little different and relative simple.
Without knowing the specifics of the libraries you are using, I recommend that you try the following to deal with this error:
The error tells you that the linker is missing code for some function calls. This probably means that a library file is not found. Make sure that the linker can find all needed lib files. Check the property pages. Under the Linker->General->Additional library directories, make sure that the directories where your lib-files are located are present and under Linker->Input->Additional dependencies, make sure that the the lib-files are listed. Also make sure that the parameters are present for the different Configurations.
If this still does not help, check if your libraries depend on other libraries. These should be mentioned in the documentation of the libraries you are using.
I've not built this, but here's what I would try from the start. From what you've said, you've compiled the .lib files that it links against and it's failing during linking.
So here are your options...
1) You've either missed a .lib file in the input list for the linker.
2) The actual .lib file doesn't contain the symbol that the linker needs (you can check this by dumping the symbols of the .lib file)
3) Your .lib file is compiled with either the wrong platform than what you're linking with or with the wrong type ie. release/debug.
4) The symbols in your lib are decorated because you're compiling as C++ instead of C, or visa-versa.
If you go through the above steps above, I'm pretty sure you'll find your problem, but you've not really given enough information to properly answer your question. Personally, I'd have a guess that you're compiling C as C++ or you've got the wrong platform type set for one of your lib files.
Thank you all very much for your patient and detailed advices that inspired me, and I finally find out that I should add some C files which define the necessary functions into my project. The detailed solution is as follows.
For example, I want to eliminate
5>dlarf.obj : error LNK2019: unresolved external symbol _iladlr_ referenced in function _dlarf_
5>dlarfb.obj : error LNK2001: unresolved external symbol _iladlr_
Step 1: Run
f2c iladlr.f
In the Visual Stuido Command Prompt and generate iladlr.c.
Step 2: Add iladlr.c to my project.
Step 3: Rebuild.
Finally, everything goes well.
I'm in the process of converting 32bit project to x64. In most cases it just means appending 64 to library paths (and eventually building those libraries for x64). Now I assume all libraries are already ready and the code is also x64 compatible. But I keep getting errors for boost zlib library, like these:
error LNK2019: unresolved external symbol inflateEnd
error LNK2019: unresolved external symbol inflate
error LNK2019: unresolved external symbol inflateInit_
error LNK2019: unresolved external symbol deflateEnd
error LNK2019: unresolved external symbol deflate
error LNK2001: unresolved external symbol "int const boost::iostreams::zlib::default_compression"
error LNK2001: unresolved external symbol "int const boost::iostreams::zlib::deflated"
error LNK2001: unresolved external symbol "int const boost::iostreams::zlib::default_strategy"
I enabled verbose mode for linker (in MS Visual Studio you do this by adding /VERBOSE:LIB to additional linker options). Thanks to that, I can see this output line:
Searching .\..\..\libs\boost145\stage\lib64\libboost_zlib-vc100-mt-gd-1_45.lib
That would imply that the library was found in the boost145\stage\lib64. So what should I be looking for now?
One strange thing is that file that defines the first group of missing symbols (those that are not within boost) has header files within the project, zlib.h and zconf.h. Maybe this is some hint? The zlib.h defines external symbols as:
ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
Obvious question is: where the hell is lib file for this header file?
I had the same issue, to resolve the errors I download the source from zlib and built the x64 dlls/libs locally. There were a couple issues with solution file downloaded, fixes are described below.
Zlib 1.2.8 source code: http://zlib.net/zlib128.zip
Solution File for VS2012 is located at: zlib-1.2.8\contrib\vstudio\vc11\zlibvc.sln
Fixes:
Change:
<Command>cd ..\..\..\contrib\masmx64
bld_ml64.bat</Command>
to:
<Command>cd ..\..\contrib\masmx64
bld_ml64.bat</Command>
In zlibvc project properties -> Linker -> Advanced -> Image Has Safe Exception Handlers -> set to No (/SAFESEH:NO). Info about SAFESEH: Compiling libffi with VS2012 fails with fatal error LNK1281: Unable to generate SAFESEH image
This is my situation (I am very new to C++ MFC coding and I am trying to debug an existing application project)
I use this line in my code (in a visual studio 2012 MFC project)
CoCreateInstance(CLSID_PortableDeviceValues, NULL,
CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&x));
While I run the project, i get a linker error like this
error LNK2001: unresolved external symbol _CLSID_PortableDeviceValues
This happens for all the CLSID values that I am referring to in the code. Like this
error LNK2001: unresolved external symbol
_CLSID_PortableDeviceKeyCollection
error LNK2001: unresolved external symbol _IID_IPortableDeviceEventCallback
error LNK2001: unresolved external symbol _CLSID_PortableDeviceManager
error LNK2001: unresolved external symbol _CLSID_PortableDeviceServiceFTM
I checked for the declaration of "CLSID_PortableDeviceValues" and it was found in "PortableDeviceTypes.h" and I have imported that library as well.
I do not get any compiler error, but run into the linker errors mentioned above..
Can someone please help me out here. I could not resolve this ..
You will need to add PortableDeviceGUIDs.lib to your project.
(Look up the section "Requirements" in the MSDN documentation for IPortableDeviceValues)
When the linker builds your project, it is looking for the implementation data that is behind the identifier CLSID_PortableDeviceValues. This data is in the library PortableDeviceGUIDs.lib, and the linker has to be told to use this library.
The header file you included in your source code only declares the symbol "CLSID_PortableDeviceValues", without importing its implementation.
I just tried to build Qt for WinCE7.0 using VS2008 after lots of code modification I successfully compiled main libraries.
While Compiling the QtScript library I received the following linker errors:
1>Linking...
1> Creating library ..\..\lib\QtScript4.lib and object ..\..\lib\QtScript4.exp
1>BytecodeGenerator.obj : error LNK2019: unresolved external symbol __imp__Inf referenced in function "public: static double __cdecl QTWTF::FloatHashTraits<double>::emptyValue(void)" (?emptyValue#?$FloatHashTraits#N#QTWTF##SANXZ)
1>Executable.obj : error LNK2001: unresolved external symbol __imp__Inf
1>MathObject.obj : error LNK2001: unresolved external symbol __imp__Inf
1>DateMath.obj : error LNK2019: unresolved external symbol __imp__Nan referenced in function "double __cdecl QTWTF::parseDateFromNullTerminatedCharacters(char const *,bool &,int &)" (?parseDateFromNullTerminatedCharacters#QTWTF##YANPBDAA_NAAH#Z)
1>JSValue.obj : error LNK2001: unresolved external symbol __imp__Nan
1>..\..\lib\QtScript4.dll : fatal error LNK1120: 2 unresolved externals
I have absolutely no idea which libraries I missed to link with!
Thanks
If you're using Windows, I'll assume you're building in MSVS. I often start projects WITHOUT default libs and if I happen to touch "out of reach" terriotry from another lib, I add what I need as I go along.
Fortunately, MSVS is great at helping me with this. Just turn VERBOSE compiling status and see what libs it's trying to access, then just add them:
right click the project, linker, show progress -> select VERBOSE
Another method is when I check MSDN for Microsoft functions and see the lib they are declared in and add it (since VERBOSE can be overkill on my poor output window). I don't know if Qt has a detailed reference documentation (also stating the libs) but it's worth a shot.
When all else fails, just add all libs Qt could possibly want (make sure IGNORE STANDARD LIBS is disabled) then check VERBOSE and only keep those in the list.
Assuming you have all the libraries in the project, another problem is mismatched dependencies (right click the solution, startup project -> select the one you need, [project dependencies -> map each dependency for the specified libs).
Also make sure when you import an extern the lib is defined in Linker->Input.
However, if you modified the source (either adding new functions/global or static vars or you modified function signatures), the unresolved external reference means a function/var definition has no associated body. Either implement one or add { } in the definition; so if that's the case, check the functions/vars from the error message.
While trying to compile program, that uses zlib, i got following errors:
Error 1 error LNK2019: unresolved
external symbol _compress referenced
in function "void __cdecl
save_image_in_pakfile(class
std::basic_ofstream > &,struct
_IplImage *)" (?save_image_in_pakfile##YAXAAV?$basic_ofstream#DU?$char_traits#D#std###std##PAU_IplImage###Z) buffer_management.obj
Error 2 error LNK2001: unresolved
external symbol
_compress fern_based_point_classifier.obj
And two more same errors but related to uncompress function.
I use the vs2008 C++, and at the project properties I added in
C/C++ : Additional include directories the path to header files of zlib.
And at linker properties I added at additional dependencies:
zlibwapi.lib and zlibstat.lib files.
How to resolv the problem?
If I made some mistakes please show me them..