Boost::Archive causing weird linker error - c++

Does anyone have a clue why those two lines would cause that linker error?
std::ifstream ifs("filename.file");
boost::archive::binary_iarchive iarchv( ifs );
Error 8 fatal error LNK1104: cannot open file 'F:\dev\project\build\win32-unit\tests\Debug\framework_core_tests.lib' ramework_core_tests framework_core_tests
The same happens with any Boost::Archive type.
Its trying to link against a library of the same name as my executable for some reason when that project doesn't nor never existed and is not defined as a library to link against in my project files.

maybe you should add a reference to a lib that contains that functions?

You have compiled this library with core tests.

Related

GLES-Render.cpp cocos2d-X causing compile time errors

I have copied the GLES-Render.h and GLES-Render.cpp files into my project and added them to the Android.ml file. Now the file is full of errors like
Symbol 'GL_FLOAT' could not be resolved
Symbol 'GL_FALSE' could not be resolved
When i click on any of these symbols eclipse opens up glew.h file or the some error open up on CCGLProgram.h. What am i doing wrong ? Is there OpenGL includes that i have to include ?
Kind Regards
You cna check this GLES-Render.h/.cpp in this link. and also add GLES-Render in your android.mk file. GLES-RENDER

fatal error LNK1104: cannot open file 'opencv_calib3d220d.obj'

I am very new to C++ programming and I am compiling a code in visual studio 2010 with opencv 2.2 library on a Windows 7-64 bit OS using a precompiled header. I listed all the library files available in C:\OpenCV2.2\lib in the Project properties>configuration properties>linker>input, but when I run the program it continues to show this error:
fatal error LNK1104: cannot open file 'opencv_calib3d220d.obj',
although I defined 'C:\OpenCV2.2\lib\opencv_calib3d220d' as an input.
I do not know how to resolve the problem.
Any help would be highly appreciated.
Did you actually define "C:\OpenCV2.2\lib\opencv_calib3d220d" as the input, or "C:\OpenCV2.2\lib\opencv_calib3d220d .lib"? (No space, can't bold/italics it without the space is why it's there.)
It needs to have that .lib there or it won't work. Even if it's complaining about a .obj
Also: Under Linker-> General -> Additional Library Directories you can put "C:\OpenCV2.2\lib\" and then you won't have to type out the directory each time you add something from that directory to Linker -> Input -> Additional Dependancies : You could just put "opencv_calib3d220d.lib", for example.
obj ? no. lib, yes
so, please make sure, you got 'C:\OpenCV2.2\lib\opencv_calib3d220d.lib' etc in your linker input.
also make sure you do the same WITHOUT the 'd' at the end for release
btw, might be a good idea to update to 2.4.6, heap of bug fixes, proper gpu support , facerecognition, do you really want to live without ?

Linker error with boost serialization: missing lib file

I have VC 10 and using boost 1.53.0.
I am trying to compile and link a sample program from boost serialization samples, but the linker generates the following error:
LINK : fatal error LNK1104: cannot open file 'libboost_serialization-vc100-mt-gd-1_53.lib".
I tried many things, like checking my include and lib paths, all was correct. In fact this file name which the linker was asking is not there even in the whole c drive where both MS VC 10 and boost are installed.
Thank you.

linking error: ambiguous libboost*.lib vs boost*.lib

