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 / LNK4098 and LNK2019 in VC++ 2008

Author
Message
ronin
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 13th Jan 2008 20:44
Hi,
I'm a bit new to the environment but I managed after tweaking a little here and there to have a basic Dark GDK project running without trouble and wizards working too.

Now I'm trying a bigger project myself but I find a warning that apparently comes out from time to time (have read in other threads here and in other forums), but also I find 2 errors that came out due to the use of "malloc" and "free", I have read a lot of solutions about linking to some other lib (msvcrt.lib and msvcrtd.lib) but since the configuration for the Dark GDK involves also some of those I can't fix the issue the same way others did using some other sdk.

Here are the warning and errors I had:


I know I can live with the warning but I post the whole list since maybe they are related, as I said I'm not an expert into this
Any help or suggestions are welcome, thanks in advance
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 13th Jan 2008 21:21
Check out the thread I've started here:

http://forum.thegamecreators.com/?m=forum_view&t=121186&b=22
ronin
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 14th Jan 2008 01:33
Thank you for the quick reply and the great explanation you give in the thread my knowledge into all this has enhaced, and I even managed to compile and link, but... unfortunatelly I can't still get it to work properly, so I have to ask you one more thing...

After reading all the material you wrote down the other thread I understood that I should make some changes, and after a few trial and error I switched the main option from debug to release and after that it built the solution successfully but then the program crashes and its a crash with one of those messages "The application has crashed and now will close" with "send error message" and "don't send error message" options, I think you get the idea of what happened, so my question is, even though it went through the entire compile/link process with success could it be wrongly built? sorry if I'm asking too silly question here but the fact is the code worked perfect in a previous version so I know there is no syntax or inner bugs/errors
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 14th Jan 2008 09:54
Quote: "even though it went through the entire compile/link process with success could it be wrongly built?"


Yes, that is possible, but not likely. Do you use C runtime in static library or the DLL version? Does it hang before it actually starts any of your code or can you find a location where it hangs?
ronin
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 14th Jan 2008 15:16 Edited at: 14th Jan 2008 15:32
I'm using the multi threaded (/MT) configuration, I think this is the configuration that should be used, or at least the configuration that worked for more simple projects, additionally I have tried both debug and release modes and in both it crashes.

I can say that it crashes before doing anything since as far as I know the DarkGDK() is the main entry point so before that anything is actually done, right? not feeling sure of anything here, sorry, well the fact is a single instruction placed just at the beginning of the DarkGDK is not executed correctly, and I have classes and a couple of global objects but they are not calling anything related to the GDK (I know that use to make it crash), also I managed to get rid of al the include files I used there before, but I know that as you said in the other thread there are those common functions that the environment know and know where to find by default... well I'm just trying to simplify this

