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 / how does one create a .lib or .dll that uses dark gdk?

Author
Message
bloodmage2
15
Years of Service
User Offline
Joined: 14th Jun 2009
Location:
Posted: 4th Jul 2010 23:31
hello. i have been able to create .lib files and .dll files that use just the core c++ language, and reference them fine. as soon as i bring darkgdk into the mix, it all falls apart. here are the methods i have tried to make this work:

1: create a basic darkgdk game using a wizard, then change the output type to .lib/.dll, as well as the various other settings
problem: the including file has no problems, the library files cannot seem to find any darkgdk functions
2: create a .lib using the many tutorials on the internet, then change the ignored libraries to that of a darkgdk file.
problems: very low level libraries become unresolved, no combination of ignored libraries fixes the problem.
3: create an empty project, add a .h and .cpp, then copy all properties from a working darkgdk file (sans output type).
problems: the main darkgdk function needs to be defined, an as this is not an application, defining it would override any definition in the including code.

what do i do? i have completely run out of ideas!

-to the optimist, the glass is half full. to the pessimist, it is half empty, to the engineer, it is twice as big as it needs to be.
http://www.lionsbloodstudios.justinman.net/index.htm
Bran flakes91093
15
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 5th Jul 2010 00:11
What errors are you getting?
Do you get errors when building or when trying to include the lib?

“C++ : Where friends have access to your private members.”
-Gavin Russell Baker
bloodmage2
15
Years of Service
User Offline
Joined: 14th Jun 2009
Location:
Posted: 5th Jul 2010 00:17
i do beleive i made it quite clear, but ill put them again"

1st method: unresolved symbol "any dark gdk function here" referenced in "my function here" (x100)
2nd method: "some library" conflicts with "other library", upon ignoring one: unresolved symbol "some function name i cannot make out" referenced in "my function"
3rd method: unresolved symbol "DarkGDK()" referenced in _WinMain@16

-to the optimist, the glass is half full. to the pessimist, it is half empty, to the engineer, it is twice as big as it needs to be.
http://www.lionsbloodstudios.justinman.net/index.htm
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 5th Jul 2010 00:37
First off, you can't make a DLL that uses the GDK. It will *not* work! This is because the global objects of the GDK itself will be contained within the EXE file *and* the DLL file that you are trying to create.

Second, when creating a .LIB file, you can't use any of the debug runtimes (just like in a GDK program) you have to use the /MT compiler setting and not the /MTD.

In short, when creating a .LIB file, you have to use the same compiler settings as GDK programs if you plan on using it with the GDK itself.

I hope this helps,

JTK
bloodmage2
15
Years of Service
User Offline
Joined: 14th Jun 2009
Location:
Posted: 5th Jul 2010 00:42 Edited at: 5th Jul 2010 01:21
i changed it to /MT, and i still have _WinMain@16 unresolved in __tmainCRTStartup.

-to the optimist, the glass is half full. to the pessimist, it is half empty, to the engineer, it is twice as big as it needs to be.
http://www.lionsbloodstudios.justinman.net/index.htm
bloodmage2
15
Years of Service
User Offline
Joined: 14th Jun 2009
Location:
Posted: 6th Jul 2010 19:37
ok solved that problem, but now i have _invoke_watson multiply defined, and ignoring the either and both libraries that conflict result in 20 or more instances of undefined symbols

-to the optimist, the glass is half full. to the pessimist, it is half empty, to the engineer, it is twice as big as it needs to be.
http://www.lionsbloodstudios.justinman.net/index.htm
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 6th Jul 2010 23:04
Copy the linker and runtime library settings directly from a working DarkGDK program to the .lib project.

[b]
bloodmage2
15
Years of Service
User Offline
Joined: 14th Jun 2009
Location:
Posted: 8th Jul 2010 17:17
you see, i had already done that, so i was wondering. anyways, i finally fixed it, and it works fine now. thanks for all the help.

-to the optimist, the glass is half full. to the pessimist, it is half empty, to the engineer, it is twice as big as it needs to be.
http://www.lionsbloodstudios.justinman.net/index.htm

Login to post a reply

Server time is: 2024-07-04 09:35:10
Your offset time is: 2024-07-04 09:35:10