vaultmp icon indicating copy to clipboard operation
vaultmp copied to clipboard

vaultmp - Compiling in Code Blocks

Open Langerz82 opened this issue 7 years ago • 50 comments

Hello,

I'm receiving the following error wondering if you have any idea how to fix.

See: image

Langerz82 avatar Jun 05 '17 10:06 Langerz82

This happens if the C++ standard library that comes with your MinGW does not include thread support. Check this answer:

https://stackoverflow.com/a/17986785

I also mentioned it in the instructions: https://github.com/foxtacles/vaultmp#compilation

foxtacles avatar Jun 05 '17 10:06 foxtacles

Thanks I fixed the error, will let you know how it goes.

Langerz82 avatar Jun 05 '17 10:06 Langerz82

Hello, These are the new errors I'm getting: image

Langerz82 avatar Jun 05 '17 11:06 Langerz82

I've sorted out the threading issues, turns out I wasnt using POSIX threads in my MinGW.

Now I can compile as far as this: image

Langerz82 avatar Jun 05 '17 15:06 Langerz82

which GCC version are you using? probably something changed in a newer version, leading to issues like that. maybe you can get a mingw64 including GCC 4.9 - otherwise the current code would probably need to be adjusted (not sure how much effort this would be, I have no mingw setup to try atm)

foxtacles avatar Jun 05 '17 15:06 foxtacles

Ok I dowloaded and used GCC 5.4 as thats the closest I could find. It's throwing these errors:

image

Looks like it's compiling in 64-bit mode, any ideas?

Langerz82 avatar Jun 05 '17 21:06 Langerz82

I changed the makefile to run the 32-bit g++ and Ive resolved the previous issue. Let you know how it goes.

Langerz82 avatar Jun 06 '17 08:06 Langerz82

Hey Chris I'm having trouble with the ini parser I compiled it in linux then copied the files .a and .so.0 files into MinGW's 32-bit lib folder but its not linking either by using -liniiparser or -l:libiniparser.a . How can I compile it under Codeblocks and MinGW? Setting up a standard static library did not work.

Langerz82 avatar Jun 06 '17 13:06 Langerz82

https://github.com/foxtacles/vaultmp/tree/master/source/lib there are C::B project files and makefiles for iniparser and time libraries, did you try them to compile them on Windows?

foxtacles avatar Jun 06 '17 13:06 foxtacles

Hey, I needed to create my own makefile for the ini parser which I based off the raknet makefile. Am I missing any flags? I checked verbose linking and it says that it skipped it because it was incompatible and hence the library not being found. Here is the adjusted makefile for windows: https://gist.github.com/Langerz82/8bb5037b54b9cf6a09efb277adb4bfb0

Langerz82 avatar Jun 06 '17 20:06 Langerz82

https://github.com/foxtacles/vaultmp/blob/master/source/lib/iniparser_makefile.windows this one didn't work?

maybe you are missing -m32 in the CC var

foxtacles avatar Jun 06 '17 20:06 foxtacles

It still does not get loaded when linking, both with and without -m32, any ideas?

Langerz82 avatar Jun 07 '17 01:06 Langerz82

Think I know the issue. The command is running 64-bit ld.exe as shown here: D:/Program Files/mingw-w64/x86_64-5.4.0-release-posix-sjlj-rt/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible D:/Program Files/mingw-w64/x86_64-5.4.0-release-posix-sjlj-rt/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.4.0/../../..\libiniparser.a when searching for -l:libiniparser.a Just gotta find a 32-bit ld.exe

Langerz82 avatar Jun 07 '17 01:06 Langerz82

Its finding the libraries yet it keeps searching and throws errors as if it can't find them. I'm stuck on this:

image

Langerz82 avatar Jun 07 '17 05:06 Langerz82

Managed to find the Raknet library by removing the -m32 flags when compiling. Now I got the following errors with stack_trace.

image

Langerz82 avatar Jun 07 '17 22:06 Langerz82

hmm, strange. are you re-compiled all parts after you changed the compiler version? alternatively you can try the Release build which does not require stack trace

foxtacles avatar Jun 08 '17 08:06 foxtacles

it cannot find libbfd.a as its skipping incompatible. So I'm guessing its not a proper 32-bit version.

Langerz82 avatar Jun 08 '17 08:06 Langerz82

I'm getting the following errors when compiling the time module. Could it be because it needs x86_64-w64-mingw32-g++.exe to compile? I dont see in the Makefile where to rename the g++.exe

image

Langerz82 avatar Jun 08 '17 20:06 Langerz82

can you try this makefile?

https://github.com/foxtacles/vaultmp/blob/master/source/lib/time_makefile.windows

foxtacles avatar Jun 08 '17 20:06 foxtacles

Says no rule to make target.

image

Langerz82 avatar Jun 08 '17 20:06 Langerz82

I believe the makefile is in the wrong location, it uses relative pathes inside

make sure that the containing folder of the makefile + time\time64.c is a valid path to the source file. or adjust the pathes inside the makefile

foxtacles avatar Jun 08 '17 20:06 foxtacles

Fixed the paths now I'm getting 64-bit related errors even though it uses a 64-bit compiler.

image

Langerz82 avatar Jun 08 '17 20:06 Langerz82

Parsed in -std=c99 now the only warnings that appear are here: image Should I be concerned about them?

Langerz82 avatar Jun 08 '17 20:06 Langerz82

hmm yep that's an issue. gmtime_r and localtime_r are functions that should be called (not declared), they should be in time.h which should be included. not sure why it can't recognize them

foxtacles avatar Jun 08 '17 21:06 foxtacles

Trying to include the time.h header and includes doesn't help. Have I include the arguments in the right section? image

https://gist.github.com/Langerz82/a61b759dc494f7f40c10404dba1c6d45

Langerz82 avatar Jun 09 '17 12:06 Langerz82

are you sure that you checked out the correct git submodule commit? compare this file with yours:

https://github.com/foxtacles/y2038/blob/a05feb76f1a204a016a7e023a365ac71677cc558/time64_config.h#L44

foxtacles avatar Jun 09 '17 12:06 foxtacles

I commented out all 3 and it compiles ok. /* #define HAS_GMTIME_R / / #define HAS_LOCALTIME_R / / #define HAS_TIMEGM */

Langerz82 avatar Jun 09 '17 21:06 Langerz82

These are the errors I'm receiving when linking vaultmp.exe:

image

Langerz82 avatar Jun 09 '17 21:06 Langerz82

I was using ld.exe instead of g++ to link the libraries. Now I have only the following errors. It seems the iniparser cant be linked but I'm not sure why.

image

Langerz82 avatar Jun 12 '17 12:06 Langerz82

I think you also didn't check out the proper submodule commit in this case. just checking out the iniparser repository won't do, the submodule points to a specific commit (which contains slight changes to make the library work with vaultmp):

https://github.com/foxtacles/vaultmp/tree/master/source/lib

it says iniparser @ ce75430 if you click on it, it goes to the commit that needs to be checked out. take that state, re-compile the iniparser library and it should work

foxtacles avatar Jun 12 '17 12:06 foxtacles