David J Oldfield

Error 1 fatal error LNK1181: cannot open input file " ˇö/.obj" test

While I did catch a thread that says "Check linker settings", I cannot find such an option (I have never had to worry about such things). I assume that for this to be the origen of the problem then such settings would have to be global In either case, how would they have changed globally without me interacting with them in the first place

Innitially, my project was compiling fine. Then I got "Error Spawning CMD.EXE". I managed to correct that problem using information I found in another thread, to update directories. Now it is trying to compile .obj... even with a new project. I can no longer use C++ in the development environment until such a problem can be corrected, and while I would actually preffer to use c++ 6.0, I am actually making this project for the purpose of getting use to c++.net... which means that 6.0 would defeat the purpose.

Anyway, any help that can be provided would be greatly appreciated. Thanks!

-- Dave




Re: Visual C++ General LNK1181 (Yet another thread). Having serious problem even when creating a new project.

Holger Grund

Can you show us the full command line for link.exe from the buildlog.htm file

If you don't see anything fancy on the command line it could be an environment variable called LINK which link.exe processes as implicit command line arguments. I'd suggest that you try to compile and link a simple program from the command line (THe command line env is available in the Tools menu of the Program Files->VS 2005 menu).

E.g.:

echo int main(){} > t.cpp

cl /c t.cpp
link t.obj

set link

set cl

What does it show





Re: Visual C++ General LNK1181 (Yet another thread). Having serious problem even when creating a new project.

David J Oldfield

Setting environment for using Microsoft Visual Studio 2005 x86 tools.

C:\Program Files\Microsoft Visual Studio 8\VC>echo int main() {} > t.cpp

C:\Program Files\Microsoft Visual Studio 8\VC>cl /c t.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

t.cpp

C:\Program Files\Microsoft Visual Studio 8\VC>link t.obj
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.


C:\Program Files\Microsoft Visual Studio 8\VC>set link
Environment variable link not defined

C:\Program Files\Microsoft Visual Studio 8\VC>set cl
CLASSPATH=.;C:\Program Files\Java\jre1.5.0_08\lib\ext\QTJava.zip
CLIENTNAME=Console

C:\Program Files\Microsoft Visual Studio 8\VC>






Re: Visual C++ General LNK1181 (Yet another thread). Having serious problem even when creating a new project.

David J Oldfield

David J Oldfield wrote:

Setting environment for using Microsoft Visual Studio 2005 x86 tools.

C:\Program Files\Microsoft Visual Studio 8\VC>echo int main() {} > t.cpp

C:\Program Files\Microsoft Visual Studio 8\VC>cl /c t.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

t.cpp

C:\Program Files\Microsoft Visual Studio 8\VC>link t.obj
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.


C:\Program Files\Microsoft Visual Studio 8\VC>set link
Environment variable link not defined

C:\Program Files\Microsoft Visual Studio 8\VC>set cl
CLASSPATH=.;C:\Program Files\Java\jre1.5.0_08\lib\ext\QTJava.zip
CLIENTNAME=Console

C:\Program Files\Microsoft Visual Studio 8\VC>

The above was the implementation of what you had suggested. It appears that link does not possess any data.

It also appears that the command line compiler works... unless I missunderstood what I was doing.






Re: Visual C++ General LNK1181 (Yet another thread). Having serious problem even when creating a new project.

Holger Grund

Yes, that indicates everything worked just fine with the command line compiler. So it might be a settings problem. Can you show us the command line for link.exe from the buildlog.htm It might also be helpful to use the /VERBOSE linker switch.

-hg





Re: Visual C++ General LNK1181 (Yet another thread). Having serious problem even when creating a new project.

David J Oldfield

Build Log

Build started: Project: test, Configuration: Debug|Win32

Command Lines
Creating temporary file "\\e-bit\files\rts_dem_1.0\test\test\Debug\RSP00000131004864.rsp" with contents
[
/Od /D "WIN32" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /FD /EHa /MDd /Yu"stdafx.h" /Fp"Debug\test.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /Zi /clrStick out tongueure /TP /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll"

".\AssemblyInfo.cpp"

".\test.cpp"
]
Creating command line "cl.exe @"\\e-bit\files\rts_dem_1.0\test\test\Debug\RSP00000131004864.rsp" /nologo /errorReportStick out tonguerompt"
Creating temporary file "\\e-bit\files\rts_dem_1.0\test\test\Debug\RSP00000231004864.rsp" with contents
[
/Od /D "WIN32" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /FD /EHa /MDd /Yc"stdafx.h" /Fp"Debug\test.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /Zi /clrStick out tongueure /TP /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll"

".\stdafx.cpp"
]
Creating command line "cl.exe @"\\e-bit\files\rts_dem_1.0\test\test\Debug\RSP00000231004864.rsp" /nologo /errorReportStick out tonguerompt"
Output Window
Compiling...
Command line warning D4002 : ignoring unknown option '/errorReportStick out tonguerompt'
Command line warning D4024 : unrecognized source file type ' ˇö/', object file assumed
LINK : fatal error LNK1181: cannot open input file " ˇö/.obj"
Results
Build log was saved at "file://\\e-bit\files\rts_dem_1.0\test\test\Debug\BuildLog.htm"
test - 1 error(s), 0 warning(s)





Re: Visual C++ General LNK1181 (Yet another thread). Having serious problem even when creating a new project.

Holger Grund

Very odd. Looks like the compiler driver chokes on the encoding of the response file or something. Maybe the IDE invokes a nonmatching compiler version. Can you add the /Bv and /Bd switches to the compiler line Just set it like so

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.

  2. Click the C/C++ folder.

  3. Click the Command Line property page.

With these options you should see the compiler toolchain components versions and what command line the driver uses to invoke other components.

-hg





Re: Visual C++ General LNK1181 (Yet another thread). Having serious problem even when creating a new project.

David J Oldfield

I did as suggested but it comes to the same. Strangely, the build log seems to remain unchanged however, and I can't help but wonder if it has something to do with the compiler attempting uniciode compile. This may speak to my novice skills, but I had never manged to get a successful unicode build in 6.0. Is it possible that it is attempting to read unicode from files which are not unicode Is there a way to test that theory