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 / Help with "Hello World"

Author
Message
The Goat Ass!
20
Years of Service
User Offline
Joined: 30th Sep 2002
Location:
Posted: 1st Jun 2005 12:34
I have just recently purchased the DB-SDK and wanted to get a simple hello world app going... I'm familiar with DB-Pro but am having a hullva time getting this simple test case to work with the SDK. I'm sure its because I'm new to VisualStudio

Could anyone maybe give me a hand with this pathetic request?

Thanks,

-dylan
Mike Johnson
TGC Developer
20
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 1st Jun 2005 18:00
Can you compile any of the sample applications? Do you get any errors when attempting to compile and if so what are they?
IanM
Retired Moderator
20
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Jun 2005 21:22
If you have the correct settings for the include file and library file locations, then the following code will do the 'Hello World' thing.



Let us know what errors (if any) that you get.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
Bernard
17
Years of Service
User Offline
Joined: 2nd Jun 2005
Location: Belgium
Posted: 2nd Jun 2005 17:41
I'm sorry, but doesn't a valid C++ code need a main function in order to run?

like this:
The Goat Ass!
20
Years of Service
User Offline
Joined: 30th Sep 2002
Location:
Posted: 3rd Jun 2005 00:09
Thanks for the posts...

My problem was that VS-03 adds a ton of uneccesary files if you don't tell it to make an "empty" project

Once I did that, all was happier in the world -- Thanks!

I have notice though that some of the examples that came with the SDK don't actually compile.?...I've loaded the 1.1 patch for libs and include.

Thanks again!
Smithy
18
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 3rd Jun 2005 16:38
@Bernard
You are right,... and the main() is there!!!
Its hidden from you, like the WinMain(), but it's there
(hidden means, its under the framework)
If you learn about how c++/Windows etc works, you will see why you don't need to code a main like you did in your code snippet.

--smithy

//Awards: Best DM at NeverwinterConventionIII (NWCon3)
//Sys: Pentium IV 3200E/Prescott;800Mhz FSB;HT;WinXPPro;ATIR9700PRO;1024MB RAM(2x512MB"DualChanneled";VC++7.net;Delphi6;ADSL512;
Bernard
17
Years of Service
User Offline
Joined: 2nd Jun 2005
Location: Belgium
Posted: 3rd Jun 2005 16:57
Oh lol those crappy unofficial micro$oft 'standards'... and never heard of a 'WinMain()'. I guess that won't compile if you use the GNU C compiler (gcc/g++) under emacs, as I do.

I prefer to write ISO C++... Then I can port my programs to any environement more easily... (unless when using darksdk there should be a unix port to support linux and mac os).

Anyway, I hope DarkSDK will work with emacs, coz I'm planning to buy it after my exams.

About the code snippet; what will happen if you add another function/procedure? Will the M$ compiler run them in the order that they're in the code? Or is it because the function has the same name als the library that it's interpreted as a main() function?
OSX Using Happy Dude
19
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 3rd Jun 2005 18:37
Quote: "About the code snippet; what will happen if you add another function/procedure?"

Its functions in C - Procedures are only used in BASIC and Pascal. Anyway, new functions get compiled in.

Quote: "Will the M$ compiler run them in the order that they're in the code?"

It will run them in the order that you call them.

Quote: "I prefer to write ISO C++... Then I can port my programs to any environement more easily..."

DarkSDK is only for Windows, and thus only uses Windows products.

Quote: "Anyway, I hope DarkSDK will work with emacs, coz I'm planning to buy it after my exams.
"

See above, and : You need to use Visual Studio

Bernard
17
Years of Service
User Offline
Joined: 2nd Jun 2005
Location: Belgium
Posted: 4th Jun 2005 00:02
Quote: "Its functions in C - Procedures are only used in BASIC and Pascal. Anyway, new functions get compiled in."

It's just a matter of terminology. What they taught us over here (about C++) is that functions have a return value, where procedures have no return value (type void). It's true that not everyone uses that terminology (they also told us that).

Quote: "Quote: "Will the M$ compiler run them in the order that they're in the code?"
It will run them in the order that you call them."

But I was wondering how they will be run if they are not called (if there is no main function).

Quote: "DarkSDK is only for Windows, and thus only uses Windows products"

GNU Emacs is a windows product. The g++ is a windows product.
I don't think it's a such big deal to make the Dark SDK library code conform to the C++ conventions, while it will make the requirements for your customers smaller. Then it will be working for any compiler/IDE under the Windows environement, and we'll be able to choose our own taste of developing environement (some compilers are better at optimizing, some IDE's have better text indention, etc.).

Since this post is going a lil off-topic it could be split by a moderator. Sorry for this, I was just curious about the code snippet.

in 2002-2003 I used to be active here under the name 'freak'

Login to post a reply

Server time is: 2023-02-06 18:31:47
Your offset time is: 2023-02-06 18:31:47