Author Topic: Linux compile issue  (Read 1378 times)

0 Members and 1 Guest are viewing this topic.

Linux compile issue
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.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Linux compile issue
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.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Echelon9

  • 210
Re: Linux compile issue
This problem also affects the OSX build process too.

  

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Linux compile issue
Any ideas better than the one I suggested?
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]