PDA

View Full Version : LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj'



alphanique
23rd November 2007, 09:39
Good day all,

I am a recent installer of Qt framework 4.3.2 open-source on a Win Xp Pro Sp2 platform. I have also installed the MS SDK for Windows Server 2003 SP1.

I had gotten an error of the nature : LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj', when trying to compile and link a simple test/example project.

It appears this may have been due to spaces in directory paths however after installing SDK in another more appropriate directory I still get the same error :

Currently I have these installation directories :

C:\Qt\4.3-msvc2005\qt-win-opensource-src-4.3.2\
C:\Microsoft-Platform-SDK\

vsvars32.bat is like this :

@SET VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8
@SET VCINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8\VC
@SET FrameworkDir=C:\WINDOWS\Microsoft.NET\Framework
@SET FrameworkVersion=v2.0.50727
@SET FrameworkSDKDir=C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0
@if %VSINSTALLDIR%== goto error_no_VSINSTALLDIR
@if %VCINSTALLDIR%== goto error_no_VCINSTALLDIR

@echo Setting environment for using Microsoft Visual Studio 2005 x86 tools.

@rem
@rem Root of Visual Studio IDE installed files.
@rem
@set DevEnvDir=C:\Program Files\Microsoft Visual Studio 8\Common7\IDE

@set PATH=C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\bin;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools;C:\Program Files\Microsoft Visual Studio SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v2 .0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages;C:\Qt\4.3-msvc2005\qt-win-opensource-src-4.3.2\qmake;%PATH%
@set INCLUDE=C:\Microsoft-Platform-SDK\Include;C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;C:\Qt\4.3-msvc2005\qt-win-opensource-src-4.3.2\include;%INCLUDE%
@set LIB=C:\Microsoft-Platform-SDK\lib;C:\Program Files\Microsoft Visual Studio 8\VC\lib;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;%LIB%
@set LIBPATH=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50 727

@goto end

:error_no_VSINSTALLDIR
@echo ERROR: VSINSTALLDIR variable is not set.
@goto end

:error_no_VCINSTALLDIR
@echo ERROR: VCINSTALLDIR variable is not set.
@goto end

:end

If anybody has resolved this issue in the passed I would really appreciate any of your suggestions or help with resolving this annoying bottle-neck ...

Many thanks in advance, Mike

spud
23rd November 2007, 11:53
Could you show us the relevant line(Linker Input) of your Make/VCPROJ-file? You will find an entry there: ...;C:\Program Files\bla\XXX.lib;... , which should have been put in quotes.
Also, show us your .pro file if you can.

alphanique
23rd November 2007, 13:20
Could you show us the relevant line(Linker Input) of your Make/VCPROJ-file? You will find an entry there: ...;C:\Program Files\bla\XXX.lib;... , which should have been put in quotes.
Also, show us your .pro file if you can.

Ok many thanks I did recheck the .pro file and the error was to do with the Ole32.ib.

now nmake returns :

F:\Mike\MSVC Projects\TestApp>nmake release

Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.

"C:\Program Files\Microsoft Visual Studio 8\VC\bin\nmake.exe" -f Makefile.Release

Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.

link /LIBPATH:"c:\Qt\4.3-msvc2005\qt-win-opensource-src-4.3.2\lib" /NOLOGO /INCREMENTAL:NO /MANIFESTFILE:"release\TestAp
p.intermediate.manifest" /SUBSYSTEM:WINDOWS /OUT:release\TestApp.exe @C:\DOCUME~1\Mike\LOCALS~1\Temp\nmE70.tmp
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\bin\link.EXE"' : return code '0xc0000135'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\bin\nmake.exe"' : return code '0x2'
Stop.

This is unrelated but perhaps not ?!? Any ideas ?

Many thanks in advance, Mike

spud
23rd November 2007, 16:12
Did you run the "Visual Studio 2005 Command Prompt" instead of cmd.exe? There seems to be a problem with the path.

alphanique
24th November 2007, 13:33
Ok many thanks. Have resolved the problem by first doing a nmake distclean then a qmake -project to generate another .pro file. This then compiled but generated some unresolved external references. I fixed the linker issue with ensuring
win32:LIBS += C:\Microsoft-Platform-SDK\Lib\Ole32.lib was included in the .pro file which was a library required by the linker. Everything compiled and linked clean and .exe file executes as expected.

Many thanks, Mike