Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Flaming_Sword on May 21, 2009, 07:37:57 am

Title: Linux compile issue
Post by: Flaming_Sword on May 21, 2009, 07:37:57 am
Hi,

I was trying to build revision 5294 in linux and came across a compile error:

Code: [Select]
network/multi_sexp.cpp: In function ‘void multi_end_packet()’:
network/multi_sexp.cpp:88: error: ‘byte’ was not declared in this scope
network/multi_sexp.cpp:88: error: expected `;' before ‘b’
network/multi_sexp.cpp:89: error: ‘b’ was not declared in this scope
network/multi_sexp.cpp: In function ‘void multi_reduce_counts(int)’:
network/multi_sexp.cpp:317: error: ‘byte’ was not declared in this scope
network/multi_sexp.cpp:317: error: expected `;' before ‘terminator’
network/multi_sexp.cpp:323: warning: deprecated conversion from string constant to ‘char*’
network/multi_sexp.cpp:328: error: ‘terminator’ was not declared in this scope
network/multi_sexp.cpp:329: error: ‘terminator’ was not declared in this scope
network/multi_sexp.cpp:330: warning: deprecated conversion from string constant to ‘char*’
network/multi_sexp.cpp: In function ‘bool multi_sexp_discard_operator()’:
network/multi_sexp.cpp:344: error: ‘byte’ was not declared in this scope
network/multi_sexp.cpp:344: error: expected `;' before ‘terminator’
network/multi_sexp.cpp:352: error: ‘terminator’ was not declared in this scope
network/multi_sexp.cpp:357: error: ‘terminator’ was not declared in this scope
network/multi_sexp.cpp: In function ‘bool multi_get_ship(int&)’:
network/multi_sexp.cpp:402: warning: deprecated conversion from string constant to ‘char*’
make[1]: *** [multi_sexp.o] Error 1

I sought help on IRC and portej05 suggested adding:
Code: [Select]
typedef unsigned char byte;at line 509 in pstypes.h, which fixed the problem.

Thanks.
Title: Re: Linux compile issue
Post by: karajorma on May 21, 2009, 08:42:58 am
Yeah, the problem was caused by not having the type byte defined. The problem is that defining it as an unsigned char is only a temporary solution at best as otherwise it opens the door to all kinds of strange errors. It's probably better if I switch from byte to ubyte and make 255 my packet terminating character.
Title: Re: Linux compile issue
Post by: Echelon9 on May 21, 2009, 10:32:45 pm
This problem also affects the OSX build process too.
Title: Re: Linux compile issue
Post by: karajorma on May 22, 2009, 01:49:59 am
Any ideas better than the one I suggested?