Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build broken in Code::Blocks. #11293

Closed
Rivet-the-Zombie opened this issue Feb 17, 2015 · 12 comments

Comments

Projects
None yet
6 participants
@Rivet-the-Zombie
Copy link
Member

commented Feb 17, 2015

Ugly brick of error code:

||=== Build: Release in Cataclysm (compiler: GNU GCC Compiler) ===
C:\CDDA\src\json.h||In instantiation of 'bool JsonIn::read(T&) [with T = std::setstd::basic_string; typename std::enable_if<std::is_same<typename T::key_type, typename T::value_type>::value, void>::type* = 0u]':
C:\CDDA\src\json.h|594|required from 'bool JsonObject::read(const string&, T&) [with T = std::setstd::basic_string; std::string = std::basic_string]'
C:\CDDA\src\savegame_json.cpp|1090|required from here
C:\CDDA\src\json.h|268|error: 'class std::setstd::basic_string' has no member named 'emplace'
C:\CDDA\src\json.h||In instantiation of 'bool JsonIn::read(T&) [with T = std::set; typename std::enable_if<std::is_same<typename T::key_type, typename T::value_type>::value, void>::type* = 0u]':
C:\CDDA\src\json.h|594|required from 'bool JsonObject::read(const string&, T&) [with T = std::set; std::string = std::basic_string]'
C:\CDDA\src\savegame_json.cpp|1351|required from here
C:\CDDA\src\json.h|268|error: 'class std::set' has no member named 'emplace'
||=== Build failed: 2 error(s), 6 warning(s) (7 minute(s), 23 second(s)) ===

@KA101

This comment has been minimized.

Copy link
Contributor

commented Feb 17, 2015

Been out for a few days: MinGW32 issue. I've been running the Backup Compiler. Sick of having to make the same argument repeatedly.

@Rivet-the-Zombie Rivet-the-Zombie added this to the 0.C milestone Feb 17, 2015

@bkentel

This comment has been minimized.

Copy link
Contributor

commented Feb 17, 2015

Looking into it.

@bkentel

This comment has been minimized.

Copy link
Contributor

commented Feb 17, 2015

Hmm, clearly std::set does have emplace: http://en.cppreference.com/w/cpp/container/set .
What version of gcc?

@bkentel

This comment has been minimized.

Copy link
Contributor

commented Feb 17, 2015

If this is indeed related to mingw using an older version of GCC, a fix would be to use insert instead of emplace either specifically for old versions of libstdc++, or in general.

@bkentel

This comment has been minimized.

Copy link
Contributor

commented Feb 17, 2015

Looks like it's fixed as of GCC 4.8?

@MattAmmann

This comment has been minimized.

Copy link
Contributor

commented Feb 17, 2015

This error was fixed in later versions of the GCC than what CBP comes with. I was able to fix this error by downloading and installing the latest GCC release (4.9.2) from TDM-GCC's website. When I changed the compiler path to the install path of that program, the error went away and the code compiled.

@i2amroy

This comment has been minimized.

Copy link
Member

commented Feb 17, 2015

Yeah, it's an older/incomplete version of GCC (which, strangely enough, doesn't affect the Cygwin build the usual victim of these type of problems :P).

From what I could see the answer is exactly as Matt outlined it, just download and install a newer version of GCC.

@MattAmmann

This comment has been minimized.

Copy link
Contributor

commented Feb 17, 2015

To further clarify, download the 32-bit version. Also, the path that needs to be changed in CBP is here: Setting->Compiler->Toolchain Executables tab. Change the "Compiler's installation directory" to the bin folder where TDM-GCC was installed. For example, mine is C:\Program Files (x86)\TDM-GCC-32\bin.

@Rivet-the-Zombie

This comment has been minimized.

Copy link
Member Author

commented Feb 17, 2015

I had to update C::B at the same time to make it work, but @MattAmmann's fix worked for me.

This still seems like a bit of a hurdle for new contributors to cross. Is there no better alternative?

@KA101

This comment has been minimized.

Copy link
Contributor

commented Feb 17, 2015

This still seems like a bit of a hurdle for new contributors to cross. Is there no better alternative?

Changing the code would be preferable.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Feb 18, 2015

@kevingranade

This comment has been minimized.

Copy link
Member

commented Feb 21, 2015

Removed call to set.emplace().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.