LNK1104: cannot open file 'Debug\*.obj' - visual-studio

I'm creating a simple assembly program in visual studio with MASM. It seemed to be compiling fine and such, until I modified the source and attempted to re-build the project. This time, I get the following
All packages are already installed and there is nothing to restore.
NuGet package restore finished.
1>------ Build started: Project: Add, Configuration: Debug Win32 ------
1> Assembling Add.asm...
1>LINK : fatal error LNK1104: cannot open file 'Debug\Add.obj'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Object File Name in Microsoft Macro Assembler is left as default, $(IntDir)%(FileName).obj. The full command line is as follows ml.exe /c /nologo /EP /Zi /Fo"Debug\%(FileName).obj" /Fl"Add.lst" /W3 /errorReport:prompt /Ta. This worked for the original build, but it complains there's no object file even though /Fo clearly specifies it.

Related

fatal error LNK1104: cannot open file 'libboost_regex-vc142-mt-gd-x32-1_74.lib'

I am using Microsoft Visual Studio Professional 2019 Version 16.9.5 and trying to compile code as mentioned in Boost.StringAlgorithms.
I am getting the below error during local compilation and linking :
1>------ Build started: Project: Boost.StringAlgorithms, Configuration: Debug Win32 ------
1>LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc142-mt-gd-x32-1_74.lib'
1>Done building project "Boost.StringAlgorithms.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I have ensured that I have set the project properties (link and libs). I do see the concerned file in C:\tools\boost_1_74_0\stage\lib directory:
libboost_regex-vc142-mt-gd-x64-1_74.lib
boost_regex-vc142-mt-gd-x64-1_74.lib
I have build all boost library for x64 architecture - why the linking process is looking for libboost_regex-vc142-mt-gd-x32-1_74.lib ?

Compile Apache APR on Windows

The end result is I am trying to compile something that requires the APR from Apache on Windows.
Edit: Tried Visual Studio command line tools for VS2013 & VS2014.
Link for SVN checkout shows 404: http://apr.apache.org/anonsvn.txt
so...
From this link http://apr.apache.org/compiling_win32.html I have downloaded the three files. I unzipped them and renames them as the directory structure suggested.
C:\work\apr\
C:\work\apr-iconv\
C:\work\apr-util\
Moved to the apr-util directory and ran the following make command and received the following errors.
Note there is the comment about "Current versions of APR do not need awk..." but the link does not work, does it matter?
Anybody have any luck compiling this, do I need other lib/include/objects?
nmake -f Makefile.win buildall checkall installall clean
Received the following errors:
<clip>
rc.exe /l 0x409 /fo".\Release\libapriconv.res" /i "./include" /i "../apr/include" /d "NDEBUG" /d "API_VERSION_ONLY" .\libapriconv.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.3.9600.17336
Copyright (C) Microsoft Corporation. All rights reserved.
link.exe #C:\Users\JOHNAT~1\AppData\Local\Temp\nm390A.tmp
Creating library .\Release\libapriconv-1.lib and object .\Release\libapriconv-1.exp
if exist .\Release\libapriconv-1.dll.manifest mt.exe -manifest .\Release\libapriconv-1.dll.manifest -outputresource:.\Release\libapriconv-1.dll;2
echo Helper for Post-build step > ".\Release\postbld.dep"
cd ccs
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe" -nologo -f Makefile.win all BUILD_MODE="Win32 Release" BIND_MODE=shared adobe-stdenc.c
Creating library ..\Release\iconv\adobe-stdenc.lib and object ..\Release\iconv\adobe-stdenc.exp
adobe-stdenc.obj : error LNK2011: precompiled object not linked in; image may not run
..\Release\iconv\adobe-stdenc.so : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\link.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
It's a little late, but here is how I fixed it.
In the build\modules.mk.win makefile change line 221 from
$(SILENT)link $(ALL_LDFLAGS) $*.obj $(API_LIBS) /out:$# \
To
$(SILENT)link $(ALL_LDFLAGS) $*.obj $(MODRES).obj $(API_LIBS) /out:$# \
The shared library target will now read:
.c{$(OUTPUT_DIR)}.so:
$(SILENT)cl $(ALL_CFLAGS) /Fo$*.obj /Yuiconv.h /c $<
$(SILENT)link $(ALL_LDFLAGS) $*.obj $(MODRES).obj $(API_LIBS) /out:$# \
/base:#"..\build\BaseAddr.ref",$(#F)
$(SILENT)if exist $#.manifest \
$(SILENT)mt -nologo -manifest $#.manifest -outputresource:$#;2 \
& del "$#.manifest"
$(SILENT)del "$*.exp" & del "$*.lib"
Source: https://gist.github.com/mkhon/01a1536b01e0065ae799
From the apache-apr project site under heading:
Developer Studio Workspace/Microsoft Development Environment IDE Build::
Open the apr-util/aprutil.dsw workspace, and choose either aprutil or libaprutil (for static or dynamic libraries) with the Release or Debug build as the Active Project. aprutil.dsw causes all related projects to be built.
Maybe you overlooked this statement : choose either aprutil or libaprutil as the Active Project...
Then build the active project.

