Page 1 of 1

MSVC

Posted: Sun Nov 18, 2001 6:54 pm
by Aussie Dragon
How do you compile exult with the Microsoft Visual C++ compiler?
As the project files in msvcstuff do not work for me as they crash my compiler.

Re: MSVC

Posted: Mon Nov 19, 2001 3:19 am
by Colourless
What version of MSVC are you using? Also, what do you mean by crash?

-Colourless Dragon

Re: MSVC

Posted: Tue Nov 20, 2001 9:25 pm
by Aussie Dragon
I should of said it crashes the IDE(I am using MSVC 6.0).

Well I managed to open the project by only opening the exult.dsw, if you try to open any of the .dsp files the IDE crashes.

With a bit of tinkering I managed to get exult(by itself) to compile, but it fails to link.
And i get

LINK : error LNK2001: unresolved external symbol _mainCRTStartup

I don't know what this means.

And I also can't compile expack and I get the error

Build : warning : failed to (or don't know how to) build 'C:\temp\exult\tools\expack.exe'

Maybe someone should update the README.win32 file to show how to compile with MSVC.

Any help would be welcome

Re: MSVC

Posted: Tue Nov 20, 2001 11:43 pm
by Dominus
Yes, I think Colourless needs to put some info into the readme.win32 on what you need to compile Exult with MSVC. You need sdl and zlib and that´s where it failed on you (probably)...

Re: MSVC

Posted: Wed Nov 21, 2001 1:25 am
by Max aka Moscow Dragon
I suggest NOT to use MSVC IDE and .DSP for Exult.

For me (and MSVC editor + BUILD tool are my primary tools) - .DSPs are only from projects generated by MSVC wizards like MFC or ATL.

I do not like using .DSP for manually created projects. Why not use good old .MAK? NMAKE from MSVC is 95% same as GNU make.

So - if you want the thing to be built by MSVC compiler - then yes, but not from IDE. Run NMAKE from command line.

Re: MSVC

Posted: Wed Nov 21, 2001 1:33 am
by Xane
Whenever i open one of the .dsp with MSVC 6.0 it just remarks the finding of an adequate .dsw and opens that instead.
Just an attention message, but no crash, so maybe your MSVC itself is not feeling well?

It seems to me, with a little time you can figure it all out, but a little MSVC guidance would really be nice to give a start.

Re: MSVC

Posted: Wed Nov 21, 2001 1:53 am
by Xane
Why not use the Compile Button? Is the compiled to slow?
Anyway, im sure you use the IDE with plain NMAKE, if you make yourself some nice little macros.

Re: MSVC

Posted: Wed Nov 21, 2001 6:46 am
by Colourless
Ok, the crash is being caused by MSVC screwing up because it cant find all the projects or something. It was happening to me too when I attempted to load the source snapshot.

Anyway, don't manually load the individual Project DSP files. You'll get missing headers. What you need to do is "File->Open Workspace" and then choose Exult.dsw from the msvcstuff dir. That's it and you should be ok to go. Then choose the Exult project using the Win32 Debug or Win32 Release configuration. The usage of the Install configurations is documented in the now update README.win32.

You will also need to SDL and ZLib and include them in MSVCs Search Paths (Tools->Options->Directories->Include Files and Library Files).

I personally use MSVC6.0 to edit, compile and debug Exult.

NOTE: The current snapshots wont compile as one project is missing. Additionally, one of the others files had Unix style lines breaks in the source zip. Also the Workspace had an extra project that wasn't meant to be there. This has all now been fixed in CVS.

So, you will need to either download all the files using CVS, wait for the next snapshot, or the release.

-Colourless Dargon

Re: MSVC

Posted: Wed Nov 21, 2001 8:58 pm
by Aussie Dragon
Well I am using a snapshot about 2 weeks old, so I really don't need ZLib at the moment and I have the SDL libraries. I looked through the SDL header files and it doesn't have the function _mainCRTStartup.

I only use the MSVC IDE for the ease of debuging, it will also help me to understand what you are doing, as a few years ago I wrote my own flex viewer and displayed the shape files with DirectDraw and when using palettes ended up being way too dark so I gave up.

I think I might make my own project files and see what I can do.

Cheers,

Aussie Dragon

I also have an U7 world viewer...

Posted: Thu Nov 22, 2001 3:39 am
by Max aka Moscow Dragon
...no DirectDraw is necessary for it at all!

Good old StretchDIBits function is enough to copy the in-memory viewport to the on-screen window.
The performance is OK on old P166 machine.

Re: I also have an U7 world viewer...

Posted: Thu Nov 22, 2001 9:43 am
by Colourless
Make you're own project files... have fun... or not as the case will be. ;-)

-Colourless Dragon

Linking in MSVC

Posted: Thu Nov 22, 2001 11:20 am
by Zombie
I'm not sure, but I think that _mainCRTStartup is the default entry point symbol that VC++ attempts to link to in every console project. Supposing your compiling using the .dsp options (Project Settings in the main menu), you can somehow force MSVC to use a different entry point. I don't remember exactly where it is, but it should be under the Linker tab somewhere. If you put the correct entry point there it should agree to link.

Re: Linking in MSVC

Posted: Fri Nov 23, 2001 8:16 pm
by Aussie Dragon
Finally found what was wrong.
I didn't have MSVC to recognise the .cc files.
How to do this should be in the readme.win32.

Still haven't been able to compile exult but I am getting closer all the time.

SDL Probs

Posted: Sun Dec 02, 2001 7:00 pm
by Aussie Dragon
Woohoo managed to get it compiling, thanks for updating readme.win32.

Everything goes sweet until it gets to SDL_Init where it crashes with an access violation.
I am using SDL version 1.2.3.

Re: SDL Probs

Posted: Sun Dec 02, 2001 7:32 pm
by Aussie Dragon
Sorry I forgot to include the SDL.dll in the same directory as exult.exe, and it all works now.