LINK : fatal error LNK1104: cannot open file 'user32.lib'.

Hello,

I've tried everything to get ANY program to work and they won't. Not even "Hello World" or code copied directly from help.

Always the same:

LINK : fatal error LNK1104: cannot open file 'user32.lib'.

I've read all the suggestions here, followed all the directions including from the websites:

1. Uninstall beta versions

Before installing, you must uninstall any previous versions of SQL Server 2005, Visual Studio 2005, and the .NET Framework 2.0 (this includes Tech Preview, Beta, or CTP versions).

2. Download and install Visual C++ 2005 Express Edition!!

3. Register

4. Install the Platform SDK

AND

Step 1: Install Visual C++ Express.

Step 2: Install the Microsoft Platform SDK...for the x86 platform.

Step 3: Update the Visual C++ directories in the Projects and Solutions section in the Options dialog box.

Add the paths to the appropriate subsection:

Executable files: C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin

Include files: C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include

Library files: C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib

In the help files that came with the software the instructions for this are thus:

Executable files: C:\Program Files\Microsoft SDK\Bin

Include files: C:\Program Files\Microsoft SDK\include

Library files: C:\Program Files\Microsoft SDK\lib

I’ve tried both with no luck.

Step 4: Update the corewin_express.vsprops file.

Edit the corewin_express.vsprops file (found in C:\Program Files\Microsoft Visual Studio 8\VC\VCProjectDefaults) and

Change the string that reads:

AdditionalDependencies="kernel32.lib" to

AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib"

Step 5: Generate and build a Win32 application to test your paths.

Edit the file AppSettings.htm file located in the folder “%ProgramFiles%\Microsoft Visual Studio 8\VC\VCWizards\AppWiz\Generic\Application\html\1033\".

In a text editor comment out lines 441 - 444 by putting a // in front of them as shown here:

// WIN_APP.disabled = true;

// WIN_APP_LABEL.disabled = true;

// DLL_APP.disabled = true;

// DLL_APP_LABEL.disabled = true;

This code didn't correspond to the lines mentioned but they were only grouped like this in one place. And I don't think this would impactthe libraries anyway.

I’m running XP SP2 with nearly a Gig of memory and a 2.8 Ghz Pentium processor. I’ve downloaded all the updates I could find to no avail. I have even uninstalled and reinstalled more than once.

I’ve done some programming in Fortran and I’m trying to teach myself C++ and it ain't been easy.

Ironically these programs ran on my C++ compiler that came with my Fortran package after a few tweaks.

Any help that hasn’t already been covered would be appreciated.

Tom

[14402 byte] By [MesoX] at [2007-12-30]
# 1

Try specifing user32.lib as described at http://msdn2.microsoft.com/en-us/library/ba1z7822.aspx

Hope this helps!

Thanks,

Ayman Shoukry

VC++ Team
AymanShoukry-MSFT at 2007-9-5 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 2
Thanks. I'll give it a try.
MesoX at 2007-9-5 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 3

The instructions for installing the PSDK include modifying corewin_express.vsprops to specify additional library dependencies for the project defaults. However to make this effective in your project you may need to change the linker setting:

Project | [MyProject] Properties | ... to bring up the property pages.

Navigate to Configuration Properties | Linker | Input ... and click the browse button on the Additional Dependencies row

Then check the "Inherit from parent or project defaults" option to make the additional dependencies for the PSDK effective in your project.

Hope this helps!

scdlewis at 2007-9-5 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 4
I had the exactly same problem, and tried the above steps. But the error was not solved.
Victorxiao at 2007-9-5 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 5

It could be worth using explorer to confirm that the lib file really is in the specified folder. Also double-check that the correct PSDK directories have been specifed in the C++ directory settings (Tools | Options...) - I think if I remember correctly the installation directions on MSDN gave the directory paths as .../Microsoft Platform SDK 2003/ or similar, as opposed to .../Microsoft Platform SDK/

You can verify your paths by clicking the button with the check mark symbol in the C++ directory settings.

scdlewis at 2007-9-5 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 6
here is the solution I've found (and it works for me)

