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 / Is LoopGDK() Required

Author
Message
handlez36
7
Years of Service
User Offline
Joined: 25th Jan 2012
Location:
Posted: 25th Jan 2012 20:29
Hi, I have just started learning the Dark GDK in a college course. We played around with some very small code samples using Visual C++ 2008 Express and Dark GDK. One program excluded the "LoopGDK()" function call, but drew a few images on the screen and changed their location. This worked on the college machine, but is not working on mine. I get the

"LINK : fatal error LNK1561: entry point must be defined" error.

I thought the entry point was simply the "void DarkGDK(void)" function itself.

I have Visual C++ 2010, and other than that, the only difference in setup I can see is...

- I am running on Windows 7, where we were using Windows XP in the course
- I have the August 2007 version of DirectX installed. I assume the college does too, but they may have the October version (or some other version) running.

I can post the exact code if that helps, but more generally is the LoopGDK() function call required for only certain Visual Express/DarkGDK/DirectX setups, or for all? Obviously, it cannot be all if I was able to run a program without, so I'm curious of what aspects of the DarkGDK setup require that loop and which do not.
Hawkblood
10
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 25th Jan 2012 21:17
You need either void DarkGDK ( void ) or void main(void) as your entry point in your Main.cpp

LoopGDK() is a function that (at least) returns a 1 unless the ESC key is pressed. I don't think anything else is handled in it.

The fastest code is the code never written.
handlez36
7
Years of Service
User Offline
Joined: 25th Jan 2012
Location:
Posted: 25th Jan 2012 22:39
Thanks for the quick response. Do you see any reason why the following small code sample would produce the "entry point must be defined" erorr...

#include "DarkGDK.h"

void DarkGDK( void )
{
int x = 300;
int y = 50;
int distance = 300;

dbSetImageColorKey(0, 255, 0);
dbLoadImage("lunar surface.bmp", 1);
dbLoadImage("Rocket.bmp", 2);

for(int cnt = 0;cnt < 5;cnt++){
dbPasteImage(1, 0, 0, 0);
dbPasteImage(2, x, y, 1);

distance = distance/2;
y += distance;

dbWaitKey();
}

dbPasteImage(1, 0, 0, 0);
dbPasteImage(2, x, y, 1);

dbWaitKey();
}

Thanks.
Hawkblood
10
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 25th Jan 2012 23:48
You most likely don't have your compiler set up correctly.
Go to this page and follow the video instructions:
http://www.thegamecreators.com/?m=view_product&id=2128

The fastest code is the code never written.
handlez36
7
Years of Service
User Offline
Joined: 25th Jan 2012
Location:
Posted: 26th Jan 2012 00:58
Yea, that would make sense, I just can't find the compiler settings that are causing it. I've viewed the link you posted and other video tutorials for setting things up...the only thing that differs in them all is the fact that I'm running Visual Express 2010 vs 2008. Maybe there's a new default value that's affecting me in 2010.

Thanks for your help!
Hawkblood
10
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 26th Jan 2012 02:58
Perhapse. I'm using VS2008.

The fastest code is the code never written.
Noley
8
Years of Service
User Offline
Joined: 13th Dec 2010
Location:
Posted: 26th Jan 2012 06:40 Edited at: 26th Jan 2012 06:43
There is a video which very specifically details installing Dark GDK for Visual C++ 2010, which I am also using, on this computer.

There is a thread on the forum somewhere about it, it links to this video:
http://www.youtube.com/watch?v=Zua3wnBfTlg

^^Complete audio/video walk-through installing GDK+ visual C++ 2010.
The includes you will need to adjust in your 2010 are in the video description.

Good luck ^_^

Let me know how it all goes (:
handlez36
7
Years of Service
User Offline
Joined: 25th Jan 2012
Location:
Posted: 26th Jan 2012 14:48
Thanks Noley. That was the first video I followed to get everything up and running. So I can compile and run DarkGDK programs with Visual C++ 2010 only when the LoopGDK() function is in the code. Whenever I take it out, the compiler complains of not having the main entry point.

I installed Visual C++ 2008 yesterday, went through the config steps and the programs work on that without the LoopGDK() function...same exact code. I'm starting to think there are some different default configurations for the 2010 and 2008 compilers which is causing this (similar to what Hawkblood mentioned). Probably an easy fix...just have to find it.

Anyway, I'm fine with using 2008 for now. The wizards also work for 2008, which have been a hassle to try to get working for 2010.

Thanks!
Hassan
10
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 26th Jan 2012 15:16 Edited at: 26th Jan 2012 15:16
LoopGDK is required to update the window holding your game, this includes mouse actions and keyboard input, re-sizing and etc., probably a couple of code based around PeekMessage.

though, your problem is as stated above, wrong setup, you will have hard time trying to get GDK to work with VS2010 so save yourself alot of time, which might not lead to success, and get 2008

Login to post a reply

Server time is: 2019-12-13 20:32:29
Your offset time is: 2019-12-13 20:32:29