Visual Studio Compile Problems

For code related discussions and questions
SikhYkuCain
New user
Posts: 3
Joined: 13 Aug 2010, 12:52

Visual Studio Compile Problems

Post by SikhYkuCain »

Hello all,
yesterday I got the source code of warzone in order to compile it with Visual Studio 2008.

I follow the Windows Compile Guide (MSVC).

But I have trouble with unistd.h wich is a linux library.

Moreover the VS solution seems out of date, indeed some file are missing(aiexperience.cpp et formation.cpp) probably due at a modification of the code structure.

So if there are some developper who use VS for the warzone project, I need their help :)
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Visual Studio Compile Problems

Post by Per »

aiexperience.cpp and formation.cpp have been removed, so just remove them from the project files. If you manage to get it to compile, please post your project files so that other people can use them :-)
SikhYkuCain
New user
Posts: 3
Joined: 13 Aug 2010, 12:52

Re: Visual Studio Compile Problems

Post by SikhYkuCain »

Yes but I still have problem with the <unistd.h> library which doesn't exist on Windows.
It seems that all include<unistd.h> should be replace by both #include <io.h> and #include <process.h> I replace this include by

Code: Select all

#ifdef WIN32
#include <io.h> 
#include <process.h>
#else
#include <unistd.h>
in the 7 files which don't compile.
They are all _lexer.lex.cpp files :

Code: Select all

strress_lexer.lex.cpp
audp_lexer.lex.cpp
script_lexer.lex.cpp
chat_lexer.lex.cpp
level_lexer.lex.cpp
message_lexer.lex.cpp
scriptvals_lexer.lex.cpp
but they have being modified during the compilation. Which undo what I do. It seems they are automatically generated during the building process.

Moreover the project ivis_common is missing too so I remove it from the VS solution.
User avatar
milo christiansen
Regular
Regular
Posts: 749
Joined: 02 Jun 2009, 21:23
Location: Perrinton Michigan

Re: Visual Studio Compile Problems

Post by milo christiansen »

SikhYkuCain wrote:It seems that all include<unistd.h> should be replace by both #include <io.h> and #include <process.h> I replace this include by
...
in the 7 files which don't compile.
They are all _lexer.lex.cpp files :
...
but they have being modified during the compilation. Which undo what I do. It seems they are automatically generated during the building process.
Add a file named "unistd.h" and put this in it:
#include <io.h>
#include <process.h>

problem solved :)
For a better fix you would have to edit the lexer files and I don't know how to do that.
In general, if you see glowing, pulsating things in the game, you should click on them.
- Demigod Game Ganual
Safety0ff
Trained
Trained
Posts: 397
Joined: 18 Jul 2009, 23:23

Re: Visual Studio Compile Problems

Post by Safety0ff »

Solution:
Looks like we'll have to fix this on our end: http://stackoverflow.com/questions/2793 ... 29#2832829

Misc. relevant link: https://github.com/Warzone2100/warzone2 ... 56ad9dbf62
SikhYkuCain
New user
Posts: 3
Joined: 13 Aug 2010, 12:52

Re: Visual Studio Compile Problems

Post by SikhYkuCain »

I add the GnuWin32\include to the include folder and it works.
Moreover this folder contains a file named unistd.h in wich is writen :

#include <io.h>
#include <process.h>

So thank you both for your answer.

Now i have this an error link 2001 __forceCRTManifestCUR in libtheora

I see there is a libtheora_static.lib in the devpkg/lib folder. I try to include this but I have the same errors. Maybe I forget to do something...
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: Visual Studio Compile Problems

Post by Buginator »

Read http://developer.wz2100.net/wiki/Compil ... ndows/MSVC I updated it.
Hope that helps.

Sorry, I don't have more time to make a proper VS2k10 project file(s)/dev package.
and it ends here.