Edit: Sorry just to clarify it a bit, all this code I'm trying to run here was done in VC++ 6 and with a previous version of the GDK back when it was called DarkSDK and I think it used freeware version (wasn't my license or my computer but a friend's)
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 14th Jan 2008 15:53
So if you try to debug the code (build Debug version and hit F5), it crashes before entering your main function? That sounds like some missing library, but since you link runtime statically and it links correctly I doubt there's anything missing. If you can pack it up and post here, I could take a look at it.
ronin
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 14th Jan 2008 17:31
Well this is quite strange but I guess we are reaching a point, I tried as you said building the debug version and then running the debug, and surprisingly here it reaches the title screen (100% 2d) without trouble, and I can even acces help screen which is 2d as well, but moving to any other game mode where 3d is involved means a crash, so maybe... is there any lib missing? I mean anything related to the 3d thats not included or something? could it be like that? I have no idea, just making a guess.
Here I show you the result of the debug window, as you can see it says many things about d3d9... of course I have no idea what that could mean or how to solve it, sorry for my ignorance and bad quality of capture (I'm running a fresh installation due to this and I have like 0 tools for media editing or anything).
Oh also it says there is no piece of source associated to the error so it only allows me to dissassemble it and check the asm

Attachments

Login to view attachments
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 14th Jan 2008 18:30
So it's in D3D... can you place here the whole call stack? Not just those last three lines. If you scroll down you will find from which function the specified D3D call is made, which is probably some GDK function, and scrolling lower even more you will see what GDK call it is and where you make it. By the way, even if there's no debug info available for D3D, you can double click on an item in this call stack (some your function) and VS will take you on the line where the troubled call is made.
ronin
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 15th Jan 2008 01:29
Well after quite some hours fighting this (and not the first day into all this) we have managed a little step forward. I saw that in the debugger there were calls to something like a function used to texture mesh surface in d3d (now can't reproduce exact call sorry), so I started watching the few calls to texture object function I had in my code, I got rid of one that I saw was causing the crash by no special reason, it was texturing an object with a previously loaded texture so no special stuff... well the fact is after supressing that call I managed to see the 3d parts of the program, but I find 2 remaining troubles here... Even though I can run the 3d part in debug mode every time I switch to release and build the solution again and run, it just crashes like before without even entering the title screen... so I asume something is still wrong but I can't see why is that so.

I have also another problem with that, while in debug mode and in the 3d part of the program I have a plain object textured and ghosted, the texture is anything strange and the plain isn't too close to any surface but still I get a problem there, when seeing the plane from certain angles it switches from the textured and ghosted to a white plane object untextured like when its created, could this still be related to all that?
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 15th Jan 2008 08:31
I can't tell you much more without actually trying it (can you pack it and post here?). The problem could be related, who knows. Anyway, problems occuring in release mode only are often very hard to solve.
Since in debug mode it crashes in some D3D call, it's very likely it actually does something in release mode too, so try to locate the error - create text outputs to a file here and there and you will find the location.
ronin
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 15th Jan 2008 13:58
Well it finally isn't crashing in debug mode as far as I have tested it, the fact is the plain object still do the same thing getting back to its original untextured state, but is my guess that its a GDK bug ¿?, I don't know, well also as it didn't crash in debug mode, shouldn't I be able to run it under release mode? I just switch in the main window from debug to release and then build it, I guess its the way to do that, or am I wrong? well in that mode it just crashes in the very beginning, so I think that maybe is due to a mistake I made, there shouldn't be much difference between the two version as I understand them
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 15th Jan 2008 14:21
There can be many differences due to your project settings. As I said before - try to locate the problem - write some text to a file on various places in your code (especially on the first line so you know that it starts at all). There can also be some library missing (you would be able to discover that with Dependency Walker).
ronin
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 15th Jan 2008 17:25
The project itself is standard created with the wizard, the code has no additional includes as I managed to get rid of the few I had

As for the plain object I guess it could be a bug since I'm not the only one spotting this:

http://forum.thegamecreators.com/?m=forum_view&t=121004&b=22

The text file I'm creating it but first I need to know, am I creating the release the correct way? I run it either way pushing on the arrow or running the exe from its folder after the build has succeded
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 15th Jan 2008 17:46
Quote: "The text file I'm creating it but first I need to know, am I creating the release the correct way? I run it either way pushing on the arrow or running the exe from its folder after the build has succeded"


First step is running it from Visual Studio (less prone to missing libraries or paths problems), that you do by clicking on "Start Without Debugging" command in Debug menu (or Ctrl+F5 by default; the green arrow is used for debugging).
ronin
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 15th Jan 2008 20:43
But the only change I need to do is to switch from debug to release in the main window toolbar, is that correct? I mean there is no additional change that should be done for that, I tend to do more inner changes in VS 6 as I remember when switching from one mode to the other... well not really more changes but the option was deep inside or at least in the configuration I was using
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 15th Jan 2008 21:18
Quote: "But the only change I need to do is to switch from debug to release in the main window toolbar, is that correct?"


yes

Login to post a reply

Server time is: 2024-11-17 03:04:39
Your offset time is: 2024-11-17 03:04:39