Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Multi File Problems

Author
Message
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 12th Sep 2005 17:56
Ok, I've been having a few problems, as I've been transfering from DBPro into the DarkSDK I've had problems with muliple files, I'm using the Microsoft Visual C++ .NET compiler. I've gotten the compiler set up and made some basic programs to test it. However when I've been trying to add a second file to the program with a class and a few global constants, it'll compile fine if I don't use the class, however when I try to make an object of the class it keeps saying that the class doesn't exist and so on and so forth.

I guess the best way to explain would be to show you the files I've been working with, note that the second one is quite long...



and the second:



Thanks!

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 12th Sep 2005 18:29
Do you get something like :

TestDarkSDK.cpp(19) : error C2065: 'DBSDKgeneralInput' : undeclared identifier
TestDarkSDK.cpp(19) : error C2146: syntax error : missing ';' before identifier 'UIN'
TestDarkSDK.cpp(19) : error C2065: 'UIN' : undeclared identifier
TestDarkSDK.cpp(38) : error C2228: left of '.keyJustReleased' must have class/struct/union type
type is ''unknown-type''
TestDarkSDK.cpp(38) : error C2065: 'C_UPKEY' : undeclared identifier
TestDarkSDK.cpp(38) : error C3861: 'UIN': identifier not found, even with argument-dependent lookup
TestDarkSDK.cpp(39) : error C2228: left of '.keyJustReleased' must have class/struct/union type
type is ''unknown-type''
TestDarkSDK.cpp(39) : error C2065: 'C_DOWNKEY' : undeclared identifier
TestDarkSDK.cpp(39) : error C3861: 'UIN': identifier not found, even with argument-dependent lookup
TestDarkSDK.cpp(42) : error C2228: left of '.update' must have class/struct/union type
type is ''unknown-type''
TestDarkSDK.cpp(42) : error C3861: 'UIN': identifier not found, even with argument-dependent lookup
Generating Code...

Build log was saved at "file://c:\PlasWare\vstudio\TestDarkSDK\Release\BuildLog.htm"
TestDarkSDK - 11 error(s), 0 warning(s)

If so, then you need to create a header with the class prototypes, otherwise the compiler has nothing to reference.

Come to the third DarkBasic Pro Sci Fi Con - Be there and be square
Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Sep 2005 19:57 Edited at: 12th Sep 2005 20:19
What he means is put this code:



... into a file called something like DBSDKgeneralInput.h, and then add an include to this file in your main source file. [EDIT] ... and into your .cpp file too of course.

Basically, you put the declarations (ie, non-storage stuff) you want to be publically available into header files, and all private stuff (code, hidden variables) into a cpp file.

Constant variable declarations are a funny case ... they don't generally have storage assigned to them unless you take their address.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 13th Sep 2005 01:07 Edited at: 13th Sep 2005 03:39
@Bouncy Brick - yes thats about the size of the errors

@IanM - did that...

Now my problem is that the compiler can't find the header file anywhere, I tried puting it in the "header" folder of the project manager (commenting out the references to it in the source file) that didn't work so I uncommented out the references, still got an error.
Anyways the two errors that I keep getting are:
fatal error C1083: Cannot open include file: 'DBSDKgeneralInputHeader.h': No such file or directory
fatal error C1083: Cannot open include file: 'DBSDKgeneralInputHeader.h': No such file or directory

I'm kinda at a loss as what to do now since it doesn't seem to be recognizing the header files.

Again I'm using the Microsoft Visual C++ .NET compiler.

Thanks for the help,

CPU

--[edit]--
As it turns out I did some research and found that I was using the <file.h> brackets to specify the file, when in fact what I realy needed to do was to put the filename in quotes "file.h" so the compiler knew to look in the directory of the main CPP file... I'm such an idiot...

Thanks for your help!

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Sep 2005 15:19
... I was just about to say that

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
miko
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: Germany
Posted: 8th Oct 2005 18:59
Not exactly on topic, but:

Are there any advantages in using e.g.
instead of a
? I found them both working. So, is it just a matter of taste?

Login to post a reply

Server time is: 2024-11-19 02:40:26
Your offset time is: 2024-11-19 02:40:26