Sign in to follow this  
Volarific

CoD4 1.7a Compiling issues...

Recommended Posts

I tried to run the compiler for 1.7a and ran into some problems...

I'm trying to compile the 1.7a on my mac to be run on linux, just giving it a go xD


KEMI-MacBookPro:CoD4 1.7a kemi$ /Users/kemi/Desktop/CoD4\ 1.7a/build_mach-o.sh
Compiling C-code...
../src/common.c:483:2: warning: indirection of non-volatile null pointer will be
deleted, not trap [-Wnull-dereference]
* ( int * ) 0 = 0x12345678;
^ ~~~~~~~~~~~
../src/common.c:483:2: note: consider using __builtin_trap() or qualifying
pointer with 'volatile'
1 warning generated.
../src/cvar.c:1919:32: warning: 'memset' call operates on objects of type
'cvar_t' (aka 'struct cvar_s') while the size is based on a different type
'cvar_t *' (aka 'struct cvar_s *') [-Wsizeof-pointer-memaccess]
Com_Memset( var, 0, sizeof( var ) );
~~~ ^~~
../src/cvar.c:1919:32: note: did you mean to dereference the argument to
'sizeof' (and multiply it by the number of elements)?
Com_Memset( var, 0, sizeof( var ) );
^~~
1 warning generated.
../src/hl2rcon.c:816:5: warning: array index 2 is past the end of the array
(which contains 2 elements) [-Warray-bounds]
data[2] = team;
^ ~
../src/hl2rcon.c:812:5: note: array 'data' declared here
byte data[2];
^
1 warning generated.
../src/qshared.c:1365:2: warning: array index 39 is past the end of the array
(which contains 39 elements) [-Warray-bounds]
buf[39] = 0;
^ ~~
../src/qshared.c:1350:2: note: array 'buf' declared here
static char buf[39];
^
1 warning generated.
../src/sec_crypto.c:50:72: warning: comparison of unsigned enum expression < 0
is always false [-Wtautological-compare]
... out == NULL *outSize < 1 inSize < 1 algo < 0 algo >= SEC_...
~~~~ ^ ~
../src/sec_crypto.c:91:80: warning: comparison of unsigned enum expression < 0
is always false [-Wtautological-compare]
...out == NULL outSize == NULL *outSize < 1 algo < 0 algo >= SE...
~~~~ ^ ~
2 warnings generated.
../src/sv_cmds.c:265:18: warning: unused function 'SV_GetPlayerByNum'
[-Wunused-function]
static client_t *SV_GetPlayerByNum( void ) {
^
../src/sv_cmds.c:1560:13: warning: unused function 'SV_TestTimeOverrun'
[-Wunused-function]
static void SV_TestTimeOverrun( void ){
^
../src/sv_cmds.c:1568:13: warning: unused function 'SV_GetCurrentServeTimer'
[-Wunused-function]
static void SV_GetCurrentServeTimer(){
^
../src/sv_cmds.c:1574:13: warning: unused function 'SV_SetGravity_f'
[-Wunused-function]
static void SV_SetGravity_f( void ){
^
../src/sv_cmds.c:1631:13: warning: unused function 'SV_Find_f'
[-Wunused-function]
static void SV_Find_f( void ){
^
5 warnings generated.
../src/sv_main.c:1426:12: warning: variable 'var_01' is used uninitialized
whenever 'if' condition is false [-Wsometimes-uninitialized]
if(SEH_StringEd_GetString(finalmsg)){
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/sv_main.c:1430:29: note: uninitialized use occurs here
SV_FinalMessage( finalmsg, var_01 );
^~~~~~
../src/sv_main.c:1426:9: note: remove the 'if' if its condition is always true
if(SEH_StringEd_GetString(finalmsg)){
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/sv_main.c:1418:2: note: variable 'var_01' is declared here
qboolean var_01;
^
1 warning generated.
../src/sys_net.c:2722:80: warning: if statement has empty body [-Wempty-body]
...SOL_SOCKET, SO_ERROR, (char*) &err, &so_len) == 0);
^
../src/sys_net.c:2722:80: note: put the semicolon on a separate line to silence
this warning
../src/sys_net.c:2834:10: warning: comparison of unsigned expression < 0 is
always false [-Wtautological-compare]
if(usec < 0 usec > 999999)
~~~~ ^ ~
2 warnings generated.
../src/sys_thread.c:167:33: warning: if statement has empty body [-Wempty-body]
if(Sys_ThreadisSame(tcb->tid));
^
../src/sys_thread.c:167:33: note: put the semicolon on a separate line to
silence this warning
1 warning generated.
../src/unzip.c:1982:43: warning: equality comparison with extraneous parentheses
[-Wparentheses-equality]
if ((pfile_in_zip_read_info->read_buffer == NULL))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
../src/unzip.c:1982:43: note: remove extraneous parentheses around the
comparison to silence this warning
if ((pfile_in_zip_read_info->read_buffer == NULL))
~ ^ ~
../src/unzip.c:1982:43: note: use '=' to turn this equality comparison into an
assignment
if ((pfile_in_zip_read_info->read_buffer == NULL))
^~
=
1 warning generated.
Compiling NASM...
Linking...
Undefined symbols for architecture i386:
"__gnu_cxx::__exchange_and_add(int volatile*, int)", referenced from:
_Sys_CoD4Linker in sys_cod4linker_mach.o
"std::string::find(char const*, unsigned long, unsigned long) const", referenced from:
_Sys_CoD4Linker in sys_cod4linker_mach.o
"std::string::_M_leak_hard()", referenced from:
_Sys_CoD4Linker in sys_cod4linker_mach.o
"std::string::_Rep::_M_destroy(std::allocator const&)", referenced from:
_Sys_CoD4Linker in sys_cod4linker_mach.o
"std::string::append(char const*, unsigned long)", referenced from:
_Sys_CoD4Linker in sys_cod4linker_mach.o
"std::string::assign(char const*, unsigned long)", referenced from:
_Sys_CoD4Linker in sys_cod4linker_mach.o
"std::string::assign(std::string const&)", referenced from:
_Sys_CoD4Linker in sys_cod4linker_mach.o
"std::string::reserve(unsigned long)", referenced from:
_Sys_CoD4Linker in sys_cod4linker_mach.o
"std::string::_M_mutate(unsigned long, unsigned long, unsigned long)", referenced from:
_Sys_CoD4Linker in sys_cod4linker_mach.o
"std::basic_string, std::allocator >::basic_string(char const*, std::allocator const&)", referenced from:
_Sys_CoD4Linker in sys_cod4linker_mach.o
"std::basic_string, std::allocator >::basic_string(std::string const&)", referenced from:
_Sys_CoD4Linker in sys_cod4linker_mach.o
"std::_Rb_tree_decrement(std::_Rb_tree_node_base*)", referenced from:
_Sys_CoD4Linker in sys_cod4linker_mach.o
"std::_Rb_tree_increment(std::_Rb_tree_node_base*)", referenced from:
_Sys_CoD4Linker in sys_cod4linker_mach.o
"std::__throw_out_of_range(char const*)", referenced from:
_Sys_CoD4Linker in sys_cod4linker_mach.o
"std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
_Sys_CoD4Linker in sys_cod4linker_mach.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Share this post


Link to post
Share on other sites

Well 1st thanks for posting the output.

At first it found some serious mistakes our used compiler did not found. I have fixed mistakes.

2nd I can not help if you try to compile on a different platform for Linux.

It can not find some symbols which are available like this on Linux. This symbols are maybe never called and can be removed but I can not tell for sure. The sys_cod4linker_mach.c contains maybe some of these symbols not. But you can't exchange the files directly.

Compile it on Linux if you want to run it there.

Share this post


Link to post
Share on other sites

Well 1st thanks for posting the output.

At first it found some serious mistakes our used compiler did not found. I have fixed mistakes.

2nd I can not help if you try to compile on a different platform for Linux.

It can not find some symbols which are available like this on Linux. This symbols are maybe never called and can be removed but I can not tell for sure. The sys_cod4linker_mach.c contains maybe some of these symbols not. But you can't exchange the files directly.

Compile it on Linux if you want to run it there.

So wait..

What does "build_mach-o.sh" do?

What OS is that made for?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this