Hi all,

First of all, i'm knew to all of this so please don't get mad at me
Using Ubuntu 14.04 x64 I can not get libcod for Cod4 to compile/run.

Tried using the precompiled libraries:
Without using LD_LIBRARY_PATH it would not load libcod, it would just start without it.
Using LD_LIBRARY_PATH (and just guessing which directory I had to define, because I do not understand this bit and it isn't really explained well), it crashes with SEGMENTATION FAULT.

Then I tried compiling it myself to see if it fixes things.
Following the basic tutorial on Github I got a lot of errors.
I have all of the requirements so that is not the problem.

./doit.sh base
Code:
##### COMPILE GSC_ASTAR.CPP #####
##### COMPILE GSC_MYSQL.CPP #####
gsc_mysql.cpp: In function ‘void gsc_mysql_free_result()’:
gsc_mysql.cpp:529:15: warning: NULL used in arithmetic [-Wpointer-arith]
  if(result == NULL)
               ^
gsc_mysql.cpp: In function ‘int gsc_mysql_test_0()’:
gsc_mysql.cpp:880:55: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘my_ulonglong {aka long long unsigned int}’ [-Wformat=]
  printf("affected rows: %d\n", mysql_affected_rows(my));
                                                       ^
gsc_mysql.cpp:892:54: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘my_ulonglong {aka long long unsigned int}’ [-Wformat=]
  printf("query-num rows: %d\n", mysql_num_rows(query));
                                                      ^
gsc_mysql.cpp: In function ‘int gsc_mysql_test_1()’:
gsc_mysql.cpp:972:47: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
   printf("stmt->stmt_id = %d\n", stmt->stmt_id);
                                               ^
gsc_mysql.cpp:973:59: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
   printf("stmt->prefetch_rows = %d\n", stmt->prefetch_rows);
                                                           ^
gsc_mysql.cpp:993:47: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
   printf("stmt->stmt_id = %d\n", stmt->stmt_id);
                                               ^
gsc_mysql.cpp:994:59: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
   printf("stmt->prefetch_rows = %d\n", stmt->prefetch_rows); // i dont know
                                                           ^
gsc_mysql.cpp:1146:55: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘my_ulonglong {aka long long unsigned int}’ [-Wformat=]
  printf("affected rows: %d\n", mysql_affected_rows(my));
                                                       ^
gsc_mysql.cpp:1158:54: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘my_ulonglong {aka long long unsigned int}’ [-Wformat=]
  printf("query-num rows: %d\n", mysql_num_rows(query));
                                                      ^
##### COMPILE SERVER.CPP #####
cc1: warning: command line option ‘-std=gnu++11’ is valid for C++/ObjC++ but not for C [enabled by default]
server.c: In function ‘mythread’:
server.c:244:6: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘void **’ [-Wformat=]
      sscanf(arg_from, "%x", &from); // prepare from-pointer
      ^
server.c:311:7: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘float **’ [-Wformat=]
       sscanf(address, "%x", &ptr_float);
       ^
server.c:328:7: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘int **’ [-Wformat=]
       sscanf(address, "%x", &ptr);
       ^
server.c:345:7: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘unsigned char **’ [-Wformat=]
       sscanf(address, "%x", &ptr);
       ^
server.c:387:6: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘char **’ [-Wformat=]
      sscanf(arg_from, "%x", &from);
      ^
server.c:388:6: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘char **’ [-Wformat=]
      sscanf(arg_to, "%x", &to);
      ^
server.c:433:6: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘unsigned int **’ [-Wformat=]
      sscanf(arg_address, "%x", &address);
      ^
server.c:460:6: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘void **’ [-Wformat=]
      sscanf(arg_addr, "%x", &addr);
      ^
server.c: In function ‘cdecl_injected_shell’:
server.c:718:5: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘unsigned int **’ [-Wformat=]
     sscanf(buffer, "%x", &address);
     ^
##### COMPILE GSC_MEMORY.CPP #####
##### COMPILE cracking.CPP #####
##### COMPILE GSC_MATH.CPP #####
./doit.sh cod4_1_7
Code:
##### COMPILE cod4_1_7 LIBCOD.CPP #####
In file included from gsc.hpp:47:0,
                 from libcod.cpp:8:
functions.hpp:29:3: warning: #warning static Cmd_Argv_t Cmd_Argv = (Cmd_Argv_t)NULL; [-Wcpp]
  #warning static Cmd_Argv_t Cmd_Argv = (Cmd_Argv_t)NULL;
   ^
functions.hpp:101:3: warning: #warning static Cvar_VariableValue_t CvarVariableValue = NULL; [-Wcpp]
  #warning static Cvar_VariableValue_t CvarVariableValue = NULL;
   ^
functions.hpp:113:3: warning: #warning static FS_ReadFile_t FS_ReadFile = NULL; [-Wcpp]
  #warning static FS_ReadFile_t FS_ReadFile = NULL;
   ^
functions.hpp:126:3: warning: #warning static FS_LoadDir_t FS_LoadDir = NULL; [-Wcpp]
  #warning static FS_LoadDir_t FS_LoadDir = NULL;
   ^
functions.hpp:137:3: warning: #warning static int hook_findMap_call = NULL; [-Wcpp]
  #warning static int hook_findMap_call = NULL;
   ^
functions.hpp:148:3: warning: #warning static int hook_AuthorizeState_call = NULL; [-Wcpp]
  #warning static int hook_AuthorizeState_call = NULL;
   ^
libcod.cpp:562:3: warning: #warning gametype_scripts_t gametype_scripts = (gametype_scripts_t)NULL; [-Wcpp]
  #warning gametype_scripts_t gametype_scripts = (gametype_scripts_t)NULL;
   ^
libcod.cpp:574:3: warning: #warning codscript_load_function_t codscript_load_function = (codscript_load_function_t)NULL; [-Wcpp]
  #warning codscript_load_function_t codscript_load_function = (codscript_load_function_t)NULL;
   ^
libcod.cpp:638:4: warning: #warning short ret = codscript_call_callback_entity(NULL, codecallback_playercommand, 1); [-Wcpp]
   #warning short ret = codscript_call_callback_entity(NULL, codecallback_playercommand, 1);
    ^
libcod.cpp:1800:5: warning: #warning int *addressToDownloadPointer = NULL; [-Wcpp]
    #warning int *addressToDownloadPointer = NULL;
     ^
libcod.cpp: In function ‘void printStackTrace()’:
libcod.cpp:212:27: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘void*’ [-Wformat=]
   printf("%.8x ", array[i]);
                           ^
libcod.cpp: In function ‘int hook_ClientCommand(int)’:
libcod.cpp:639:81: warning: converting to non-pointer type ‘int’ from NULL [-Wconversion-null]
   short ret = codscript_call_callback_entity(NULL, codecallback_playercommand, 1);
                                                                                 ^
libcod.cpp: In function ‘ssize_t hook_recvfrom(int, void*, size_t, int, sockaddr*, socklen_t*)’:
libcod.cpp:796:4: warning: format ‘%s’ expects argument of type ‘char*’, but argument 3 has type ‘void*’ [-Wformat=]
    );
    ^
