Program crash before main(), in some other lib

Started by
37 comments, last by Raduprv 19 years, 2 months ago
Yep, it was.

We will have 1.0.1 ready for release hopefully tomorrow. In the mean-time if you want to run the application with the CVS version you can get:

http://wytter.tfm.ro/elc/rules.xml
And put it in ./languages/en/

Furthermore you'll need the e3dlist.txt in your ./. To move the knowledge.lst to ./languages/en/ and to move the Encyclopedia to ./languages/en/

http://wytter.tfm.ro/elc/paper1.bmp
http://wytter.tfm.ro/elc/gamebuttons2.bmp
And put it in ./textures/

http://www.eternal-lands.com/misc/legend.bmp
http://www.eternal-lands.com/misc/seridia.zip (remember unzipping)
And put them in ./maps/
Nemo enim fere saltat sobrius, nisi forte insanit.
Advertisement
It works now, thanks, and I have WinXP, so I guess the bug somehow doesn't affect my system.

Btw, when I make changes to the client graphics engine, that can't affect other players, right? Since we were talking with Raduprv about me helping you out with bone animation, I played a little with the code. I just made the players look like giants, and launched the client. I immediately got a PM from a member saying "lol, what's wrong?".
Nah, they can't see anything in their client. It's probably just because you logged out and in again a few times.

Btw, here's a cal3d model of a Chimeran Mountain Wolf (a strong monster in-game): no-exit.org/cal3dtest.zip
Nemo enim fere saltat sobrius, nisi forte insanit.
Quote:Original post by Wytter
Okay, we think that we have identified the problem.
Windows 2000 and Windows XP command line parameters are converted in the APIENTRY, but it crashes in Win98 if they are converted...
First, you seem to be failing to deallocate the memory used by CommandLineToArgvW:
Quote:From GetCommandLineW
It is the caller's responsibility to free the memory used by the argument list when it is no longer needed. To free the memory, use a single call to the GlobalFree function.

So...
#ifdef WINDOWSint APIENTRY WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow){        LPWSTR *argv;        int     argc, i;        char **targv;        argv = CommandLineToArgvW(GetCommandLineW(), &argc);        ...        // once we're done with argv        GlobalFree(argv);        ...        return 0;}#endif


Quote:Now we just have to come up with a way to do run-time detection of whether the OS uses Wide-chars or not...
Just install the Microsoft Layer for Unicode for Windows 95/98/ME in your program directory (it's a single DLL). See Compiling Your Application with the Microsoft Layer for Unicode.
Quote:Will Windows load a .dll if it already has a "similiar" one in memory or $WINDIR/system32/?

Yes, this is annoying. Check the search order in the LoadLibrary dox.

What I don't understand is why ya'll need the WinMain - any reason not to let the CRT startup code convert argv? You can set entry point to [w]mainCRTStartup and run from main() on all platforms.
E8 17 00 42 CE DC D2 DC E4 EA C4 40 CA DA C2 D8 CC 40 CA D0 E8 40E0 CA CA 96 5B B0 16 50 D7 D4 02 B2 02 86 E2 CD 21 58 48 79 F2 C3
WinMain is needed because DevCPP linker bitches about some missing stuff if WinMain is not there.
Ok, some update.. we removed ALL the command line code, for some testing...
el.exe[enter]->crash
el.exe ddfsf[enter]->crash
el.exe xfgdff sdfsdf[enter]->works
The crash is the same crash, libxml2.dll
I repeat, there is ABSOLUTELY no code that process, or even CHECK the command line. None, nada, zip.
This is very very strange....
[update]
This two command line argument works only in XP, it still crashes in 98....
I guess I'll try to find someone with VC and compile the god damn thing in VC, see if it works. It might be a compiler bug.
I would be interested to hear the result of your tests, so please update us :). I'm just very sceptical about it being a compiler or OS problem. You can get nasty problems if you muck about with wrong DLL versions and such.

cheers
sam.
Quote:Original post by izzo
I would be interested to hear the result of your tests, so please update us :). I'm just very sceptical about it being a compiler or OS problem. You can get nasty problems if you muck about with wrong DLL versions and such.

cheers
sam.


I was linking with the right lib and dll (same version)...
Ok, I promised I'll post when we fix this problem.
Basically, the problem with Win98 computers was what Wytter said.
On XP, well, there were two problems. One was with an iconv function that was eventually rewritten by Wytter. The other problem, I have no idea what it was, perhaps a bug in GDB that reported some inexistent problems.
But after we fixed those two problems I mentioned it worked fine...

This topic is closed to new replies.

Advertisement