C++ Question VC++ problem

T.Neo

SA 2010 Soccermaniac
Addon Developer
Joined
Jun 22, 2008
Messages
6,368
Reaction score
0
Points
0
I am trying to set up my VC++ compiler thingy.
When I try to compile ShuttlePB, I get this message:

Code:
LINK : fatal error LNK1181: cannot open input file 'user32.lib'

I think I downloaded the Windows SDK correctly and followed the instructions on Orbiterwiki correctly, but I am not sure.

I have been spending the whole day trying to set this thing up. I am getting frustrated.:compbash2:

Any help? :sos:
 

Scrooge McDuck

Addon Developer
Addon Developer
Joined
Mar 18, 2008
Messages
515
Reaction score
30
Points
28
Location
The Netherlands
Website
orbitermap.no-ip.org
After installing the Platform SDK, you need to add the directories to the VC Express settings (tools/options/VC++ directories).
Examples here, hope this helps. Maybe slight changes in VC2008, but I'm currently not on my windows PC to check it.

regards,
mcduck
 

T.Neo

SA 2010 Soccermaniac
Addon Developer
Joined
Jun 22, 2008
Messages
6,368
Reaction score
0
Points
0
Still not working.
Here are my VC++ directories:
Executable files:
Code:
$(VCInstallDir)bin
$(ProgramFiles)Microsoft Platform SDKBin
$(VSInstallDir)Common7Toolsbin
$(VSInstallDir)Common7tools
$(VSInstallDir)Common7ide
$(ProgramFiles)HTML Help Workshop
$(FrameworkSDKDir)bin
$(FrameworkDir)$(FrameworkVersion)
$(VSInstallDir)
$(PATH)

Include files:
Code:
$(VCInstallDir)include
$(ProgramFiles)Microsoft Platform SDKinclude
$(FrameworkSDKDir)include

Lib files:
Code:
$(ProgramFiles)Microsoft Platform SDKlib

I think I changed some of the wrong instances to the wrong thing.
Where am I going wrong?
 

T.Neo

SA 2010 Soccermaniac
Addon Developer
Joined
Jun 22, 2008
Messages
6,368
Reaction score
0
Points
0
I'm still stuck with this. Could anyone lend me a hand?

I try to compile ShuttlePB but it says it can't find windows.h
However, I do a search and find windows.h, and I am positive that I have installed the SDK.
 

Stripe

New member
Joined
Jan 4, 2009
Messages
36
Reaction score
0
Points
0
Location
East Midlands
It's been a few years since I last touched VC++

But let's start at the beginning...

When you search for windows.h where do you find it?
 

dbeachy1