Error in visual studio 2012 (They were build errer)

I'm new at Visual studio 2010
When I hit "start debugging(F5)" obviously it says: "would you like to build it?"
then I push yes button and it is says:"There were build error. Would you like to continue and run the last successful build?"
then I hit yes button and it says: "Unable to start program c:\users\My computer\documents\visual studio 2010\projects\tutorial1\Debug\tutorial.exe"
here is the Output:
1>------ Build started: Project: tutorial1, Configuration: Debug Win32 ------
1>InitializeBuildStatus:
1> Touching "Debug\tutorial1.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.13
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I don't know how to solve this problem. Can anyone help me?
To Answer:
then I hit yes button and it says: "Unable to start program
c:\users\My computer\documents\visual studio
2010\projects\tutorial1\Debug\tutorial.exe"
This is the case where Visual Studio would try to launch the output of the previous build.
Visual Studio would try to launch the output of the StartUp project from the current Configuration (Debug/Release) output folder.
In your case "c:\users\My computer\documents\visual studio 2010\projects\tutorial1\Debug\tutorial.exe" that was built during the last build operation would have been deleted.
The deletion could have happened as part of Clean operation.
Note: Rebuild would run Clean and Build.
Based on the error posted:
Error 'LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt' after installing Visual Studio 2012 Release Preview

Compiling CUDA exampels with Visual Studio 2010 express

I am trying to set up a CUDA dev env on a Windows 7 32bit computer with Visual Studio 2010 Express.
But I keep getting the following error when I try to compile the bandwithTest project that follow with the CUDA SDK!
1>------ Build started: Project: cutil, Configuration: Release Win32 ------
2>------ Build started: Project: shrUtils, Configuration: Release Win32 ------
2>LINK : fatal error LNK1104: cannot open file 'lib\Win32\shrUtils32.lib'
1>LINK : fatal error LNK1104: cannot open file 'lib\Win32\\cutil32.dll'
3>------ Build started: Project: bandwidthTest, Configuration: Release Win32 ------
3>LINK : fatal error LNK1104: cannot open file '../../bin/win32/Release//bandwidthTest.exe'
========== Build: 0 succeeded, 3 failed, 0 up-to-date, 0 skipped ==========
Follow this guide: How to Run CUDA In Visual Studio 2010
Check my answer to this question:
cuda sdk example bandwidthTest - build failed
If they are already built then check if they are correctly listed in the additional library directories in the solution properties, linking tab.

Visual Studio 2010 new project wizard manufactured MFC Dialog program doesn't compile in Debug Mode?

I've created a new project using the Visual Studio 2010's wizard. Once VS was finished generating the project I tried building it - in release mode it worked great, but in debug mode it didn't, giving the following compiler error:
1>------ Build started: Project: MyProj, Configuration: Debug Win32 ------
1>Build started 05/10/2010 22:17:08.
1>InitializeBuildStatus:
1> Touching "Debug\MyProj.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1> All outputs are up-to-date.
1>ResourceCompile:
1> All outputs are up-to-date.
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>LINK : fatal error LNK1104: cannot open file 'D:\My Documents\Dev\MyProj\MyProj\Debug\MyProj.exe'
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.24
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I set the following parameters in the wizard:
MFC Application
Dialog based
Use MFC in a static library
Added the "Windows Sockets" advanced feature
I'm on a Windows 7 64bit Ultimate machine.
This seems like a minor bug in Visual Studio 2010. Once I closed the solution and reopened it, it worked fine...
This error is reproducible on my setup.

Resources