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.
Related
I have obtained source code from another developer that I am attempting to build in VS2013. The solution consists of 11 projects: 1 application and 10 static libraries. Included in the file package was a VS project file for 'LibraryX', an 11th static library which is not included in the solution. However, attempting to build the solution gives the error 'cannot open input file libraryx.lib'
After contacting the developer he informed me that this LibraryX is not ready for release and is therefore not included in the source code (the folder containing the necessary cpp and header files is missing). I should therefore be able to build the solution without it. His suggestions were:
After you open the VS solution, remove the LibraryX library from the solution.
Check (It already wasn't included)
You also need to remove the libraryx.lib from the linker->input list (on the Properties page of the application project).
Check (Again, it was correctly not in the linker input)
You may also need to remove the line
LibraryX::InitModule();
from LibraryABC\libraryabc.cpp as well as remove the include line for LibraryX.h from this file.
I have opened this file and can see the headers and the code block of InitModule() for the other libraries, but LibraryX is not listed. I have searched the entire source code for references to LibraryX and there are none.
How do I find where/why VS is trying to open this file?
I'm new C++, I have a dll file called DiceInvaders.dll, in my project, I need to use this library, I'm using visual c++ 2010, I set the Linker Input as DiceInvaders.lib and DiceInvaders.dll, I also copied this dll file to my porject directory, I always got error in this line of code:
m_lib = LoadLibrary("DiceInvaders.dll");
assert(m_lib);
The error is assertion failure. How should I solve this? Thank you in advance.
First you cannot pass the DLL to the linker like you are, it is not a file type that the linker recognizes and cannot be linked that way. When you create the Diceinvaters.dll file the linker will create an import library with the same filename and the extension .lib. It appears this is already being done. That is the library file you should pass to the linker when building any application that uses it.
Second, the Diceinvaders.dll file must be accessible in the DLL search path. This varies slightly depending on which version of Windows you are using but is generally something like the following
The directory the program was loaded from.
The current working directory.
The System directory.
The Windows directory.
The directories that are listed in the PATH environment variable.
Placing the DLL in your project directory is not going to be enough. Instead you should place it in the same directory as the EXE file(s) that have a dependency on it.
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
I have a VS 2010 C++ project.
When I try to compile it, it tells me
Error 1 error LNK1104: File "C:\Users\MyUser\Desktop\project1\Debug\mysynth.lib" could not be opened. C:\Users\MyUser\Desktop\project1\subproject\LINK subproject
I have removed all dependencies from Linker->Input->, but it is still looking for the above lib.
Where else could this link be stated?
You can specify additional linker options in the configuration dialog. Look under the Linker | Command Line page. Perhaps the errant lib is specified there. In any case you can see there the command line that is passed to the linker and determine whether or not your lib file is there.
The easiest way to work out where they are coming from is to open up the project file in a text editor and search for the errant lib file. If the problem is in the project configuration, this tactic is guaranteed to succeed.
If you have removed everything from your project settings, and you are not passing the errant lib to the linker command line, then the other place where a lib file may be specified is in code. In a #pragma statement. It would look like this:
#pragma comment(lib, "mysynth")
Look in the properties explorer. Read the MSBuild documentation for the order that they are read. This is the most confusing part of going from VS2008 forward.
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.