libcod.cpp:797:38: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘void*’ [-Wformat=]
    printf(">>>>>>>%s<<<<<<<<<\n", buf);
                                      ^
libcod.cpp: In function ‘pthread_t hook_pthread_self()’:
libcod.cpp:945:41: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
  printf("  pthread_self() = %.8p\n", ret);
                                         ^
libcod.cpp:945:41: warning: format ‘%p’ expects argument of type ‘void*’, but argument 2 has type ‘int’ [-Wformat=]
libcod.cpp: In function ‘int hook_pthread_mutex_lock(pthread_mutex_t*)’:
libcod.cpp:959:56: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
  printf("  pthread_mutex_lock(%.8p) = %d\n", mutex, ret);
                                                        ^
libcod.cpp: In function ‘int hook_pthread_mutex_unlock(pthread_mutex_t*)’:
libcod.cpp:973:56: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
  printf("pthread_mutex_unlock(%.8p) = %d\n", mutex, ret);
                                                        ^
libcod.cpp: In function ‘int SV_AddServerCommand(int*, ...)’:
libcod.cpp:1280:43: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘int*’ [-Wformat=]
  printf("client: %s, tmp=%s\n", client, "");
                                           ^
libcod.cpp: In function ‘void SV_SendServerCommand(int*, int, const char*, ...)’:
libcod.cpp:1459:66: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘int*’ [-Wformat=]
  printf("client=%08x bla=%08p message=%s\n", client, bla, message);
                                                                  ^
libcod.cpp:1459:66: warning: '0' flag used with ‘%p’ gnu_printf format [-Wformat=]
libcod.cpp:1459:66: warning: format ‘%p’ expects argument of type ‘void*’, but argument 3 has type ‘int’ [-Wformat=]
libcod.cpp: In function ‘int BG_AnimationIndexForString(char*)’:
libcod.cpp:1553:65: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
     if (debug) printf("tmp:%.8p , %.8p", (tmp + 0), INT(tmp + 4));
                                                                 ^
libcod.cpp:1553:65: warning: format ‘%p’ expects argument of type ‘void*’, but argument 2 has type ‘int’ [-Wformat=]
libcod.cpp:1553:65: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
libcod.cpp:1553:65: warning: format ‘%p’ expects argument of type ‘void*’, but argument 3 has type ‘int’ [-Wformat=]
libcod.cpp: In function ‘int BG_PlayAnimName(int, const char*, int, int, int, int)’:
libcod.cpp:1632:2: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
  );
  ^
