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

runtime_error is not a member of std #17

Closed
Malvineous opened this issue Nov 2, 2015 · 4 comments
Closed

runtime_error is not a member of std #17

Malvineous opened this issue Nov 2, 2015 · 4 comments

Comments

@Malvineous
Copy link
Contributor

Hi - just trying out the latest git version, and I get these errors when compiling now:

workbook/manifest.cpp: In member function ‘std::string xlnt::manifest::get_default_type(const string&) const’
workbook/manifest.cpp:105:15: error: ‘runtime_error’ is not a member of ‘std’
         throw std::runtime_error("no default type found for extension: " + extension);
               ^
workbook/manifest.cpp: In member function ‘std::string xlnt::manifest::get_override_type(const string&) const’
workbook/manifest.cpp:118:15: error: ‘runtime_error’ is not a member of ‘std’
         throw std::runtime_error("no default type found for part name: " + part_name);

Which I fixed by doing this:

diff --git a/source/workbook/manifest.cpp b/source/workbook/manifest.cpp
index 1209ef1..1ea5ba0 100644
--- a/source/workbook/manifest.cpp
+++ b/source/workbook/manifest.cpp
@@ -1,5 +1,6 @@
 #include <algorithm>

+#include <xlnt/common/exceptions.hpp>
 #include <xlnt/workbook/manifest.hpp>

 namespace {
@Malvineous
Copy link
Contributor Author

Also just got a compile error in the test code (not with CMake, but with autoconf, so not sure whether this file is included in the CMake tests?)

diff --git a/tests/helpers/temporary_file.hpp b/tests/helpers/temporary_file.hpp
index 481a7f9..110b978 100644
--- a/tests/helpers/temporary_file.hpp
+++ b/tests/helpers/temporary_file.hpp
@@ -4,7 +4,7 @@
 #include <cstdio>
 #include <string>

-#include <detail/include_windows.hpp>
+#include <xlnt/detail/include_windows.hpp>

 #include "path_helper.hpp"

@tfussell
Copy link
Owner

tfussell commented Nov 3, 2015

Not sure how those slipped by me. I'll update them this evening. Also, thanks for giving it a try. Always nice to hear that someone is using the library.

@tfussell
Copy link
Owner

tfussell commented Nov 3, 2015

The missing include in manifest.cpp has been added in a2919df. For the second one, instead of changing tests/helpers/temporary_file.hpp, you can also add /source as an include directory when configuring with autoconf so it can find the source/detail headers. My using source as an include directory is somewhat unusual so I might move those headers eventually.

@Malvineous
Copy link
Contributor Author

Thanks for the explanation! I figure tests are a bit unusual anyway in that they need more access to the code than you might make available through the public API, so having the source directory as an include path is probably not that unusual! (In my own code I do things like #include "../source/blah.hpp" which is perhaps even worse!)

@sukoi26 sukoi26 mentioned this issue Oct 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants