Results 1 to 5 of 5

Thread: LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj'

  1. #1
    Join Date
    Nov 2007
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj'

    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

  2. #2
    Join Date
    Oct 2006
    Posts
    279
    Thanks
    6
    Thanked 40 Times in 39 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj'

    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.

  3. #3
    Join Date
    Nov 2007
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj'

    Quote Originally Posted by spud View Post
    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

  4. #4
    Join Date
    Oct 2006
    Posts
    279
    Thanks
    6
    Thanked 40 Times in 39 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj'

    Did you run the "Visual Studio 2005 Command Prompt" instead of cmd.exe? There seems to be a problem with the path.

  5. #5
    Join Date
    Nov 2007
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj'

    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

Similar Threads

  1. LINK : fatal error LNK1181: can't open 'delayimp.lib'
    By fcamlar in forum Installation and Deployment
    Replies: 10
    Last Post: 7th July 2006, 14:04

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.