Compiling Stratagus Code

Bug #706261 reported by Travis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stratagus
Fix Released
Medium
Pali

Bug Description

OK, here's the deal. I am using Visual Studio 2005 to compile the code. I want to make it so when you have no units/buildings selected or a selected unit enters a building/oil platform/gold mine the infopanel is blank, but whenever you have a unit selected, the beveled info panel shows up, just like it did in the old game.

I managed to edit the ui.lua files in each races folder so the beveled panel is on permanently the whole time, but how could I make it behave like I want it to as mentioned above?

Also when I compile the code, I no longer get the intro movies or the music. Can someone tell me how to setup up all the libraries and header directories so I CAN compile and have the movies and music and everything else working please?

Revision history for this message
Pali (pali) wrote :

Music is played by SDL. So it depends on your SDL compilation. For additional ogg music support you need compile Stratagus with vorbis library. For movies you need additional theroa library.

Revision history for this message
Travis (dinky-dye-aussie) wrote :

I've downloaded all of those - sdl, vorbis and theroa, but when I compile the exe, the intro movies dont work, and I can't hear the music at any time during gameplay or when I'm in the main menu.

What I want to know now is how and where do you have all these library files installed on your PC and what are the project settings you have setup in VC++ so as to compile the program successfully so everything works?

Im also getting a heap of "_vsn_prinft" warnings when I compile the code as well.

Revision history for this message
Pali (pali) wrote :

I do not have Windows and I did not write MSVC project file. Stratagus has some code in C++ and some in C. Microsoft has no C compiler (with C99 standards) so warnings (or errors) is typical...

MSVC project files come from cybermind and are not supported.

Revision history for this message
Joris Dauphin (joris-dauphin) wrote :

There are some missing preprocessor definitions in the project :
USE_BZ2LIB
USE_MIKMOD
USE_VORBIS
USE_THEORA
_CRT_SECURE_NO_DEPRECATE=1 // this one should "disable" the warning

Revision history for this message
Pali (pali) wrote :

Joris could you fix this?

Changed in stratagus:
assignee: nobody → Joris Dauphin (joris-dauphin)
status: New → Confirmed
Revision history for this message
Joris Dauphin (joris-dauphin) wrote :

Yes, I will do this this week-end.

Revision history for this message
Travis (dinky-dye-aussie) wrote :

I did what you suggested Joris, and added those variables to the preprocessor. The movies now work, but the palette is all wildfire - you can't make anything out in either intro movie its all rainbow coloured. everything else in-game works as normal though.

Also there was a variable in the code that was first declared as a class, then was used in a struct. so I changed the initial declaration to a struct as well and the warning about it went away. now the only warning a I am getting is about the "extern int strlen" being an insufficiant linkage to the dll file...dunno what that means....?

other than that its all good.

Revision history for this message
Travis (dinky-dye-aussie) wrote :

to be more specific it says this:

c:\users\travis\wargus\stratagus-2.2.5.5\src\include\util.h(218) : warning C4273: 'strnlen' : inconsistent dll linkage
c:\program files (x86)\microsoft visual studio 8\vc\include\string.h(82) : see previous definition of 'strnlen'

referring to this code piece - "extern size_t strnlen(const char *str, size_t strsize);

and when I look at the previous definition in string.h, it looks like this:

_CRTIMP __checkReturn size_t __cdecl strnlen(__in_z const char * _Str, __in size_t _MaxCount);

can I fix it?

Revision history for this message
Pali (pali) wrote :

strnlen is declarated as: size_t strnlen(const char *s, size_t maxlen); so no changes to this code
See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/strnlen.html

You can (un)define HAVE_STRNLEN to use (or not to use) this function in stratagus source.

Pali (pali)
summary: - Compiling Strategus Code
+ Compiling Stratagus Code
Revision history for this message
Pali (pali) wrote :

Stratagus (in bzr trunk) now using CMake build system. CMake can generate Makefiles or vcproj files for MSVC. Please check if it works now.

Changed in stratagus:
status: Confirmed → Incomplete
assignee: Joris Dauphin (joris-dauphin) → Pali (pali)
importance: Undecided → Medium
Revision history for this message
Pali (pali) wrote :

A lot of CMake and MSVC patches were commited. If problem still exists, reopen bug.

Changed in stratagus:
status: Incomplete → Fix Committed
milestone: none → 2.2.6
Pali (pali)
Changed in stratagus:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.