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 / Hello World tutorial sample code does not compile

Author
Message
lbjvg
16
Years of Service
User Offline
Joined: 27th Apr 2008
Location:
Posted: 27th Apr 2008 21:14
Hi - I have just installed Visual C++ and Dark GDK and am pretty sure the installation is correct.

I am reading thru the Hello World tutorial and can't get some of the code examples to compile.

This code compiles and runs as expected:
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbLoadImage ( "animatedsprite.png", 1 );
dbSprite ( 1, 0, 0, 1 );
while ( LoopGDK ( ) )
{
dbSync ( );
}
return;
}


But this code does not:
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbCreateAnimatedSprite ( 1, “animatedsprite.png”, 4, 4, 1 );
dbSprite ( 1, 0, 0, 1 );
while ( LoopGDK ( ) )
{
dbSync ( );
}
return;
}

Thanks - JV Gallagher
Norman
16
Years of Service
User Offline
Joined: 20th Apr 2008
Location:
Posted: 27th Apr 2008 21:34
Compiled fine for me, what error does it give you?
r3n
16
Years of Service
User Offline
Joined: 27th Apr 2008
Location:
Posted: 27th Apr 2008 22:04
I had the same problem earlier today.
It was because I copy/pasted the example from the tutorial pdf.
Seem that the " "'s surrounding animatedsprite.png are odd.
Delete and replace them and that was it for me.
Hope it helps
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 27th Apr 2008 22:11
We get these kinds of posts alot, and some people have installations troubles they weren't aware of, others simply aren't aware the directories are off by one. (Add a dbSetDir("..") to them all and the media is found) Sometimes the references to DarkGDK don't get set up how they were supposed to, sometimes it depends on the order of how you installed it etc.

What kind of errors you getting specifically? Like in the Error list... Ouput Window thingy?

Also... search this forum for "linker error" and "linking error" to see some stuff that might be along the lines of your issue.

DarkGDK is awesome once you get past the initial "ouch" of set up. I had to uninstall EVERYTHING... I MEAN DirectX SDK, DirectX, DarkGDK, Visual Studio, etc etc... the first time, 2nd time through worked like a charm.. though I still needed to add this line to my demo apps: dbSetDir("..") (They got the media only one measly directory level off... simple.. but a newb wis like WTF! LOL Good Luck!)

Stephen Young
16
Years of Service
User Offline
Joined: 23rd Feb 2008
Location: UK
Posted: 27th Apr 2008 22:54
dbCreateAnimatedSprite ( 1, “animatedsprite.png”, 4, 4, 1 );

there i think, try

dbCreateAnimatedSprite ( 1, "animatedsprite.png", 4, 4, 1 );

it was those dodgey " " marks that .pdf's give you, thank you adobe =\
lbjvg
16
Years of Service
User Offline
Joined: 27th Apr 2008
Location:
Posted: 27th Apr 2008 23:14
Thanks everyone for your prompt replies.

The culprit was the slanted "'s as r3n and Steven Young suspected. The "'s in the first block of code happen to be ok. The "'s around the second block are slanted. So I also learned that the filename turns red when it is properly quoted.

Thanks again!

- JV Gallagher
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 28th Apr 2008 01:54
I hate adobe. I use the FoxIt Reader now... TINY compared to A(huge)dobe.

Login to post a reply

Server time is: 2024-09-29 19:26:03
Your offset time is: 2024-09-29 19:26:03