libcod.cpp:1632:2: warning: format ‘%p’ expects argument of type ‘void*’, but argument 2 has type ‘int’ [-Wformat=]
libcod.cpp:1632:2: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
libcod.cpp:1632:2: warning: format ‘%p’ expects argument of type ‘void*’, but argument 4 has type ‘int’ [-Wformat=]
libcod.cpp: In function ‘int BG_PlayAnim(int, int, int, int, int, int, int)’:
libcod.cpp:1641:3: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
   );
   ^
libcod.cpp:1641:3: warning: format ‘%p’ expects argument of type ‘void*’, but argument 2 has type ‘int’ [-Wformat=]
libcod.cpp:1641:3: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
libcod.cpp:1641:3: warning: format ‘%p’ expects argument of type ‘void*’, but argument 4 has type ‘int’ [-Wformat=]
libcod.cpp:1641:3: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
libcod.cpp:1641:3: warning: format ‘%p’ expects argument of type ‘void*’, but argument 5 has type ‘int’ [-Wformat=]
libcod.cpp:1641:3: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
libcod.cpp:1641:3: warning: format ‘%p’ expects argument of type ‘void*’, but argument 6 has type ‘int’ [-Wformat=]
libcod.cpp:1641:3: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
libcod.cpp:1641:3: warning: format ‘%p’ expects argument of type ‘void*’, but argument 7 has type ‘int’ [-Wformat=]
libcod.cpp:1641:3: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
libcod.cpp:1641:3: warning: format ‘%p’ expects argument of type ‘void*’, but argument 8 has type ‘int’ [-Wformat=]
libcod.cpp: In function ‘void MSG_WriteBigString(int*, char*)’:
libcod.cpp:1665:74: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
  printf("i=%d size_all=%d len=%d MSG=%.8p %s\n", i, size_all, len, MSG, s);
                                                                          ^
##### COMPILE cod4_1_7 GSC.CPP #####
In file included from gsc.hpp:47:0,
                 from gsc.cpp:1:
functions.hpp:29:3: warning: #warning static Cmd_Argv_t Cmd_Argv = (Cmd_Argv_t)NULL; [-Wcpp]
  #warning static Cmd_Argv_t Cmd_Argv = (Cmd_Argv_t)NULL;
   ^
functions.hpp:101:3: warning: #warning static Cvar_VariableValue_t CvarVariableValue = NULL; [-Wcpp]
  #warning static Cvar_VariableValue_t CvarVariableValue = NULL;
   ^
functions.hpp:113:3: warning: #warning static FS_ReadFile_t FS_ReadFile = NULL; [-Wcpp]
  #warning static FS_ReadFile_t FS_ReadFile = NULL;
   ^
functions.hpp:126:3: warning: #warning static FS_LoadDir_t FS_LoadDir = NULL; [-Wcpp]
  #warning static FS_LoadDir_t FS_LoadDir = NULL;
   ^
functions.hpp:137:3: warning: #warning static int hook_findMap_call = NULL; [-Wcpp]
  #warning static int hook_findMap_call = NULL;
   ^
functions.hpp:148:3: warning: #warning static int hook_AuthorizeState_call = NULL; [-Wcpp]
  #warning static int hook_AuthorizeState_call = NULL;
   ^
gsc.cpp:18:3: warning: #warning Scr_GetFunction_t Scr_GetFunction = (Scr_GetFunction_t)NULL; [-Wcpp]
  #warning Scr_GetFunction_t Scr_GetFunction = (Scr_GetFunction_t)NULL;
   ^
gsc.cpp:19:3: warning: #warning Scr_GetMethod_t Scr_GetMethod = (Scr_GetMethod_t)NULL; [-Wcpp]
  #warning Scr_GetMethod_t Scr_GetMethod = (Scr_GetMethod_t)NULL;
   ^
gsc.cpp: In function ‘void gsc_player_printf(int)’:
gsc.cpp:208:25: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
  printf("id: %.8p\n", id);
                         ^
gsc.cpp:208:25: warning: format ‘%p’ expects argument of type ‘void*’, but argument 2 has type ‘int’ [-Wformat=]
gsc.cpp: In function ‘int cdecl_injected_closer()’:
gsc.cpp:1628:83: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
     printf("next:%.8p pack:%.8p dir:%.8p", search->next, search->pack, search->dir);
                                                                                   ^
gsc.cpp:1628:83: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
gsc.cpp:1628:83: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
gsc.cpp:1741:2: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
  );
  ^