with a project that create a .exe or a .dll file

-

Configuration Properties / C/C++ / General /

Additionnal Include Directories

Edit and add following lines (according to your right SDK path of course) :

C:\Program Files\Microsoft Platform SDK

for Windows Server 2003 R2\Include

C:\Program Files\Microsoft Platform SDK

for Windows Server 2003 R2\Include\mfc

-

Configuration

Properties / Linker / General / Additionnal Library Directories

Edit and add following lines (according to your right SDK path of course) :

C:\Program Files\Microsoft Platform SDK

for Windows Server 2003 R2\Lib


-

Configuration Properties / Ressources / General

/ Additionnal Include Directories

Edit and add following lines (according to your right SDK path of course) :

C:\Program Files\Microsoft Platform SDK

for Windows Server 2003 R2\Include

C:\Program Files\Microsoft Platform SDK

for Windows Server 2003 R2\Include\mfc

if you generate a .Lib file

-

Configuration Properties / C/C++ / General /

Additionnal Include Directories

Edit and add following lines (according to your right SDK path of course) :

C:\Program Files\Microsoft Platform SDK

for Windows Server 2003 R2\Include

C:\Program Files\Microsoft Platform SDK

for Windows Server 2003 R2\Include\mfc

-

Configuration

Properties / Librarian / General / Additionnal Library Directories

Edit and add following lines (according to your right SDK path of course) :

C:\Program Files\Microsoft Platform SDK

for Windows Server 2003 R2\Lib

good luck
Thierry ROBIN

trobin at 2007-9-5 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 7
Same problem. Finally realized that the paths listed in Tools->Options->Projects and Solutions->VC++ Directories, "Library files" selected - did not have the path I assumed it did. I used the defaut install location for the MS Platform SDK and thought this meant the folder: $(VCInstallDir)PlatformSDK\lib" was the needed one. But was wrong. Added "C:\Program Files\Microsoft Platform SDK\lib" and everything worked fine.
aaronE64 at 2007-9-5 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 8
nice and easy... can someone explain how to to fix this problem?
horus321 at 2007-9-5 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 9

I should mention that you need to check the Platform SDK directorie. Instead of "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin" it looks it has been changed to "C:\Program Files\Microsoft Platform SDK\Bin". Use Windows explorer to find out exactly what the name is.

But yes, with all these, changes you can compile and debug Win32 applications. Works well!

Ben_userdn at 2007-9-5 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 10

could you tell me how to install SDK.I have the same problam with you having.It's my first time to use this softwave.I read the WEB ,but can't understand very well.I need help .

bearming at 2007-9-5 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 11

I can't instill SDK It shows that can't access the web .I try to close the norton,but it still don't work.why ?

bearming at 2007-9-5 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 12

Hi, I'm answering the original question because when this happened to me, my search for the answer brought me to this forum thread. So I'm assuming that most people will be here for that.

The issue is that the educational video has a load of mistakes in it. Here's what you should do differently (to make it link, at least):

When adding the extra SDK paths under "Tools|Options|Projects and Solutions|VC++ Directories":

- Only the "Bin" directory belongs in the place shown. There's a drop-down menu at the top-right of the window called "Show directories for:". By default, this is "Executable files:" which is OK for the "Bin" directory. Before adding the "Lib" directory, this should be set to "Library files". Before adding the "Include" directory, this should be "Include files".

- Use backslashes, not slashes to delineate the directory path.

- The variable they're trying to use is $(ProgramFiles), [no space] not $(Program Files) [with a space], as the example shows.

Finally, when modifying corewin_express.vsprops:

- The library name "advapi.lib" is incorrect. Use "advapi32.lib" instead.

Hope this helps.

Cheers,

- Steve.

steve_jonesuk at 2007-9-5 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 13

Thanks Steve. Your post finally got me up and running.

Kasbarr at 2007-9-5 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...
# 14
steve. thank you.Now I can use it .
bearming at 2007-9-5 > top of Msdn Tech,Visual Studio Express Editions,Visual C++ 2005 Express Edition...