Hope someone can help me with this. I'm doing a command line build. The
compile goes fine, but while attempting to link, the error:
LINK : fatal error LNK1181: cannot open input file 'advapi32.lib'
is generated, although I changed my Windows 2000 LIB environment variable to
clearly contain the entry:
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Lib\
where the file resides. So, the error mystifies me and I don't know how to
fix it. Can anyone help? Thanks, Ted.
David Lowndes - 03 Nov 2005 08:59 GMT
>LINK : fatal error LNK1181: cannot open input file 'advapi32.lib'
Can you open it in Notepad (it is a permissions problem)?
Is the file corrupt? Try using dumpbin on it.
Dave

Signature
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Ted Jackson - 03 Nov 2005 19:11 GMT
Hi David,
Thanks for your response. I could open it without problems in Notepad. I
tried dumpbin (without options) and it produced this output:
**************************
File Type: Library
Summary
C9 .debug$8
14 .idata$2
14 .idata$3
4 .idata$4
4 .idata$5
E .idata$6
****************************
I'm not sure what to expect, but I see no obvious problems.
Thanks,
Ted
> >LINK : fatal error LNK1181: cannot open input file 'advapi32.lib'
>
[quoted text clipped - 3 lines]
>
> Dave
Ideas Vacuum - 03 Nov 2005 12:15 GMT
In VS, add the lib to your resource folder ("add existing item")
> Hope someone can help me with this. I'm doing a command line build. The
> compile goes fine, but while attempting to link, the error:
[quoted text clipped - 10 lines]
> to
> fix it. Can anyone help? Thanks, Ted.
Ted Jackson - 03 Nov 2005 19:39 GMT
Thanks for your response, IV. Does your suggestion apply to a command line
build? Unfortunately, I can't build it within Visual Studio, because the
build is actually generated by my PTC Pro/Engineer CAD software, which relies
on the compiler/linker to do structural modeling. Here are the batch
commands that ProE uses:
******************************
"c:\Program Files\Microsoft Visual Studio .NET\Vc7\bin\link.exe"
-align:0x1000 -subsystem:console -entry:mainCRTStartup -force:multiple
-nodefaultlib:msvcrt -nodefaultlib:msvcirt -nodefaultlib:libc
-nodefaultlib:libci -out:".\i486_nt\asm0001.exe" "e:\PTC\ProENGINEER Student
Edition\i486_nt\lib/mmsolver.o" "e:\PTC\ProENGINEER Student
Edition\i486_nt\tmp\enva03392.o" ".\i486_nt\_asm0001.lib" "libunix.a"
"advapi32.lib" "wsock32.lib" "winspool.lib" "netapi32.lib" "oldnames.lib"
"kernel32.lib" "user32.lib" "gdi32.lib" "mpr.lib" "comctl32.lib"
"comdlg32.lib"
The above command produced the following output:
Microsoft (R) Incremental Linker Version 7.00.9466
Copyright (C) Microsoft Corporation. All rights reserved.
LINK : warning LNK4108: /ALIGN specified without /DRIVER or /VXD; image may
not run
LINK : fatal error LNK1181: cannot open input file 'advapi32.lib'
**********************************
Hope this helps. Thanks - Ted
> In VS, add the lib to your resource folder ("add existing item")
>
[quoted text clipped - 12 lines]
> > to
> > fix it. Can anyone help? Thanks, Ted.
David Lowndes - 03 Nov 2005 21:24 GMT
>LINK : warning LNK4108: /ALIGN specified without /DRIVER or /VXD; image may
>not run
>LINK : fatal error LNK1181: cannot open input file 'advapi32.lib'
What happens if you remove the align option?
Dave

Signature
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Ted Jackson - 03 Nov 2005 21:51 GMT
Hi David,
I don't have any control over how Pro/E generates its batch files, but I'll
see if I can find a way to simulate what it does in the background.
Unfortunately PTC doesn't even offer paid support to owners of its Student
Edition of Pro/E. I'll let you know if I have any success.
Regards and thanks again,
Ted
> >LINK : warning LNK4108: /ALIGN specified without /DRIVER or /VXD; image may
> >not run
[quoted text clipped - 3 lines]
>
> Dave