View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0004638 | Spring engine | Mac OS X | public | 2014-12-20 18:38 | 2015-01-03 15:52 | ||||
Reporter | moobyfr | ||||||||
Assigned To | jK | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Product Version | 98.0.1+git | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0004638: Compile error with gcc4.8 | ||||||||
Description | Hi I'm trying to get spring back on OS X 10.10. (I used "brew" to get all required libraries) I'm stuck at this error, which is perhaps similar to http://springrts.com/mantis/view.php?id=4347 [ 38%] Building CXX object rts/builds/legacy/CMakeFiles/engine-legacy.dir/__/__/ExternalAI/SkirmishAIHandler.cpp.o In file included from /Volumes/Stockage/Users/e.blindauer/tmp/spring/rts/System/creg/creg.h:373:0, from /Volumes/Stockage/Users/e.blindauer/tmp/spring/rts/System/creg/creg_cond.h:16, from /Volumes/Stockage/Users/e.blindauer/tmp/spring/rts/Game/Players/TeamController.h:6, from /Volumes/Stockage/Users/e.blindauer/tmp/spring/rts/ExternalAI/SkirmishAIBase.h:6, from /Volumes/Stockage/Users/e.blindauer/tmp/spring/rts/ExternalAI/SkirmishAIData.h:6, from /Volumes/Stockage/Users/e.blindauer/tmp/spring/rts/ExternalAI/SkirmishAIHandler.h:6, from /Volumes/Stockage/Users/e.blindauer/tmp/spring/rts/ExternalAI/SkirmishAIHandler.cpp:3: /Volumes/Stockage/Users/e.blindauer/tmp/spring/rts/System/creg/TypeDeduction.h: In instantiation of 'boost::shared_ptr<creg::IType> creg::DeduceTypeClass<T>::Get() [with T = long unsigned int]': /Volumes/Stockage/Users/e.blindauer/tmp/spring/rts/System/creg/STL_Map.h:105:104: required from 'boost::shared_ptr<creg::IType> creg::DeduceType<std::map<TKey, TValue> >::Get() [with TKey = long unsigned int; TValue = int]' /Volumes/Stockage/Users/e.blindauer/tmp/spring/rts/System/creg/TypeDeduction.h:135:20: required from 'boost::shared_ptr<creg::IType> creg::GetType(T&) [with T = std::map<long unsigned int, int>]' /Volumes/Stockage/Users/e.blindauer/tmp/spring/rts/ExternalAI/SkirmishAIHandler.cpp:22:1: required from here /Volumes/Stockage/Users/e.blindauer/tmp/spring/rts/System/creg/TypeDeduction.h:20:111: error: 'StaticClass' is not a member of 'long unsigned int' boost::shared_ptr<IType> Get() { return boost::shared_ptr<IType>(IType::CreateObjInstanceType(T::StaticClass())); } ^ make[2]: *** [rts/builds/legacy/CMakeFiles/engine-legacy.dir/__/__/ExternalAI/SkirmishAIHandler.cpp.o] Error 1 make[1]: *** [rts/builds/legacy/CMakeFiles/engine-legacy.dir/all] Error 2 make: *** [all] Error 2 | ||||||||
Tags | No tags attached. | ||||||||
Checked infolog.txt for Errors | |||||||||
Attached Files |
|
Notes | |
abma (administrator) 2014-12-20 18:53 Last edited: 2014-12-20 18:58 |
which version of spring are you tring to compile? also are you sure gcc 4.8 is used? |
moobyfr (reporter) 2014-12-21 21:47 |
I'm sure about using gcc4.8 (4.8.3 to be precise, got it from brew. 4.7 isn't installable on yosemite) I'm on the "develop" branch |
lamer (reporter) 2014-12-25 17:59 |
I confirm this with gcc4.9, OS X 10.10 Also ran a size test on archlinux and OS X: printf("long long unsigned int: %i\n", sizeof(long long unsigned int)); printf("long unsigned int: %i\n", sizeof(long unsigned int)); printf("unsigned int: %i\n", sizeof(unsigned int)); printf("boost::uint64_t: %i\n", sizeof(boost::uint64_t)); printf("unsigned short: %i\n", sizeof(unsigned short)); printf("char: %i\n", sizeof(char)); printf("float: %i\n", sizeof(float)); printf("double: %i\n", sizeof(double)); printf("bool: %i\n", sizeof(bool)); printf("size_t: %i\n", sizeof(size_t)); Both systems have same results: long long unsigned int: 8 long unsigned int: 8 unsigned int: 4 boost::uint64_t: 8 unsigned short: 2 char: 1 float: 4 double: 8 bool: 1 size_t: 8 So why this issue doesn't occur on Linux? My quickfix is to add CREG_SUPPORT_BASIC_TYPE(long unsigned int, crUInt64) in https://github.com/spring/spring/blob/340f70ecad9263c44ab655cb08c9dba91e17f611/rts/System/creg/TypeDeduction.h#L46-L56 But don't know if that is correct as http://springrts.com/mantis/view.php?id=4347 suggests to replace all size_t with "unsigned int". |
cleanrock (reporter) 2014-12-26 14:41 |
I think the problem you ran into is what they talk about here: http://stackoverflow.com/questions/11603818/why-is-there-ambiguity-between-uint32-t-and-uint64-t-when-using-size-t-on-mac-os Looks like jk removed long support because long can be 32 and 64 bits depending on platform: https://github.com/spring/spring/commit/97f3aa1 "fix `unsigned long` 32/64 bit conflict in creg" Perhaps we should avoid using size_t in CREG-stuff (like kloots quick fix), let's see what jk says. You could try to replace size_t with unsigned int in SkirmishAIHandler: std::map<size_t, int> id_dieReason; typedef std::map<size_t, SkirmishAIKey> id_libKey_t; |
lamer (reporter) 2014-12-26 15:53 |
More about sizes https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/64bitPorting/transition/transition.html http://stackoverflow.com/questions/384502/what-is-the-bit-size-of-long-on-64-bit-windows So it is removing size_t from CREG. Still not sure if it's correct as kloot wrote "quickfix". |
abma (administrator) 2015-01-02 16:42 |
https://github.com/spring/spring/pull/147 |
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2014-12-20 18:38 | moobyfr | New Issue | |
2014-12-20 18:53 | abma | Note Added: 0013870 | |
2014-12-20 18:58 | abma | Note Edited: 0013870 | View Revisions |
2014-12-21 21:47 | moobyfr | Note Added: 0013873 | |
2014-12-25 17:59 | lamer | Note Added: 0013874 | |
2014-12-26 14:41 | cleanrock | Note Added: 0013875 | |
2014-12-26 15:53 | lamer | Note Added: 0013876 | |
2015-01-02 16:42 | abma | Note Added: 0013878 | |
2015-01-02 16:42 | abma | Status | new => resolved |
2015-01-02 16:42 | abma | Resolution | open => fixed |
2015-01-02 16:42 | abma | Assigned To | => abma |
2015-01-03 15:52 | jK | Changeset attached | => spring release 39542e35 |
2015-01-03 15:52 | jK | Assigned To | abma => jK |