O-F Administrator
Administrator
Orbiter Contributor
Addon Developer
Donator
Beta Tester
Joined
Jan 14, 2008
Messages
9,217
Reaction score
1,565
Points
203
Location
VA
Website
alteaaerospace.com
Preferred Pronouns
he/him
It should be in your $(ProgramFiles)\Microsoft Platform\SDK\lib directory, which is already in your lib path, so I would expect the link to succeed (although it obviously isn't). Do a search on your system for your User32.lib file. Once you find it, add that directory to your lib path.

On my Vista x64 system with VS 2005 the file is here: C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\Lib\User32.Lib
 

T.Neo

SA 2010 Soccermaniac
Addon Developer
Joined
Jun 22, 2008
Messages
6,368
Reaction score
0
Points
0
My windows.h file seems to be here C:\Program Files\Microsoft SDKs\Windows\v6.1\Include\

My User32.lib file seems to be here:
C:\Program Files\Microsoft SDKs\Windows\v6.1\Lib\IA64\

:huh:
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,621
Reaction score
2,340
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
why do you use IA64?
 

T.Neo

SA 2010 Soccermaniac
Addon Developer
Joined
Jun 22, 2008
Messages
6,368
Reaction score
0
Points
0
why do you use IA64?

What exactly is IA64? Please explain. Maybe I installed the wrong SDK.
 

T.Neo

SA 2010 Soccermaniac
Addon Developer
Joined
Jun 22, 2008
Messages
6,368
Reaction score
0
Points
0
I still don't get it. There are three SDKs to choose from, and which ever I pick I am confronted with more confusing decisions to make.
Then, the image provided shows as if there are no features selected to be installed.
Could someone provide me with a step by-step instruction of what to do?
 

dbeachy1

O-F Administrator
Administrator
Orbiter Contributor
Addon Developer
Donator
Beta Tester
Joined
Jan 14, 2008
Messages
9,217
Reaction score
1,565
Points
203
Location
VA
Website
alteaaerospace.com
Preferred Pronouns
he/him
It sounds like you only installed the Itanium (IA64) SDK, which explains why you only have the IA64 version of user32.lib on your system. The SDK you need is x86 32-bit. As Stripe said, be sure to unselect everything except what is selected in the image on the wiki page:

SDKInstall1.png


Then, the image provided shows as if there are no features selected to be installed. Could someone provide me with a step by-step instruction of what to do?

Every feature that does not have a red X next to it will be installed.
 

T.Neo

SA 2010 Soccermaniac
Addon Developer
Joined
Jun 22, 2008
Messages
6,368
Reaction score
0
Points
0
I think I've installed the correct SDK. Now I get this:

Code:
[SIZE=1]
.ShuttlePB.cpp(43) : error C2065: 'i' : undeclared identifier
[/SIZE]
 

Notebook

Addon Developer
Addon Developer
News Reporter
Donator
Joined
Nov 20, 2007
Messages
11,816
Reaction score
641
Points
188
You're getting there!
If you scroll down more on the OrbiterWiki complier setup you see this heading.

C++ language change

The text around this explains why this change is needed.

N.
 

T.Neo

SA 2010 Soccermaniac
Addon Developer
Joined
Jun 22, 2008
Messages
6,368
Reaction score
0
Points
0
I think I've changed the .cpp file correctly, shouldn't Martin release a patch to fix that?

However I now get this:
Code:
[SIZE=1]
LINK : fatal error LNK1104: cannot open file 'msvcprt.lib'
[/SIZE]
Must I exclude this file?
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
I think I've changed the .cpp file correctly, shouldn't Martin release a patch to fix that?

However I now get this:
Code:
[SIZE=1]
LINK : fatal error LNK1104: cannot open file 'msvcprt.lib'
[/SIZE]
Must I exclude this file?
Yes, add it to the "Ignore specific library" option.
 

T.Neo

SA 2010 Soccermaniac
Addon Developer
Joined
Jun 22, 2008
Messages
6,368
Reaction score
0
Points
0
Did that. Then is said something about MSVCRT.lib, so I added that to the ignore list. Then it did the same for OLDNAMES.lib. I told it to ignore this.
Then it says:
Code:
[SIZE=1]
Linking...
Creating library .......Modules/ShuttlePB.lib and object .......Modules/ShuttlePB.exp
ShuttlePB.obj : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
ShuttlePB.obj : error LNK2019: unresolved external symbol "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) referenced in function "public: virtual void * __thiscall LaunchpadItem::`scalar deleting destructor'(unsigned int)" (??_GLaunchpadItem@@UAEPAXI@Z)
ShuttlePB.obj : error LNK2019: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) referenced in function "public: virtual void * __thiscall LaunchpadItem::`vector deleting destructor'(unsigned int)" (??_ELaunchpadItem@@UAEPAXI@Z)
ShuttlePB.obj : error LNK2019: unresolved external symbol "void __stdcall `eh vector destructor iterator'(void *,unsigned int,int,void (__thiscall*)(void *))" (??_M@YGXPAXIHP6EX0@Z@Z) referenced in function "public: virtual void * __thiscall LaunchpadItem::`vector deleting destructor'(unsigned int)" (??_ELaunchpadItem@@UAEPAXI@Z)
ShuttlePB.obj : error LNK2001: unresolved external symbol __fltused
ShuttlePB.obj : error LNK2001: unresolved external symbol __purecall
ShuttlePB.obj : error LNK2019: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) referenced in function _ovcInit
LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12
.......Modules/ShuttlePB.dll : fatal error LNK1120: 8 unresolved externals
[/SIZE]
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
Does OLDNAMES.lib exist on your system? You may need to explicitly link with it by specifying it in the Additional Dependencies option. Also make sure the path to it is nominated in the Additional Library Directories option.
 

T.Neo

SA 2010 Soccermaniac
Addon Developer
Joined
Jun 22, 2008
Messages
6,368
Reaction score
0
Points
0
Yes. oldnames.lib exists on my system here:
C:\Program Files\Microsoft Visual Studio 8\VC\lib
and here:
C:\Program Files\Microsoft Visual Studio 9.0\VC\lib
 
Top