MSVC

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
Aussie Dragon

MSVC

Post 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.
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: MSVC

Post by Colourless »

What version of MSVC are you using? Also, what do you mean by crash?

-Colourless Dragon
Aussie Dragon

Re: MSVC

Post 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
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: MSVC

Post 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)...
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Max aka Moscow Dragon

Re: MSVC

Post 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.
Xane

Re: MSVC

Post 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.
Xane

Re: MSVC

Post 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.
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

Re: MSVC

Post 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
Aussie Dragon

Re: MSVC

Post 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
Max aka Moscow Dragon

I also have an U7 world viewer...

Post 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.
Colourless
Site Admin
Posts: 731
Joined: Thu May 14, 2020 1:34 pm

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

Post by Colourless »

Make you're own project files... have fun... or not as the case will be. ;-)

-Colourless Dragon
Zombie

Linking in MSVC

Post 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.
Aussie Dragon

Re: Linking in MSVC

Post 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.
Aussie Dragon

SDL Probs

Post 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.
Aussie Dragon

Re: SDL Probs

Post by Aussie Dragon »

Sorry I forgot to include the SDL.dll in the same directory as exult.exe, and it all works now.
Locked