02.07 - The Readiness Test

Started by
214 comments, last by Teej 20 years, 4 months ago
--------------------Configuration: BaseCode1 - Win32 Debug--------------------
Compiling...
GameMain.cpp
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(87) : error C2146: syntax error : missing '';'' before identifier ''lpDD''
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(87) : error C2501: ''LPDIRECTDRAW7'' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(87) : error C2501: ''lpDD'' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(88) : error C2146: syntax error : missing '';'' before identifier ''lpDDSPrimary''
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(88) : error C2501: ''LPDIRECTDRAWSURFACE7'' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(88) : error C2501: ''lpDDSPrimary'' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(89) : error C2146: syntax error : missing '';'' before identifier ''lpDDSBack''
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(89) : error C2501: ''LPDIRECTDRAWSURFACE7'' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(89) : error C2501: ''lpDDSBack'' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(90) : error C2146: syntax error : missing '';'' before identifier ''lpDDSRes''
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(90) : error C2501: ''LPDIRECTDRAWSURFACE7'' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(90) : error C2501: ''lpDDSRes'' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(94) : error C2146: syntax error : missing '';'' before identifier ''lpDI''
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(94) : error C2501: ''LPDIRECTINPUT7'' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(94) : error C2501: ''lpDI'' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(95) : error C2146: syntax error : missing '';'' before identifier ''lpDIKeyboard''
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(95) : error C2501: ''LPDIRECTINPUTDEVICE7'' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(95) : error C2501: ''lpDIKeyboard'' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\myprojects\basecode1\gamemain.cpp(45) : error C2039: ''lpDIKeyboard'' : is not a member of ''__unnamed''
c:\program files\microsoft visual studio\myprojects\basecode1\globals.h(80) : see declaration of ''__unnamed''
c:\program files\microsoft visual studio\myprojects\basecode1\gamemain.cpp(45) : error C2227: left of ''->GetDeviceState'' must point to class/struct/union
c:\program files\microsoft visual studio\myprojects\basecode1\gamemain.cpp(46) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Error executing cl.exe.

GameMain.obj - 21 error(s), 0 warning(s)

I''m not a happy bunny at this. It has a problem with the globals.h file, and possibly a couple others. I have no idea what I''m meant to do about this.
Advertisement
I tried scanning the replies to see if my problem was answered, but since this tutorial was posted a while ago the answers are for programs that I don''t have. I am using Vis. Studio .NET(VC++ 7) and each time I try to build it I get the following errors.

BaseCode1 fatal error LNK1120: 8 unresolved externals
BaseCode1 error LNK2019: unresolved external symbol _DirectDrawCreateEx@16 referenced in function "int __cdecl DD_Init(void)" (?DD_Init@@YAHXZ)
BaseCode1 error LNK2001: unresolved external symbol _IID_IDirectDraw7
BaseCode1 error LNK2001: unresolved external symbol _c_dfDIKeyboard
BaseCode1 error LNK2001: unresolved external symbol _GUID_SysKeyboard
BaseCode1 error LNK2001: unresolved external symbol _IID_IDirectInputDevice7A
BaseCode1 error LNK2019: unresolved external symbol _DirectInputCreateEx@20 referenced in function "int __cdecl DI_Init(void)" (?DI_Init@@YAHXZ)
BaseCode1 error LNK2001: unresolved external symbol _IID_IDirectInput7A
BaseCode1 error LNK2019: unresolved external symbol _DirectSoundCreate@12 referenced in function "int __cdecl DS_Init(void)" (?DS_Init@@YAHXZ)


I am pretty sure this has to do with adding the library files, but since the tutorial was written for a different vis. studio version the layout is different. If anyone could help me with how they included the lib files for the program under the linker settings and how they individually included the "winmm.lib"(which i have) library I would be greatly appreciate, thanks.
I don''t know about VC7, but generally you add libraries in Project Settings->Link->Object/library modules.

You may also do it by adding this in some source file(s) note: non-standard!):
#pragma lib <ddraw.lib>
I tried using the #pragma ways to include the lib files but no luck, thanks for the quick reply but since VC++.net does not have a Project->Settings->Link->Object/library modules section. With VC++.net it is Project->Properties->Linker->General->Additional Library Directories:
I think that is what it is anyways, I have tried including
"C:\Program Files\Microsoft SDK\Lib";C:\MsSdk\lib
into that section but I still get errors. If there are any .net''ers out there who figured out how to include the libraries I''d be a happy person.
quote:Original post by bushido boy
I tried using the #pragma ways to include the lib files but no luck,
It doesn't complain that it cannot find the library?
quote:thanks for the quick reply but since VC++.net does not have a Project->Settings->Link->Object/library modules section. With VC++.net it is Project->Properties->Linker->General->Additional Library Directories:
That is just the paths where libraries are searched. You must find a list where you can add libraries to be linked with your project.
quote:I think that is what it is anyways, I have tried including
"C:\Program Files\Microsoft SDK\Lib";C:\MsSdk\lib
Are the DirectX libraries (eg. ddraw.lib) in any of those directories?

EDIT: Suggestion: read the VC++.NET documentation on how to link with non-standard libraries.

[edited by - CWizard on December 15, 2003 9:23:49 PM]
Thanks alot cwizard for the point in the right direction, for anyone else using VC++ .NET in case they have the same problem I got it to work by going to Project->Properties->Linker->Input->Additional Dependencies and put

WinMM.lib C:\DXVCSDK\LIB\*.lib

into additional dependencies and everything compiled great, once again thanks for the tip.

This topic is closed to new replies.

Advertisement