gsc.cpp:1741:2: warning: format ‘%p’ expects argument of type ‘void*’, but argument 2 has type ‘int’ [-Wformat=]
gsc.cpp:1741:2: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
gsc.cpp:1741:2: warning: format ‘%p’ expects argument of type ‘void*’, but argument 3 has type ‘int’ [-Wformat=]
gsc.cpp:1741:2: warning: precision used with ‘%p’ gnu_printf format [-Wformat=]
gsc.cpp:1741:2: warning: format ‘%p’ expects argument of type ‘void*’, but argument 4 has type ‘int’ [-Wformat=]
##### COMPILE cod4_1_7 GSC_PLAYER.CPP #####
In file included from gsc.hpp:47:0,
                 from gsc_player.hpp:14,
                 from gsc_player.cpp:1:
functions.hpp:29:3: warning: #warning static Cmd_Argv_t Cmd_Argv = (Cmd_Argv_t)NULL; [-Wcpp]
  #warning static Cmd_Argv_t Cmd_Argv = (Cmd_Argv_t)NULL;
   ^
functions.hpp:101:3: warning: #warning static Cvar_VariableValue_t CvarVariableValue = NULL; [-Wcpp]
  #warning static Cvar_VariableValue_t CvarVariableValue = NULL;
   ^
functions.hpp:113:3: warning: #warning static FS_ReadFile_t FS_ReadFile = NULL; [-Wcpp]
  #warning static FS_ReadFile_t FS_ReadFile = NULL;
   ^
functions.hpp:126:3: warning: #warning static FS_LoadDir_t FS_LoadDir = NULL; [-Wcpp]
  #warning static FS_LoadDir_t FS_LoadDir = NULL;
   ^
functions.hpp:137:3: warning: #warning static int hook_findMap_call = NULL; [-Wcpp]
  #warning static int hook_findMap_call = NULL;
   ^
functions.hpp:148:3: warning: #warning static int hook_AuthorizeState_call = NULL; [-Wcpp]
  #warning static int hook_AuthorizeState_call = NULL;
   ^
##### COMPILE cod4_1_7 GSC_UTILS.CPP #####
In file included from gsc.hpp:47:0,
                 from gsc_utils.hpp:14,
                 from gsc_utils.cpp:1:
functions.hpp:29:3: warning: #warning static Cmd_Argv_t Cmd_Argv = (Cmd_Argv_t)NULL; [-Wcpp]
  #warning static Cmd_Argv_t Cmd_Argv = (Cmd_Argv_t)NULL;
   ^
functions.hpp:101:3: warning: #warning static Cvar_VariableValue_t CvarVariableValue = NULL; [-Wcpp]
  #warning static Cvar_VariableValue_t CvarVariableValue = NULL;
   ^
functions.hpp:113:3: warning: #warning static FS_ReadFile_t FS_ReadFile = NULL; [-Wcpp]
  #warning static FS_ReadFile_t FS_ReadFile = NULL;
   ^
functions.hpp:126:3: warning: #warning static FS_LoadDir_t FS_LoadDir = NULL; [-Wcpp]
  #warning static FS_LoadDir_t FS_LoadDir = NULL;
   ^
functions.hpp:137:3: warning: #warning static int hook_findMap_call = NULL; [-Wcpp]
  #warning static int hook_findMap_call = NULL;
   ^
functions.hpp:148:3: warning: #warning static int hook_AuthorizeState_call = NULL; [-Wcpp]
  #warning static int hook_AuthorizeState_call = NULL;
   ^
gsc_utils.cpp: In function ‘void gsc_utils_rundll()’:
gsc_utils.cpp:310:63: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘void*’ [-Wformat=]
  printf("dlopen(\"%s\") returned: %.8x\n", arg_library, handle);
                                                               ^
gsc_utils.cpp:321:65: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘void (*)()’ [-Wformat=]
  printf("function-name=%s -> address=%.8x\n", arg_function, func);
                                                                 ^
##### LINK libcod4_1_7.so #####
./doit.sh wrapper
Code:
##### WRAPPER: COMPILE wrapper_libcod2.cpp #####
cp: cannot stat ‘wrapper_libcod2.cpp’: No such file or directory
gcc: error: a.cpp: No such file or directory
gcc: fatal error: no input files
compilation terminated.
##### WRAPPER: LINK wrapper_libcod2.so #####
gcc: error: wrapper_libcod2.opp: No such file or directory
gcc: fatal error: no input files
compilation terminated.
cp: cannot stat ‘wrapper_libcod2.so’: No such file or directory



Can someone give me a detailed explanation of what I have to do to get this to run?
I've seen people pointing LD_LIBRARY_PATH to a mysql directory, but I have no such thing.
I only have libcod4_1_7.so and that's it. I hoped compiling it myself would give me more files and a clue what to do...