I am trying to compile FLANN_Example.cpp in Visual Studio 2010. The file is a usage example of the Fast Library for Approximate Nearest Neighbors (FLANN); it is intended to produce an executable. I went through the whole CMake routine and installed the HD5F library (a dependency) set up for static linking.
I can compile every thing else - except for flann_example.cpp.
Here is the output:
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
2>------ Build started: Project: flann_cpp_s, Configuration: Debug Win32 ------
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _malloc already defined in LIBCMTD.lib(dbgmalloc.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _memmove already defined in LIBCMTD.lib(memmove.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgfree.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fprintf already defined in LIBCMTD.lib(fprintf.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: ___iob_func already defined in LIBCMTD.lib(_file.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _sprintf already defined in LIBCMTD.lib(sprintf.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _setvbuf already defined in LIBCMTD.lib(setvbuf.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strtol already defined in LIBCMTD.lib(strtol.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _isdigit already defined in LIBCMTD.lib(_ctype.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _isalpha already defined in LIBCMTD.lib(_ctype.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _abort already defined in LIBCMTD.lib(abort.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strncmp already defined in LIBCMTD.lib(strncmp.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fopen already defined in LIBCMTD.lib(fopen.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _isspace already defined in LIBCMTD.lib(_ctype.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __errno already defined in LIBCMTD.lib(dosmap.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strrchr already defined in LIBCMTD.lib(strrchr.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _isalnum already defined in LIBCMTD.lib(_ctype.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strcspn already defined in LIBCMTD.lib(strcspn.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __read already defined in LIBCMTD.lib(read.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __get_osfhandle already defined in LIBCMTD.lib(osfinfo.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __open already defined in LIBCMTD.lib(open.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __write already defined in LIBCMTD.lib(write.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __lseeki64 already defined in LIBCMTD.lib(lseeki64.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __chsize_s already defined in LIBCMTD.lib(chsize.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __close already defined in LIBCMTD.lib(close.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __fileno already defined in LIBCMTD.lib(fileno.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fread already defined in LIBCMTD.lib(fread.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fwrite already defined in LIBCMTD.lib(fwrite.obj)
2>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fflush already defined in LIBCMTD.lib(fflush.obj)
2>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info##AAE#ABV0##Z) already defined in LIBCMTD.lib(typinfo.obj)
2>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info##AAEAAV0#ABV0##Z) already defined in LIBCMTD.lib(typinfo.obj)
2>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
2>C:\flann-1.6.11-src\bin\lib\Debug\flann_example.exe : fatal error LNK1169: one or more multiply defined symbols found
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Here are my Additional Include Directories:
C:\Program Files %28x86%29\HDF Group\HDF5\1.8.7\include\cpp;
C:/flann-1.6.11-src/src/cpp;
%(AdditionalIncludeDirectories)
Here are my Additional Dependencies under Linker:
C:\Program Files (x86)\HDF Group\HDF5\1.8.7\lib\hdf5_cpp.lib;
C:\Program Files (x86)\HDF Group\HDF5\1.8.7\lib\hdf5.lib;
C:\Program Files (x86)\HDF Group\HDF5\1.8.7\lib\hdf5_hl_cpp.lib;
C:\Program Files (x86)\HDF Group\HDF5\1.8.7\lib\hdf5_hl.lib;
C:\Program Files (x86)\HDF Group\HDF5\1.8.7\lib\tools\hdf5_tools.lib;
C:\Program Files (x86)\HDF Group\HDF5\1.8.7\lib\zlib.lib;
C:\Program Files (x86)\HDF Group\HDF5\1.8.7\lib\libszip.lib;
C:\flann-1.6.11-src\bin\lib\Debug\flann_cpp_s.lib;
C:\flann-1.6.11-src\bin\lib\Debug\flann_s.lib;
C:\flann-1.6.11-src\bin\lib\Debug\flann_cpp-gd.lib;
C:\flann-1.6.11-src\bin\lib\Debug\flann.lib;
C:\flann-1.6.11-src\bin\lib\Debug\flann_cpp_s-gd.lib;
C:\flann-1.6.11-src\bin\lib\Debug\flann_cpp.lib;%(AdditionalDependencies)
Compiler Options:
/I"C:\Program Files (x86)\HDF Group\HDF5\1.8.7\include\cpp"
/I"C:/flann-1.6.11- src/src/cpp" /Zi /nologo /W3 /WX- /Od /Ob0 /Oy-
/D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_FLANN_VERSION=1.6.11" /D
"FLANN_STATIC" /D "CMAKE_INTDIR=\"Debug\"" /D "_MBCS" /Gm- /EHsc /RTC1
/MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR
/Fp"flann_cpp_s.dir\Debug\flann_example.pch" /Fa"Debug"
/Fo"flann_cpp_s.dir\Debug\"
/Fd"C:/flann-1.6.11-src/bin/lib/Debug/flann_cpp_s.pdb" /Gd /TP
/analyze- /errorReport:queue
Some help would be really appreciated! I have spent an inordinate amount of time on this.
This turned out to be yet another case of 'Make sure you are compiling everything statically'
Related
After compiling everything, I get those errors on Visual C++ Studio 2010.
Probably I am missing any library? If it's that can you help me to guess which one?Err
1> Creating library \Bin\Engine.lib and object \Bin\Engine.exp
1>UILoginNew.obj : error LNK2001: unresolved external symbol "public: void __thiscall boost::thread::detach(void)" (?detach#thread#boost##QAEXXZ)
1>UILoginNew.obj : error LNK2001: unresolved external symbol "private: bool __thiscall boost::thread::start_thread_noexcept(void)" (?start_thread_noexcept#thread#boost##AAE_NXZ)
1>SMCSCAN.obj : error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category#system#boost##YAABVerror_category#12#XZ)
1>UILoginNew.obj : error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category#system#boost##YAABVerror_category#12#XZ)
1>NetClient.obj : error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category#system#boost##YAABVerror_category#12#XZ)
1>StdH.obj : error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category#system#boost##YAABVerror_category#12#XZ)
1>smcPars.obj : error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category#system#boost##YAABVerror_category#12#XZ)
1>UILoginNew.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall boost::detail::thread_data_base::~thread_data_base(void)" (??1thread_data_base#detail#boost##UAE#XZ)
1>StdH.obj : error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category#system#boost##YAABVerror_category#12#XZ)
1>smcPars.obj : error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category#system#boost##YAABVerror_category#12#XZ)
1>SMCSCAN.obj : error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category#system#boost##YAABVerror_category#12#XZ)
1>\Bin\Engine.dll : fatal error LNK1120: 5 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========```
I fixed that by reinstalling Boost 1.58. 32 bits
Maybe I had x64 libs
I'm trying to build a project with openCV, but I'm getting the following errors:
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
1> Checking Build System
1> CMake does not need to re-run because C:/Users/Kevin/ROBOSLAM/build/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because C:/Users/Kevin/ROBOSLAM/build/examples/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because C:/Users/Kevin/ROBOSLAM/build/examples/opencv/CMakeFiles/generate.stamp is up-to-date.
2>------ Build started: Project: ratslam, Configuration: Debug Win32 ------
3>------ Build started: Project: ratslam_graphics, Configuration: Debug Win32 ------
3> Building Custom Rule C:/Users/Kevin/ROBOSLAM/CMakeLists.txt
3> CMake does not need to re-run because C:\Users\Kevin\ROBOSLAM\build\CMakeFiles\generate.stamp is up-to-date.
3> RatslamGraphics.cpp
2> Building Custom Rule C:/Users/Kevin/ROBOSLAM/CMakeLists.txt
2> CMake does not need to re-run because C:\Users\Kevin\ROBOSLAM\build\CMakeFiles\generate.stamp is up-to-date.
2> Experience_Map.cpp
2> Pose_Cell_Network.cpp
3> Creating library C:/Users/Kevin/ROBOSLAM/build/Debug/ratslam_graphics.lib and object C:/Users/Kevin/ROBOSLAM/build/Debug/ratslam_graphics.exp
3>RatslamGraphics.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::Exception::Exception(int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (??0Exception#cv##QAE#HABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##00H#Z) referenced in function "public: __thiscall cv::Mat::Mat(int,int,int,void *,unsigned int)" (??0Mat#cv##QAE#HHHPAXI#Z)
3>RatslamGraphics.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::Exception::~Exception(void)" (??1Exception#cv##UAE#XZ) referenced in function "public: __thiscall cv::Mat::Mat(int,int,int,void *,unsigned int)" (??0Mat#cv##QAE#HHHPAXI#Z)
3>RatslamGraphics.obj : error LNK2019: unresolved external symbol "void __cdecl cv::error(class cv::Exception const &)" (?error#cv##YAXABVException#1##Z) referenced in function "public: __thiscall cv::Mat::Mat(int,int,int,void *,unsigned int)" (??0Mat#cv##QAE#HHHPAXI#Z)
3>RatslamGraphics.obj : error LNK2019: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree#cv##YAXPAX#Z) referenced in function "public: __thiscall cv::Mat::~Mat(void)" (??1Mat#cv##QAE#XZ)
3>RatslamGraphics.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::deallocate(void)" (?deallocate#Mat#cv##QAEXXZ) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release#Mat#cv##QAEXXZ)
3>RatslamGraphics.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::VideoWriter::VideoWriter(void)" (??0VideoWriter#cv##QAE#XZ) referenced in function "public: __thiscall ratslam::RatslamGraphics::RatslamGraphics(class boost::property_tree::basic_ptree<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > &,class irr::IEventReceiver *,class ratslam::Ratslam *)" (??0RatslamGraphics#ratslam##QAE#AAV?$basic_ptree#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##V12#U?$less#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2##property_tree#boost##PAVIEventReceiver#irr##PAVRatslam#1##Z)
3>C:\Users\Kevin\ROBOSLAM\build\Debug\ratslam_graphics.dll : fatal error LNK1120: 6 unresolved externals
2>..\src\ratslam\Pose_Cell_Network.cpp(716): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdio.h(218) : see declaration of 'fopen'
2> Visual_Template_Match.cpp
2>..\src\ratslam\Visual_Template_Match.cpp(127): warning C4018: '<' : signed/unsigned mismatch
2> Ratslam.cpp
2> Generating Code...
2>c:\users\kevin\roboslam\src\ratslam\experience_map.cpp(277): warning C4715: 'ratslam::Experience_Map::dijkstra_distance_between_experiences' : not all control paths return a value
2> Creating library C:/Users/Kevin/ROBOSLAM/build/Debug/ratslam.lib and object C:/Users/Kevin/ROBOSLAM/build/Debug/ratslam.exp
2> ratslam.vcxproj -> C:\Users\Kevin\ROBOSLAM\build\Debug\ratslam.dll
4>------ Build started: Project: ratslam_opencv_example, Configuration: Debug Win32 ------
4> Building Custom Rule C:/Users/Kevin/ROBOSLAM/examples/opencv/CMakeLists.txt
4> CMake does not need to re-run because C:\Users\Kevin\ROBOSLAM\build\examples\opencv\CMakeFiles\generate.stamp is up-to-date.
4> main.cpp
4>C:\Users\Kevin\ROBOSLAM\libraries\OpenCV2.3\build\include\opencv2/flann/logger.h(70): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
4> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdio.h(218) : see declaration of 'fopen'
4>..\..\..\examples\opencv\main.cpp(97): warning C4101: 'time_s' : unreferenced local variable
4>..\..\..\examples\opencv\main.cpp(97): warning C4101: 'last_time_s' : unreferenced local variable
4> Creating library C:/Users/Kevin/ROBOSLAM/build/examples/opencv/Debug/ratslam_opencv_example.lib and object C:/Users/Kevin/ROBOSLAM/build/examples/opencv/Debug/ratslam_opencv_example.exp
4>main.obj : error LNK2019: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree#cv##YAXPAX#Z) referenced in function "public: __thiscall cv::Mat::~Mat(void)" (??1Mat#cv##QAE#XZ)
4>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::deallocate(void)" (?deallocate#Mat#cv##QAEXXZ) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release#Mat#cv##QAEXXZ)
4>main.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::VideoCapture::VideoCapture(void)" (??0VideoCapture#cv##QAE#XZ) referenced in function _main
4>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::VideoCapture::~VideoCapture(void)" (??1VideoCapture#cv##UAE#XZ) referenced in function _main
4>main.obj : error LNK2019: unresolved external symbol "public: virtual bool __thiscall cv::VideoCapture::open(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?open#VideoCapture#cv##UAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z) referenced in function _main
4>main.obj : error LNK2019: unresolved external symbol "public: virtual bool __thiscall cv::VideoCapture::isOpened(void)const " (?isOpened#VideoCapture#cv##UBE_NXZ) referenced in function _main
4>main.obj : error LNK2019: unresolved external symbol "public: virtual bool __thiscall cv::VideoCapture::grab(void)" (?grab#VideoCapture#cv##UAE_NXZ) referenced in function _main
4>main.obj : error LNK2019: unresolved external symbol "public: virtual bool __thiscall cv::VideoCapture::retrieve(class cv::Mat &,int)" (?retrieve#VideoCapture#cv##UAE_NAAVMat#2#H#Z) referenced in function _main
4>C:\Users\Kevin\ROBOSLAM\build\examples\opencv\Debug\ratslam_opencv_example.exe : fatal error LNK1120: 8 unresolved externals
5>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32 ------
5>Project not selected to build for this solution configuration
========== Build: 2 succeeded, 2 failed, 0 up-to-date, 1 skipped ==========
I'm using a cMake file to create the project, and it's contents are as so:
cmake_minimum_required(VERSION 2.8)
project(ratslam)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
file(GLOB RATSLAM_INCLUDES src/ratslam/*.h src/ratslam/*.hpp)
file(GLOB RATSLAM_GRAPHICS_INCLUDES src/graphics/*.h src/graphics/*.hpp)
file(GLOB GRI_INCLUDES src/gri/*.h src/gri/*.hpp)
file(COPY ${RATSLAM_INCLUDES};${RATSLAM_GRAPHICS_INCLUDES};${GRI_INCLUDES} DESTINATION include)
include_directories("/libraries/OpenCV2.3/build")
include_directories("C:/Users/Kevin/ROBOSLAM/irrlicht-1.8/include")
link_directories("C:/Users/Kevin/ROBOSLAM/irrlicht-1.8/include")
include_directories("/libraries/boost_1_53_0")
include_directories("C:/Users/Kevin/ROBOSLAM/libraries/OpenCV2.3/build/include")
link_directories("/libraries/boost_1_53_0")
include_directories("C:/Users/Kevin/ROBOSLAM/libraries/boost_1_53_0")
link_directories("C:/Users/Kevin/ROBOSLAM/libraries/boost_1_53_0/")
link_directories("C:/Users/Kevin/ROBOSLAM/libraries/boost_1_53_0/stage/lib")
include_directories("${CMAKE_BINARY_DIR}/include")
add_definitions(-DRATSLAM_EXPORTS -DRATSLAM_GRAPHICS_EXPORTS)
add_library(ratslam SHARED src/ratslam/Experience_Map.cpp src/ratslam/Pose_Cell_Network.cpp src/ratslam/Visual_Template_Match.cpp src/ratslam/Ratslam.cpp)
target_link_libraries(ratslam ${Boost_DATE_TIME_LIBRARY})
add_library(ratslam_graphics SHARED src/graphics/RatslamGraphics.cpp)
target_link_libraries(ratslam_graphics Irrlicht ${OpenCV_LIBS})
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/include)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
message(STATUS "headers include ${RATSLAM_INCLUDES};${RATSLAM_GRAPHICS_INCLUDES}")
set(RATSLAM_LIBS ratslam ratslam_graphics)
add_subdirectory(examples)
It seems that all the openCV methods are causing the errors. Any idea why? I believe I imported all the libraries/header files correctly into the project, but still I get these problems. Any help/pointing me in the right direction would be great. Thanks!
From the error shown above I assume you are using the RatSLAM C++ libraries, and I too had the same errors during compilation in VS 2010. I was able to solve it with help from the below link :
OpenCV Build on Visual Studio LINK error
The above link says that certain lib files should be configured, like opencv_core246.lib and opencv_highgui246.lib from the OpenCV library folder. The link also leads you to a tutorial explaining how to configure them :
Setup OpenCV-2.3 for Visual Studio 2010
I hope this helps.
Overflowers!
I've been developing a statically-linked application using Visual Studio 2010 (well, it's cross-platform, but this is just a Windows issue).
I had few issues setting up the linking for the Debug configuration, so I didn't expect it would be hard to change it to make a Release configuration, but after an afternoon's work it's still eluding me. Trying various values for NODEFAULTLIB either get me "unresolved external symbol" errors or "already defined in" errors and sometimes both.
From my notes, I've tried NODEFAULTLIB-ing LIBCMT, MSVCRT, MSVCPRT, or none at all, with different results each time (see below for details).
Now, my Debug configuration uses /NODEFAULTLIB:MSVCRTD /NODEFAULTLIB:MSVCPRTD and that works fine, so you'd think that /NODEFAULTLIB:MSVCRT /NODEFAULTLIB:MSVCPRT would work for the Release configuration. And the fact that it doesn't is a red flag for me...
I'm linking with several other libraries - I was pretty careful to systematically make sure that they were considered exactly the same when going from Debug to Release but could that conceivably be an issue, and if so how to track it down systematically?
Thanks for your gracious time!
In the Linker/Command Line property page, All Options is:
/OUT:".\Release\SlowGold 8.exe" /NOLOGO "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /MANIFEST /ManifestFile:".\Release\SlowGold 8.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /PDB:".\Release\SlowGold 8.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /PGD:"C:\development\rec-vs\rec\projects\slow\Builds\VisualStudio2010\Release\SlowGold 8.pgd" /LTCG /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE
and Additional Options is:
/LIBPATH:..\\..\\..\\..\\externals\\rubberband\\win32\\ipp\\common ippacemerged.lib ippacmerged.lib ippcorel.lib ippsemerged.lib ippsmerged.lib ippsremerged.lib ippsrmerged.lib /LIBPATH:..\\..\\..\\..\\externals\\rubberband\\win32\\ipp\\release\\static rubberband-library.lib /LIBPATH:..\\..\\..\\..\\..\\glog\\Release libglog_static.lib /LIBPATH:..\\..\\..\\..\\..\\mpg123\\ports\\MSVC++\\2008\\Release libmpg123.lib /LIBPATH:..\\..\\..\\..\\..\\protobuf\\vsprojects\\Release libprotobuf.lib
And here are some error messages for various /NODEFAULTLIB: values.
Best so far: /NODEFAULTLIB:LIBCMT
1>------ Build started: Project: Slow, Configuration: Release Win32 ------
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __thiscall std::basic_ostream<char,struct std::char_traits<char> >::basic_ostream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" (??0?$basic_ostream#DU?$char_traits#D#std###std##QAE#PAV?$basic_streambuf#DU?$char_traits#D#std###1#_N#Z) already defined in libcpmt.lib(cerr.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error#std##YAXPBD#Z) already defined in libcpmt.lib(xthrow.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range#std##YAXPBD#Z) already defined in libcpmt.lib(xthrow.obj)
1>.\Release\SlowGold 8.exe : fatal error LNK1169: one or more multiply defined symbols found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Another attempt with only /NODEFAULTLIB:MSVCRT
1>------ Build started: Project: Slow, Configuration: Release Win32 ------
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __thiscall std::basic_ostream<char,struct std::char_traits<char> >::basic_ostream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" (??0?$basic_ostream#DU?$char_traits#D#std###std##QAE#PAV?$basic_streambuf#DU?$char_traits#D#std###1#_N#Z) already defined in libcpmt.lib(cerr.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error#std##YAXPBD#Z) already defined in libcpmt.lib(xthrow.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range#std##YAXPBD#Z) already defined in libcpmt.lib(xthrow.obj)
1>libglog_static.lib(logging.obj) : error LNK2001: unresolved external symbol __imp__strncat
1>libglog_static.lib(logging.obj) : error LNK2001: unresolved external symbol __imp__perror
1>libglog_static.lib(logging.obj) : error LNK2001: unresolved external symbol __imp___pclose
1>libglog_static.lib(logging.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) int __cdecl _open(char const *,int,int)" (__imp_?_open##YAHPBDHH#Z)
1>libglog_static.lib(logging.obj) : error LNK2001: unresolved external symbol __imp___access
1>libglog_static.lib(logging.obj) : error LNK2001: unresolved external symbol __imp___popen
1>libglog_static.lib(logging.obj) : error LNK2001: unresolved external symbol __imp___wassert
1>libglog_static.lib(logging.obj) : error LNK2001: unresolved external symbol __imp__fdopen
1>OLDNAMES.lib(fdopen.obi) : error LNK2001: unresolved external symbol __imp__fdopen
1>libglog_static.lib(logging.obj) : error LNK2001: unresolved external symbol __imp__unlink
1>OLDNAMES.lib(unlink.obi) : error LNK2001: unresolved external symbol __imp__unlink
1>libglog_static.lib(utilities.obj) : error LNK2001: unresolved external symbol __imp___getpid
1>libglog_static.lib(port.obj) : error LNK2001: unresolved external symbol __imp___vsnprintf
1>libprotobuf.lib(message.obj) : error LNK2001: unresolved external symbol __imp__ldiv
1>libprotobuf.lib(descriptor.obj) : error LNK2001: unresolved external symbol __imp__ldiv
1>libprotobuf.lib(extension_set.obj) : error LNK2001: unresolved external symbol __imp__ldiv
1>libprotobuf.lib(common.obj) : error LNK2001: unresolved external symbol __imp___snprintf
1>libprotobuf.lib(strutil.obj) : error LNK2001: unresolved external symbol __imp___snprintf
1>OLDNAMES.lib(fdopen.obi) : error LNK2001: unresolved external symbol __imp___fdopen
1>OLDNAMES.lib(unlink.obi) : error LNK2001: unresolved external symbol __imp___unlink
1>.\Release\SlowGold 8.exe : fatal error LNK1120: 15 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Without /NODEFAULTLIB:
1>------ Build started: Project: Slow, Configuration: Release Win32 ------
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __thiscall std::basic_ostream<char,struct std::char_traits<char> >::basic_ostream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *,bool)" (??0?$basic_ostream#DU?$char_traits#D#std###std##QAE#PAV?$basic_streambuf#DU?$char_traits#D#std###1#_N#Z) already defined in libcpmt.lib(cerr.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error#std##YAXPBD#Z) already defined in libcpmt.lib(xthrow.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range#std##YAXPBD#Z) already defined in libcpmt.lib(xthrow.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __stricmp already defined in LIBCMT.lib(stricmp.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strerror_s already defined in LIBCMT.lib(strerror.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fflush already defined in LIBCMT.lib(fflush.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strtol already defined in LIBCMT.lib(strtol.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strrchr already defined in LIBCMT.lib(strrchr.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __write already defined in LIBCMT.lib(write.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __close already defined in LIBCMT.lib(close.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __thiscall std::exception::exception(char const * const &)" (??0exception#std##QAE#ABQBD#Z) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: virtual __thiscall std::exception::~exception(void)" (??1exception#std##UAE#XZ) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _memmove already defined in LIBCMT.lib(memmove.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: "public: __thiscall std::exception::exception(class std::exception const &)" (??0exception#std##QAE#ABV01##Z) already defined in LIBCMT.lib(stdexcpt.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _printf already defined in LIBCMT.lib(printf.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _fprintf already defined in LIBCMT.lib(fprintf.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: ___iob_func already defined in LIBCMT.lib(_file.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _abort already defined in LIBCMT.lib(abort.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _memchr already defined in LIBCMT.lib(memchr.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __strtoi64 already defined in LIBCMT.lib(strtoq.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __strtoui64 already defined in LIBCMT.lib(strtoq.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strtoul already defined in LIBCMT.lib(strtol.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __errno already defined in LIBCMT.lib(dosmap.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strerror already defined in LIBCMT.lib(strerror.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strchr already defined in LIBCMT.lib(strchr.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _sprintf already defined in LIBCMT.lib(sprintf.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strtod already defined in LIBCMT.lib(strtod.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _strpbrk already defined in LIBCMT.lib(strpbrk.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info##AAE#ABV0##Z) already defined in LIBCMT.lib(typinfo.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info##AAEAAV0#ABV0##Z) already defined in LIBCMT.lib(typinfo.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: __read already defined in LIBCMT.lib(read.obj)
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>.\Release\SlowGold 8.exe : fatal error LNK1169: one or more multiply defined symbols found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Hans Passant provided me the key to the solution in his comments to my problem! If he'd come back and phrase them as an answer, I'd erase this and credit him...
As predicted, one of the third-party libraries was not set to /MT in release (but it was /MTd in debug) - changing that flag made it all work.
You find the option in Properties - C/C++ - Code Generation - Runtime Library
I hav a project.it shows error only with linking only.
it displays __getch alresdy defined evnthough i hav ignored specific library MSVCR80D.dll it shows error.
Plz Help me in this regard.....
after using /verbose:
Processed /DEFAULTLIB:msvcprtd
Processed /DEFAULTLIB:MSVCRTD
Processed /DEFAULTLIB:OLDNAMES
Processed /DEFAULTLIB:MSVCMRTD
Processed /DEFAULTLIB:MSCOREE
Processed /DEFAULTLIB:uuid.lib
Processed /DEFAULTLIB:atlsd.lib
Processed /DEFAULTLIB:kernel32.lib
Processed /DEFAULTLIB:user32.lib
Processed /DEFAULTLIB:advapi32.lib
Processed /DEFAULTLIB:ole32.lib
Processed /DEFAULTLIB:shell32.lib
Processed /DEFAULTLIB:oleaut32.lib
Processed /DEFAULTLIB:shlwapi.lib
Processed /DEFAULTLIB:ws2_32.lib
Referenced in config.lib(configwrapper.obj)
Loaded msvcprtd.lib(MSVCP80D.dll)
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: char __thiscall std::basic_ios<char,struct std::char_traits<char> >::fill(void)const " (?fill#?$basic_ios#DU?$char_traits#D#std###std##QBEDXZ) already defined in ACEsd.lib(Log_Record.obj)
Found "__declspec(dllimport) public: int __thiscall std::ios_base::flags(void)const " (__imp_?flags#ios_base#std##QBEHXZ)
Referenced in config.lib(serializetransport_settings.obj)
Referenced in config.lib(serializeretentionsettings.obj)
Referenced in s2libs.lib(operatingsystem.obj)
Referenced in s2libs.lib(errormajor.obj)
Loaded msvcprtd.lib(MSVCP80D.dll)
msvcprtd.lib(MSVCP80D.dll) : error LNK2005: "public: int __thiscall std::ios_base::flags(void)const " (?flags#ios_base#std##QBEHXZ) already defined in ACEsd.lib(Log_Record.obj)
Found "__declspec(dllimport) public: int __thiscall std::ios_base::width(void)const " (__imp_?width#ios_base#std##QBEHXZ)
Referenced in config.lib(serializetransport_settings.obj)
Referenced in config.lib(serializeretentionsettings.obj)
Referenced in s2libs.lib(operatingsystem.obj)
Referenced in s2libs.lib(errormajor.obj)
Referenced in config.lib(serializereplicationpairsettings.obj)
Referenced in config.lib(serializecdpsnapshotrequest.obj)
Referenced in config.lib(serializeatconfigmanagersettings.obj)
Referenced in config.lib(serializeretentioninformation.obj)
Referenced in config.lib(marshal.obj)
Referenced in config.lib(serializevolumegroupsettings.obj)
Referenced in config.lib(unmarshal.obj)
have a look at the project settings , at Configuration Properties -> C/C++ -> Code Generation -> Runtime Library.
the setting , whether it MD , MTD or whatever, must be compatible between your library and ACE's library.
you should not manually ignore any library, there should be no need for that.
I have a solution with multiple projects. I have a "main" project, which acts as a menu and from there, the user can access any of the other projects. On this main project, I get linker errors for every function called. How do I avoid these linker errors? I set the project dependencies already in the "Project Dependencies..." dialog.
Thanks
EDIT -- I did as suggested and added the output folder to the linker's additional directories. Now, however, I get a million errors as follows:
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: void __thiscall std::basic_ios >::setstate(int,bool)" (?setstate#?$basic_ios#DU?$char_traits#D#std###std##QAEXH_N#Z) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: int __thiscall std::ios_base::width(int)" (?width#ios_base#std##QAEHH#Z) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf >::sputn(char const *,int)" (?sputn#?$basic_streambuf#DU?$char_traits#D#std###std##QAEHPBDH#Z) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: static bool __cdecl std::char_traits::eq_int_type(int const &,int const &)" (?eq_int_type#?$char_traits#D#std##SA_NABH0#Z) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: static int __cdecl std::char_traits::eof(void)" (?eof#?$char_traits#D#std##SAHXZ) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf >::sputc(char)" (?sputc#?$basic_streambuf#DU?$char_traits#D#std###std##QAEHD#Z) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: class std::basic_streambuf > * __thiscall std::basic_ios >::rdbuf(void)const " (?rdbuf#?$basic_ios#DU?$char_traits#D#std###std##QBEPAV?$basic_streambuf#DU?$char_traits#D#std###2#XZ) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: char __thiscall std::basic_ios >::fill(void)const " (?fill#?$basic_ios#DU?$char_traits#D#std###std##QBEDXZ) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: int __thiscall std::ios_base::flags(void)const " (?flags#ios_base#std##QBEHXZ) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: int __thiscall std::ios_base::width(void)const " (?width#ios_base#std##QBEHXZ) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: static unsigned int __cdecl std::char_traits::length(char const *)" (?length#?$char_traits#D#std##SAIPBD#Z) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: class std::basic_ostream > & __thiscall std::basic_ostream >::flush(void)" (?flush#?$basic_ostream#DU?$char_traits#D#std###std##QAEAAV12#XZ) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: class std::basic_ostream > * __thiscall std::basic_ios >::tie(void)const " (?tie#?$basic_ios#DU?$char_traits#D#std###std##QBEPAV?$basic_ostream#DU?$char_traits#D#std###2#XZ) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: bool __thiscall std::ios_base::good(void)const " (?good#ios_base#std##QBE_NXZ) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: void __thiscall std::basic_ostream >::_Osfx(void)" (?_Osfx#?$basic_ostream#DU?$char_traits#D#std###std##QAEXXZ) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: void __thiscall std::basic_streambuf >::_Lock(void)" (?_Lock#?$basic_streambuf#DU?$char_traits#D#std###std##QAEXXZ) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: void __thiscall std::basic_streambuf >::_Unlock(void)" (?_Unlock#?$basic_streambuf#DU?$char_traits#D#std###std##QAEXXZ) already defined in panels.lib(panel_main.obj)
3>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: class std::locale::facet * __thiscall std::locale::facet::_Decref(void)" (?_Decref#facet#locale#std##QAEPAV123#XZ) already defined in panels.lib(panel_main.obj)
3>libcpmtd.lib(ios.obj) : error LNK2005: "private: static void __cdecl std::ios_base::_Ios_base_dtor(class std::ios_base *)" (?_Ios_base_dtor#ios_base#std##CAXPAV12##Z) already defined in msvcprtd.lib(MSVCP90D.dll)
3>libcpmtd.lib(ios.obj) : error LNK2005: "public: static void __cdecl std::ios_base::_Addstd(class std::ios_base *)" (?_Addstd#ios_base#std##SAXPAV12##Z) already defined in msvcprtd.lib(MSVCP90D.dll)
3>libcpmtd.lib(locale0.obj) : error LNK2005: "void __cdecl _AtModuleExit(void (__cdecl*)(void))" (?_AtModuleExit##YAXP6AXXZ#Z) already defined in msvcprtd.lib(locale0_implib.obj)
3>libcpmtd.lib(locale0.obj) : error LNK2005: __Fac_tidy already defined in msvcprtd.lib(locale0_implib.obj)
3>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static void __cdecl std::locale::facet::facet_Register(class std::locale::facet *)" (?facet_Register#facet#locale#std##CAXPAV123##Z) already defined in msvcprtd.lib(locale0_implib.obj)
3>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (?_Getgloballocale#locale#std##CAPAV_Locimp#12#XZ) already defined in msvcprtd.lib(MSVCP90D.dll)
3>libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(void)" (?_Init#locale#std##CAPAV_Locimp#12#XZ) already defined in msvcprtd.lib(MSVCP90D.dll)
3>libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,class std::basic_string,class std::allocator > const &)" (?_Locinfo_ctor#_Locinfo#std##SAXPAV12#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##2##Z) already defined in msvcprtd.lib(MSVCP90D.dll)
3>libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)" (?_Locinfo_dtor#_Locinfo#std##SAXPAV12##Z) already defined in msvcprtd.lib(MSVCP90D.dll)
3>libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit#std##QAE#H#Z) already defined in msvcprtd.lib(MSVCP90D.dll)
3>libcpmtd.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit#std##QAE#XZ) already defined in msvcprtd.lib(MSVCP90D.dll)
It is difficult to answer without knowing all the details about your solution, but I will assume your "other" project are set up to produce a .lib file, and the main project then links all these lib files. If that is the case then a possible cause for the errors you are getting is that your projects link to different versions of the runtime library.
From Microsoft's documentation, "All modules passed to a given invocation of the linker must have been compiled with the same run-time library compiler option (/MD, /MT, /LD)."
Try to change all the projects to use the same version of the runtime library. In Visual Studio 2010, this is in the Project's Properties | Configuration Properties | C/C++ | Code Generation | Runtime Library. Choose either Multi-threaded Debug DLL or Multi-threaded Debug (for your debug configuration).
Without knowing any other detail about your solution it is hard to tell, however Rebuild All, might be helpful. This situation can sometimes occur when there are mixed object files for different architectures.
You might also want to consider using "References" instead of "Dependencies"
EDIT:
After what you have posted it seems that your linkage to standard libraries is inconsistent. Could it be that one of the project links standard libraries statically while others dynamically? (See project properties->linker) Or one to the release runtime, while others to debug? (though the last one should be possible, with caveats)
Are the functions in your other projects exported? If they aren't exported, then there is nothing to link to from the main exe, so that would cause the errors. See Exporting from a DLL Using __declspec(export) for more information.
The errors you are getting are 'error LNK2005' where a symbol in the library you are linking (msvcprtd.lib) has already been defined in another library (for example panels.lib). If you add panels.lib to the 'ignore specific library' field (in VS2008 Configuration Properties--> Linker--> Input -->Ignore specific libraries), the errors will stop.
I presume the linker errors you are getting are for "unresolved symbols"?
If using static libraries (i.e. .lib file), you will need to add the library to the linker input, so that at linkage time the symbols can be linked against. If you don't do this, you'll get an unresolved symbol:
Right-click on the project, and select Properties.
Select Configuration Properties->Linker->Input
Enter the library name (e.g. filename.lib) under Additional Dependencies.
I had a very similar issue to this which turned out to be because one of my libraries had the option 'Treat wchar_t as built-in type' set to a different value to the others. This setting is false by default on new projects. Changing them all to true fixed the problem.
Exactly, at least one of your projects is compiled with a different "Runtime Library" then the others. Maybe you added a new one using the default which is different. Check properties of your project(s) for equal value of "Configuration Properties" -> "C/C++" -> "Code Generation" -> "Runtime Library".
In my case, the problem was because I had kept the function prototypes, the class definitions and the function implementation and the class implementation in a single cpp file. Only when I shifted the declarations and prototypes to a separate header file did these errors disappear. Really weird!
In my case, I have two methods:
Project Properties -> C/C++ -> Code Generation -> Runtime Library. change it to MT.
Add your lack library to: Linker-> Input -> Additional Dependencies. If it doesn't work, try to add a full path instead of a library name.
For example: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64\libvcruntime.lib;
That works for me.Answer this question for anyone needs help.