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 / Errors while trying to compile the first Dark GDK 2.0 project that comes in the chm manual

Author
Message
Juggernaut
7
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 22nd Jul 2012 18:13 Edited at: 22nd Jul 2012 18:14
I am getting the following errors after compiling this code -
I am using Visual Studio 2010

Can anybody help me out. I am struck cold just at the beginning of using Dark GDK 2.0 RC4 that I purchased few days back.



#include <include/darkgdk/core/darkgdk.h>
#include <include/darkgdk/initDarkGDK.h>
#include <include/darkgdk/simpleWindow.h>
#include <windows.h>

using namespace std;

int __stdcall WinMain(HINSTANCE, HINSTANCE, LPSTR, int) {
HWND hWnd;

// Initialize DarkGDK by telling it where the engine dll is
if (!initDarkGDK("gdkengine.dll"))
return 1;

// Create a window
hWnd = openWindow(0, 0, 640, 480, "DarkGDK - Game Developer's Toolkit",
WS_OVERLAPPED | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU |
WS_CLIPCHILDREN, true);

// Attach the DarkGDK screen to the window
dbOpenScreen(hWnd, 0, 0, 640, 480);

// Show the window
ShowWindow(hWnd, SW_SHOW);

do {
// Update the screen
dbSync();
}
while (windowEvent() != WM_CLOSE);

dbCloseScreen();

return 0;
}

{/code]



Error 1 error LNK2019: unresolved external symbol "unsigned int __cdecl windowEvent(void)" (?windowEvent@@YAIXZ) referenced in function _WinMain@16
E:\DARK GDK 2.0\DARK_GDK_2.0_WORKSPACE\my_project\main.obj
my_project

Error 2 error LNK2019: unresolved external symbol "struct HWND__ * __cdecl openWindow(int,int,int,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int,bool)" (?openWindow@@YAPAUHWND__@@HHHHV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H_N@Z) referenced in function _WinMain@16 E:\DARK GDK 2.0\DARK_GDK_2.0_WORKSPACE\my_project\main.obj my_project

Error 3 error LNK2019: unresolved external symbol "bool __cdecl initDarkGDK(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >" (?initDarkGDK@@YA_NV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z) referenced in function _WinMain@16 E:\DARK GDK 2.0\DARK_GDK_2.0_WORKSPACE\my_project\main.obj my_project
Error 4 error LNK1120: 3 unresolved externals E:\DARK GDK 2.0\DARK_GDK_2.0_WORKSPACE\my_project\Debug\my_project.exe my_project


Thanks,
haliop
11
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 22nd Jul 2012 18:56
have you included all files in the project?
Juggernaut
7
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 22nd Jul 2012 19:03
Yes I did - word by word what is written in the chm file. But I am stuck.
haliop
11
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 22nd Jul 2012 19:08
i see... hmm i dont use Visual 2010 so i cant really help. best of luck
Juggernaut
7
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 22nd Jul 2012 19:33 Edited at: 22nd Jul 2012 19:33
Hey Helliop thanks for giving a shoulder. Here is the solution that I found in this thread - http://forum.thegamecreators.com/?m=forum_view&t=198612&b=22

Just add initDarkGDK.cpp and simpleWindow.cpp within your project and alter the include line at the top.

In initDarkGDK.cpp change the

#include <initDarkGDK.h>

at the top to

#include <include/puregdk/initDarkGDK.h>

And in simpleWindow.cpp change the

#include <simpleWindow.h>

line to -

#include <include/puregdk/simpleWindow.h>

Now build the project and the build process will show no error.

Hope this helps who are stuck like me.
haliop
11
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 22nd Jul 2012 19:50
dude!
i asked you if you included all the files you said yes..
so..

glad to know it works!
Juggernaut
7
Years of Service
User Offline
Joined: 12th Mar 2012
Location:
Posted: 22nd Jul 2012 19:55
Likewise ....

Login to post a reply

Server time is: 2019-10-17 03:33:28
Your offset time is: 2019-10-17 03:33:28