Log in

View Full Version : Another Compiling Thread :)



Silentfood
10-31-2012, 06:59 AM
Hi, so I've loaded up the projects in Code::Blocks and compiled the iniparser with Cygwin's "make". I'm running on a Windows machine, and my current output when I compile vaultmp itself is this huge block.





Compiling: iniparser\src\dictionary.c
cc1.exe: warning: command line option '-std=gnu++11' is valid for C++/ObjC++ but not for C [enabled by default]
Compiling: iniparser\src\iniparser.c
cc1.exe: warning: command line option '-std=gnu++11' is valid for C++/ObjC++ but not for C [enabled by default]
Compiling: vaultmp.cpp
Compiling: vaultmp.rc
Linking executable: vaultmp.exe
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: i386:x86-64 architecture of input file `.objs\Release\vaultmp.res' is incompatible with i386 output
.objs\Release\vaultmp.o:vaultmp.cpp:(.text+0x12ff) : undefined reference to `__Z18iniparser_freedictP12_dictionary_'
.objs\Release\vaultmp.o:vaultmp.cpp:(.text+0x20c7) : undefined reference to `__Z14iniparser_loadPKc'
.objs\Release\vaultmp.o:vaultmp.cpp:(.text+0x20e4) : undefined reference to `__Z19iniparser_getstringP12_dictionary_PKcS2_'
.objs\Release\vaultmp.o:vaultmp.cpp:(.text+0x2106) : undefined reference to `__Z19iniparser_getstringP12_dictionary_PKcS2_'
.objs\Release\vaultmp.o:vaultmp.cpp:(.text+0x2128) : undefined reference to `__Z16iniparser_getintP12_dictionary_PKci'
.objs\Release\vaultmp.o:vaultmp.cpp:(.text+0x214a) : undefined reference to `__Z20iniparser_getbooleanP12_dictionary_PKci'
.objs\Release\vaultmp.o:vaultmp.cpp:(.text+0x2170) : undefined reference to `__Z19iniparser_getstringP12_dictionary_PKcS2_'
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .objs\Release\vaultmp.o: bad reloc address 0x2 in section `.text$_ZN6RakNet27FileListTransferCBInterfaceD1Ev[__ZN6RakNet27FileListTransferCBInterfaceD1Ev]'
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (2 minutes, 54 seconds)
7 errors, 13 warnings




:C
What am I doing so wrong to cause all this.
Thanks.

Koncord
10-31-2012, 08:20 AM
You are compiled Iniparser to static?

Silentfood
10-31-2012, 04:40 PM
You are compiled Iniparser to static?

Unsure myself, I just ran it through the makefile. I'm very new to working with compilers manually, or running makefiles that is.

Koncord
11-01-2012, 01:59 AM
You should use GNU GCC 4.7.1 or 4.7.2. Use the cygwin: "make veryclean" and try again "make". And do not be afraid to experiment with a makefile =).

Silentfood
11-01-2012, 03:48 AM
I'm still getting issues even after doing veryclean, both my builds are on the latest GCC.

My makefile CFLAGS option is this:


-O2 -fPIC -Wall -ansi -pedantic


My output is the same, and these are my toolchains:



C-Compiler: mingw32-gcc.exe
C++ Compiler: mingw32-g++.exe
Linker for Dynamic Libs: mingw32-g++.exe -m32
Linker for Static Libs: ar.exe -m32
Debugger: gdb.exe -m32
Resource Compiler: windres.exe -F pe-i386
Make Program: mingw32-make.exe -m32


Hopefully the extra information should be of use, I must be messing this up somewhere.

Koncord
11-01-2012, 03:54 AM
Compile the Iniparser without "-m32", and VaultMP with "-m32".

Silentfood
11-01-2012, 03:55 AM
Alright update, I messed with a few options and rebuilt vaultmp and now I'm receiving this error:



C:\Users\Chris\Desktop\fo3mp_source\source\stack_t race\src\stack.cpp:21:62: fatal error: bfd.h: No such file or directory
compilation terminated.





#if defined(__MINGW32__)
#include <bfd.h> // link against libbfd and libiberty
#include <psapi.h> // link against psapi
#include <cxxabi.h>
#endif


I'm at level 100 confuse right now.

Koncord
11-01-2012, 04:07 AM
Are you sure you use the latest version of MinGW?

Silentfood
11-01-2012, 05:20 AM
Tried installing 4.7.2 for use with MinGW, now most of the files don't have any references and are throwing errors.

162




-------------- Clean: Debug in vaultmp ---------------


Cleaned "vaultmp - Debug"


-------------- Build: Debug in vaultmp ---------------


Compiling: API.cpp
In file included from C:\Users\Chris\Desktop\fo3mp_source\source\Debug.h :15:0,
from C:\Users\Chris\Desktop\fo3mp_source\source\VaultEx ception.h:13,
from C:\Users\Chris\Desktop\fo3mp_source\source\API.h:1 8,
from C:\Users\Chris\Desktop\fo3mp_source\source\API.cpp :1:
C:\Users\Chris\Desktop\fo3mp_source\source\Critica lSection.h:25:3: error: 'recursive_timed_mutex' does not name a type
C:\Users\Chris\Desktop\fo3mp_source\source\Critica lSection.h:49:27: error: 'thread' has not been declared
Process terminated with status 1 (0 minutes, 2 seconds)
2 errors, 0 warnings

Koncord
11-01-2012, 05:56 AM
Try target "release".

Silentfood
11-01-2012, 04:22 PM
Same issues :(




-------------- Clean: Release in vaultmp ---------------


Cleaned "vaultmp - Release"


-------------- Build: Release in vaultmp ---------------


Compiling: API.cpp
In file included from C:\Users\Chris\Desktop\fo3mp_source\source\Debug.h :15:0,
from C:\Users\Chris\Desktop\fo3mp_source\source\VaultEx ception.h:13,
from C:\Users\Chris\Desktop\fo3mp_source\source\API.h:1 8,
from C:\Users\Chris\Desktop\fo3mp_source\source\API.cpp :1:
C:\Users\Chris\Desktop\fo3mp_source\source\Critica lSection.h:25:3: error: 'recursive_timed_mutex' does not name a type
Process terminated with status 1 (0 minutes, 3 seconds)
1 errors, 0 warnings

Silentfood
11-01-2012, 07:04 PM
Alright so I reinstalled the build of GCC, and them errors aren't coming up now. But now I'm back to square one, errors with the Iniparser. I've also recompiled them too.