OpenXcom Forum
Contributions => Programming => Topic started by: JDarthenay on April 25, 2016, 11:38:06 pm
-
Hello.
I am trying to build OpenXCom, it seems there is an error with what I got from GitHub:
g++ -Wall -Wextra -std=gnu++11 -O3 -I../yaml-cpp-0.5.3/include -ID:\Prog\msys64\mingw32\include\SDL -c -o obj/x86/release/BaseInfoState.o src/Basescape/BaseInfoState.cpp
src/Basescape/BaseInfoState.cpp: In member function 'virtual void OpenXcom::BaseInfoState::init()':
src/Basescape/BaseInfoState.cpp:302:49: error: 'floor' was not declared in this scope
ss5 << (int)floor(_base->getUsedStores() + 0.05) << ":" << _base->getAvailableStores();
^
makefile:81: recipe for target 'obj/x86/release/BaseInfoState.o' failed
mingw32-make: *** [obj/x86/release/BaseInfoState.o] Error 1
Did I made something wrong when I used "fecth" with TortoiseGit?
-
Fixed.
-
I wounder about applied fix #1216 (https://github.com/SupSuper/OpenXcom/commit/8c9985c57146d001561615869ee88800c878a523) that not reverted but crashes a game. In bug tracker you can found three crash reports that related to fix #1216. So you need also revert that commit if you want to get a stable build.
-
I don't understand. I tried using "fetch" again, now I am looking "show log", I don't see the same commits than those on GitHub.
Edit: I have exactly the same error as yesterday, I must be doing something wrong...
-
Ok, now I think I grabbed last code:
g++ -Wall -Wextra -std=gnu++11 -O3 -I../yaml-cpp-0.5.3/include -ID:\Prog\msys64\mingw32\include\SDL -c -o obj/x86/release/CraftInfoState.o src/Basescape/CraftInfoState.cpp
src/Basescape/CraftInfoState.cpp: In member function 'virtual void OpenXcom::CraftInfoState::init()':
src/Basescape/CraftInfoState.cpp:167:96: error: 'ceil' was not declared in this scope
int damageHours = (int)ceil((double)_craft->getDamage() / _craft->getRules()->getRepairRate());
^
src/Basescape/CraftInfoState.cpp:176:135: error: 'ceil' was not declared in this scope
int fuelHours = (int)ceil((double)(_craft->getRules()->getMaxFuel() - _craft->getFuel()) / _craft->getRules()->getRefuelRate() / 2.0);
^
src/Basescape/CraftInfoState.cpp:238:119: error: 'ceil' was not declared in this scope
int rearmHours = (int)ceil((double)(w1->getRules()->getAmmoMax() - w1->getAmmo()) / w1->getRules()->getRearmRate());
^
src/Basescape/CraftInfoState.cpp:277:119: error: 'ceil' was not declared in this scope
int rearmHours = (int)ceil((double)(w2->getRules()->getAmmoMax() - w2->getAmmo()) / w2->getRules()->getRearmRate());
^
makefile:81: recipe for target 'obj/x86/release/CraftInfoState.o' failed
mingw32-make: *** [obj/x86/release/CraftInfoState.o] Error 1
I am a bit lazy at the moment and trying to focus on conceiving my makefile, could I have the date of a commit which successfully build?
-
yaml-cpp-0.5.3
Use yaml-cpp-0.5.1. Only OXCE or OXCE+ can be complied with newer version of yaml-cpp without modifications to source code.
-
https://openxcom.org/forum/index.php/topic,4452.msg61234.html#msg61234
https://openxcom.org/forum/index.php/topic,4452.msg61236.html#msg61236
And I was indeed able to build with yaml-cpp 0.5.3 a few days ago... But I don't remember when I have to go back to exactly.
-
Looks like it's this commit that's giving you trouble: https://github.com/SupSuper/OpenXcom/commit/75772c81fcc5782c33329c7195a5428f81297808
I'll revise what includes are missing, though you probably shouldn't build with "-std=gnu++11" as we don't use any C++11 features AFAIK.
-
Oh it's true, I remember reading something about that. What is recommended standard?
Edit: Well actually, it seems I need -std=gnu++11 because of yam-cpp 0.5.3, or maybe because of the way I built it.
-
Don't bother adding includes, I am currently doing it, and I will try to send a Pull Request.
-
Well, it seems I can't directly pull from my PC to your GitHub repository... Do I need to fork your GitHub repository to pull to it, and then pull from my GitHub repository to yours?
Anyway, I think I successfully computed a .patch file.
-
Well, now I have have linking problems, but that is because I am now trying to use packages from MSYS2, and I am not sure I can mix SDL.dll with SDL_mixer static build...
-
So I probably have all those problems with missing includes because using yaml-cpp 0.5.3 which seems to put less standard includes in its own headers.
As I'm not the only one using yaml-cpp 0.5.3, I figure I can continue fixing them and pushing those fixes, at least as long as those are only adding standard includes. But I wonder how often I should check this and push those minor fixes. As often as I can? No more than once a day/week/month?