Author Topic: fs2_open build error  (Read 2399 times)

0 Members and 1 Guest are viewing this topic.

Hi All,

Since some days, I have an error to build svn fs2:

ai/aicode.cpp: In function ‘void init_ai_class(ai_class*)’:
ai/aicode.cpp:560: error: ‘INT_MIN’ was not declared in this scope
ai/aicode.cpp: In function ‘void parse_ai_class()’:

test build on Mandriva 2009 Spring (GCC 4.3.2) and on Mandriva cooker (GCC 4.4.1)

Best regard
Shadow95

 

Offline castor

  • 29
    • http://www.ffighters.co.uk./home/
Is it from trunk or from the 3.6.10 branch?
If trunk, do you really need it, or would 3.6.10 be enough?

 

Offline Sushi

  • Art Critic
  • 211
Is it from trunk or from the 3.6.10 branch?
If trunk, do you really need it, or would 3.6.10 be enough?

Pretty sure it's from trunk. Pretty sure it's my code, in fact.

Definitely needs to be fixed. Apparently the include that defines INT_MIN doesn't work on Linux... can any other linux compilers verify this?

EDIT:

My best guess is that we need to add this line to the top of aicode.cpp:

Code: [Select]
#include <limits.h>
However, since I'm not set up to compile on Linux, I can't verify that.

« Last Edit: September 11, 2009, 11:23:48 am by Sushi »

 
Hi,

on Trunk

Cheers
Shadow95

 
Hi Sushi

so, this error is deleted with #include <limits.h> in aicode.cpp, but after i have theses errors now :

make[1]: entrant dans le répertoire « /home/xavier/Sources/fs2open/code »
g++ -m64 -march=athlon64 -ansi -pedantic -DLUA_USE_LINUX -g -Os -Wall -funroll-loops -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT     -fsigned-char -Wno-unknown-pragmas  -Wno-deprecated -Wno-char-subscripts -I../lua  -g  -L/usr/lib64 -lSDL  -lvorbis -lm -lvorbisfile  -ltheora  -logg -lGL -lGLU -lopenal  -o fs2_open_r freespace.o levelpaging.o libcode.a ../libjpeg/libjpeg.a ../lua/liblua.a
freespace.o: In function `load_animating_pointer(char*, int, int)':
/home/xavier/Sources/fs2open/code/freespace2/freespace.cpp:7832: undefined reference to `Error(char const*, int, char const*, ...)'
freespace.o: In function `game_render_frame_setup()':
/home/xavier/Sources/fs2open/code/freespace2/freespace.cpp:3535: undefined reference to `Error(char const*, int, char const*, ...)'
freespace.o: In function `game_level_close()':
/home/xavier/Sources/fs2open/code/freespace2/freespace.cpp:1013: undefined reference to `Error(char const*, int, char const*, ...)'
/usr/bin/ld: Dwarf Error: Offset (102756) greater than or equal to .debug_str size (49255).
libcode.a(aicode.o): In function `ai_find_path(object*, int, int, int, int)':
/home/xavier/Sources/fs2open/code/ai/aicode.cpp:2919: undefined reference to `Error(char const*, int, char const*, ...)'
libcode.a(aicode.o): In function `process_subobjects(int)':
/home/xavier/Sources/fs2open/code/ai/aicode.cpp:11223: undefined reference to `Error(char const*, int, char const*, ...)'
libcode.a(aicode.o):/home/xavier/Sources/fs2open/code/ai/aicode.cpp:3201: more undefined references to `Error(char const*, int, char const*, ...)' follow
collect2: ld a retourné 1 code d'état d'exécution
make[1]: *** [fs2_open_r] Erreur 1


Cheers
Xavier

 

Offline Hellzed

  • 28
It's the same for me on Ubuntu 9.04 x86_64. I can't compile, with the same error !

 
 

Offline castor

  • 29
    • http://www.ffighters.co.uk./home/
edit: removed, practically a reprint of what shadow posted..

 
This might be a woopsies related to a change I made last night.
I forgot to update stubs.cpp.

Should be fixed now.
Thanks for the report!
STRONGTEA. Why can't the x86 be sane?

 
Hi Portej05,

It's good now, build work !

For Sushi : add these lines after # include <map>  in aicode.cpp and build it on windows and linux:

#ifdef __GNUC__
#include <limits.h>
#endif

Cheers
Shadow95

 

Offline Sushi

  • Art Critic
  • 211
Can someone else building on Linux verify that adding

#include <limits.h>

to aicode.cpp fixes build errors? Or at least doesn't break anything (although I don't see why it should)?

If so, we can go ahead and pop it into trunk.

 

Offline castor

  • 29
    • http://www.ffighters.co.uk./home/
Yes, working fine.

  
I reckon commit it - I can't see any reason why it would break anything (MS CRT has a different include pattern in places to the GCC include patterns).
STRONGTEA. Why can't the x86 be sane?