Page 1 of 1

Visual Studio Compile Problems

Posted: 11 Jan 2011, 18:25
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 :)

Re: Visual Studio Compile Problems

Posted: 11 Jan 2011, 18:50
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 :-)

Re: Visual Studio Compile Problems

Posted: 13 Jan 2011, 06:29
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.

Re: Visual Studio Compile Problems

Posted: 13 Jan 2011, 21:09
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.

Re: Visual Studio Compile Problems

Posted: 14 Jan 2011, 19:37
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

Re: Visual Studio Compile Problems

Posted: 19 Jan 2011, 16:12
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...

Re: Visual Studio Compile Problems

Posted: 30 Jan 2011, 09:01
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.