Constant LNK1104 errors in VS 2017 project - c++

I have this huge ond very old C++ project I am building with Visual Studio 2017 using the VS 2013 compiler and Incredibuild.
When I am building the project I very often get LNK1104 linker errors, that the output file can't be opened. If I build again after getting the error, linking this project works fine but I get the same error with one of the next projects in the solution.
Sometimes this error doesn't occur and the whole solutions builds fine and other times I get this error a dozen times until I have all the projects build.
It looks like VS is blocking itself but I have no clue where to look at and didn't find many helpful clues so far. But this is driving me crazy.

I've had similar issues with Incredibuild and it was always one of two reasons:
My project build order was wrong, so I was ending up trying to link to a lib/dll that was not builded yet
A running program somewhere else on my computer was already using one of the dll/exe I was trying to build
Try to review your build order by setting up each project's dependencies in Solution >> Project Dependencies >> Dependencies

Related

Cannot open source file in a CMake Project in Visual Studio

I have a C++ Project in Visual Studio 2022 (Windows 11) that is put together using CMake. I understand that the difference here is, that my project is not a Solution but rather just folders with code and the CMake tells it how to compile it?
But my problem is, that it doesn't seem to find C's standard libraries and shows error "cannot open sourcefile".
Screenshot
The error is definitely not in the project, since it runs just fine on my laptop, just not on the PC I want it to run on.
How can I tell it where these libraries are? Where are they located even?
Any help would be greatly appreciated and I can share more files on request.
Things I have tried:
Going to properties and choose the correct Windows SDK Version - The properties are empty
Comparing every variable of the CMake Settings with the ones on my laptop where it works
completely reinstalling Visual Studio (yes I did that)
looking through lots of StackOverflow questions but none of them describe my problem

Visual Studio 2019, trying to debug, MSVCP140_APP.dll not found

I have created a Visual Studio 2019 solution under Windows 10, which contains 2 C++ projects. The first builds a dll, the second - an executable which, amongst others, uses the dll created by the first project.
I fail to start the executable with the error
"The code execution cannot proceed because MSVCP140_APP.dll was not found. Reinstalling the program may fix this problem."
Both trying to debug using Visual Studio and trying to start an exe from the file browser fail.
Both Debug and Release modes fail.
Obviously I've tried to search for the solution and obviously I did not find it. Quite often UWP pops up but I have no idea why should I even know what it is if I have created the solution with the complete code from scratch...
Note: both projects use some external packages and everything worked fine under one project, before I did the split (in a different solution). After the split, the dll links to embree, and the exe to glfw and glew.

Issue in compiling an FLTK program

I'm having some really hard times in getting to run a first simple project with FLTK. At the moment I have followed the steps on this page
But when I try to compile my code I still get the error :
LNK 1104 impossible to open the file 'fltkjpegd.lib'.
Any idea on how to solve this issue ?
Add fltk libraries dependencies to your Visual Studio project as is described here

MSBuild Different Results - One Errors, Other Succeeds

I have several Visual C++ projects (.vcxproj) that we have in a Visual Studio 2013 Solution. From a clean code pull, everything builds successfully in either Visual Studio 2013 or a build script that calls MSBuild on each project in the proper order (a relic from the days of old, which we are working, slowly but surely, to replace).
We have a few issues with this. First, if we build from the build script first, and then try to debug, it says that most of the projects are out of date. This is annoying, but I think this is due to the batch file not touching something in the intermediate directory the same that Visual Studio does. I find similar problems documented at Stack Overflow and Microsoft Connect. Is there an alternative to modifying the Microsoft.CppBuild.targets file? I'd like to have a fix for this that doesn't involve manually modifying all of the developer's machines.
The primary problem is: If we build a project from within Visual Studio 2013, it will build and link successfully. However, if we then go and build the same project from the build script, we get:
OtherProject.lib(SomeObject.obj) : error LNK2011: precompiled object not linked in; image may not run [Full path to .vcxproj]
OutputFile.dll : fatal error LNK1120: 1 unresolved externals [full path to .vcxproj]
Does anyone have tips on how to figure out which precompiled object this is as well as why the Visual Studio based build could manage to figure things out? Do I need to review every library dependency, and each of their dependencies? Is there an easier/automated way to do this? One thing to note is that Visual Studio 2013 does not always get it right and fails with the same warning.
Our batch file build command is:
msbuild /nologo /maxcpucount /clp:NoSummary /p:BuildProjectReferences=false /p:Configuration=Debug /verbosity:normal ProjectDir\Project.vcxproj

The file MSVCP100D.dll is missing from the computer

What I'm having is that this error is displayed when I wanted to copy a exe debug project that I have created (which works witout any problems) to another machine (the error message is displayed).
According to the question posted previously, the best solution to get rid of the error message is to make a release and not a debug in the Configuration Manager.
Doing that, and when rebuilding the project with the RELEASE one, I'm having new errors in my project which were not included when doing the DEBUG.
For instance, one of them is :
Error 2 error C1083: Cannot open include file: 'opencv\highgui.h': No such file or directory c:\...\projects\...\ex\opencv.h 4
23 IntelliSense: identifier "IplImage" is undefined c:\...\ex.cpp 80
Any feedbacks?
You've probably added include paths for OpenCV to your project file. Unfortunately, Visual Studio by default makes such changes ONLY to the active configuration, which in your case was debug.
This rarely makes sense. Adding a logging library would be such a rare case, but you probably needs OpenCV in both debug and release builds.
MSVCP100.dll is part of the Microsoft Visual Studio 10 runtime. MSVCP100d.dll is the debug build of the same dll - useful for running your program in debug mode.
http://www.microsoft.com/en-us/download/details.aspx?id=5555
Basically it is a relatively new package and is not guaranteed to be on all systems, especially Windows XP, so you can distribute the required DLL files or the entire runtime with your program. EDIT: Keep in mind that debug builds are not meant to be distributed, so your program should not contain debug dll-s either such as MSVCP100d.dll.
Try downloading it, and then see what happens.
Also check out this question.
MSVCP100D.dll and MSVCP100.dll is part of the Microsoft Visual Studio 10 runtime, so if someone compile her/his programs with this package, then uninstall the package and install another one for example Microsoft Visual Studio 12 (2013).
When trying to run her/his programs , then her/his will get the message that 'so and so... try to reinstalling the program to fix this problem'. this means you have to reinstall Microsoft Visual Studio 10.
the other way is to recompile your programs under the new package!