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 / DarkGDK - Mixing with managed code (.NET)

Author
Message
jjg
16
Years of Service
User Offline
Joined: 16th Feb 2008
Location: Rockwall, TX
Posted: 16th Feb 2008 23:10
Hi There,

I would like to wrap the DarkGDK functions into a .NET dll using the .NET extensions for C++. My goal is to create an OO framework around GDK and expose it via .NET for my use. I have done work like this in the past so I'm hoping to do the same here. Right now I'm having a linker issue I was hoping someone could help me with. Here is the error:

2>core.lib(DBDLLCore.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj)

Here is my simple object I created to test compilation:



I'm assuming DarkGDK defines an entry point somewhere that is conflicting with my DLLs entry point? I was hoping someone might have an idea about how to fix this.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 16th Feb 2008 23:53
its already been done, its called DGDK.NET
re-releasing soon

[href]mod2software[/href]
jjg
16
Years of Service
User Offline
Joined: 16th Feb 2008
Location: Rockwall, TX
Posted: 17th Feb 2008 00:10
Yes, I'm aware of GDK.NET. However, I would like to resolve these linker errors so I can move forward with my project. I'm not writing a general purpose OO wrapper. This is unique to my project.

Do you have any suggestions about how to get around the linker errors?
jjg
16
Years of Service
User Offline
Joined: 16th Feb 2008
Location: Rockwall, TX
Posted: 17th Feb 2008 01:45
I fixed the compilation issue but now there are other issues.

Is it even possible to call DarkGDK from a win32 dll? Forget .NET for now, I just want to seperate my client code from my engine code. For example, i would like the engine code in a dll (.NET or Win32) and my client code in a Win32 application. However, it looks like the LoopGDK requires a WinMain method, which kills using a dll. Is there a way around this? Does anyone have any suggestions on makeing calls to the engine from a dll rather than using main from a console app?
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 17th Feb 2008 14:32
I think you will have issues here because 1: DarkGDK is deigned to not allow you to turn the lib into a DLL - it needs the DarkGDK main integrated or no go.

.Net has a different "deploy-no-hack" paradigm... so - back to Cattle Rustler's comment - he's dead on due to reasons like this.

Now Calling .Net code from with DarkGDK - that's another story. Personally - I try to keep my technology thunking to a minimum - KISS principle - if I'm writing DarkGDK stuff - I use C++ only. If I was to use DarkGDK.net - then I'd be in C# heaven 100% - THUNKING usually means loss of efficiency and speed bro.

Look up Thunking DLL via Google to see why I use this word - it has many meanings but in short - means to FORCE 2 incompatible systems to work.

Login to post a reply

Server time is: 2024-10-08 11:32:32
Your offset time is: 2024-10-08 11:32:32