I'm using boost in my project. I've downloaded pre-compiled binaries from here http://boost.teeks99.com/
When linking I receive such error:
Error 18 error LNK2005: "public: void __cdecl boost::thread::join(void)" (?join#thread#boost##QEAAXXZ) already defined in boost_thread-vc110-mt-1_52.lib(boost_thread-vc110-mt-1_52.dll) C:\Oleg\projects\MBClient\FastNativeAdapter\libboost_thread-vc110-mt-1_52.lib(thread.obj) FastNativeAdapter
Why boost contains two lib with so similar name, what is the difference between them?
libboost_thread-vc110-mt-1_52.lib
boost_thread-vc110-mt-1_52.lib
How to fix linking error?
upd I've compiled boost myself. I've added boost_1_53_0\stage\lib directory to linker. This directory actually contains 3 "copies" of "each" file, for example:
boost_atomic-vc110-mt-1_53.dll
boost_atomic-vc110-mt-1_53.lib
libboost_atomic-vc110-mt-1_53.lib
So It's clear what compiler claims about. Somehow it can't understand which version of lib file to use. It's likely connected with static/dinamic linking, but I still can not find the solution. I'm sure my problems is pretty common so I hope someone can suggest me what to do.
I've tried to delete all "libboost*" files from folder but then I receive such error:
Error 15 error LNK1104: cannot open file 'libboost_date_time-vc110-mt-1_53.lib'
I've tried to delete all "boost*lib" files from folder but then I receive such error:
Error 15 error LNK1104: cannot open file 'boost_thread-vc110-mt-1_53.lib'
Then I copied boost_thread-vc110-mt-1_53.lib back and I receive a lot of errors like that:
Error 16 error LNK2005: "public: virtual __cdecl boost::detail::thread_data_base::~thread_data_base(void)" (??1thread_data_base#detail#boost##UEAA#XZ) already defined in boost_thread-vc110-mt-1_53.lib(boost_thread-vc110-mt-1_53.dll)
So when there are no boost_thread-vc110-mt-1_53.lib compiler claims that it's missing, when there is boost_thread-vc110-mt-1_53.lib compiler claims that "function is already defined". Probaly somehow I do use dinamic and static linking at the same time or something like that?
upd2 i've uncommented #define BOOST_ALL_DYN_LINK as suggested here and now code compiles! i'm investigating if everything else is fine. however i didn't understand why I should uncomment #define BOOST_ALL_DYN_LINK so comments are welcome.
Edit: Initial statement removed since an edit to the post changed the situation.
Based on http://www.boost.org/doc/libs/1_53_0/more/getting_started/unix-variants.html#library-naming (as provided by Igor R.):
libboost_thread-vc110-mt-1_52.lib is a static lib (no need for the DLL)
boost_thread-vc110-mt-1_52.lib is the import lib for the DLL
You only need to use one of these.
Another idea/solution to try if you hit the error LNK1104: cannot open file 'libboost_date_time-*.lib' error:
In our project, we include the boost/date_time.hpp file. We define the constant BOOST_ALL_NO_LIB instead of BOOST_ALL_DYN_LINK in our project settings to tell boost not to automatically select which libraries to link against.
See the Boost documentation for more information about this option.
So you could add BOOST_ALL_NO_LIB in Project Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions and check whether this linker error goes away.
I think first of all you need to correct your question. Do you mean (I guess you already know the difference between DLL and LIB )
libboost_thread-vc110-mt-1_52.lib
boost_thread-vc110-mt-1_52.dll
or
libboost_thread-vc110-mt-1_52.lib
boost_thread-vc110-mt-1_52.lib
Anyway, it seems the issue is you're mixing static(libboost_thread-vc110-mt-1_52.lib) and shared (boost_thread-vc110-mt-1_52.lib) boost libraries. But without the working environment and platform details I cannot purpose an exact solution. If you work in Visual Studio ,then you can go to right click on project file > properties > linker > input > ignore specific library and add libboost_thread-vc110-mt-1_52.lib there and try.
asking myquestion myself.
need to uncomment #define BOOST_ALL_DYN_LINK (refer to description)

LNK1004: Cannot open file 'Jsfwbase12D.lib'

So, I'm a bit confused on this error that I'm getting while compiling/linking a C++ project.
In the Input section of the Linker configuration, we have a additional dependency with the file name Jsfwbase12D.lib. This file was recently changed to Jsfwbase12.lib without the capital D. I changed the references within the project to the new file name and then attempted to re-compile and got the below error message.
Error 2 fatal error LNK1104: cannot open file 'Jsfwbase12D.lib' m5gaddrs m5gaddrs
I opened up the vcproj file in notepad and searched for the old file name and it found zero results.
Does anyone have any idea why the linker isn't looking for the correct file and instead trying to find the old one?
Edit:
I opened the obj file in notepad and found the old Jsfwbase12D.lib reference. So it appears that's why the linker is failing. Now the real question is, why is the compiler inserting those references for debug mode if they are not specified anywhere?
/DEFAULTLIB:"Jsfwbase12D.lib"
Your code likely contains #pragma comment(lib, "Jsfwbase12D.lib") somewhere. This informs the linker of a dependency which gets included during link time.