Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Cannot convert from 'libconfig::Setting' to 'std::basic_string #196

Closed
luxtau opened this Issue · 7 comments

3 participants

luxtau David Nadlinger Kai Nacke
luxtau

Really dont know, why, because Setting provides conversion operator to the std::string.

Patch:



diff --git a/driver/configfile.cpp b/driver/configfile.cpp
index 3cec6b8..6f548bf 100644
--- a/driver/configfile.cpp
+++ b/driver/configfile.cpp
@@ -148,7 +148,7 @@ bool ConfigFile::read(const char* argv0, void* mainAddr, const char* filename)
             int len = arr.getLength();
             for (int i=0; i<len; i++)
             {
-                std::string v = arr[i];
+                std::string v = arr[i].c_str();
 
                 // replace binpathkey with binpath
                 size_t p;


David Nadlinger
Owner

Which compiler is this on? Also, your patch seems to be cut off – the easiest way to avoid that is to just submit it as a pull request.

luxtau

MSVC 11 (VS 2012).

As for pull request — fork, re-download, patch, pull request, delete repo — too many steps instead of just diff-copy-post..

Kai Nacke
Owner

I am aware of this problem because I am using VS 2012, too. I am going to commit my solution.

Kai Nacke
Owner

Fixed with my commit.

Kai Nacke redstar closed this
luxtau

Fixed with my commit.

ldc2 crashed at configfile.cpp:161 with this commit.

arr[i].c_str() works fine.

Kai Nacke
Owner

Please, what crashes? The rebuild in VS2012 works fine. Also the Travis build has no errors.

Kai Nacke redstar reopened this
Kai Nacke redstar was assigned
luxtau

My fail, it crashed when ldc was linked with libconfig++.dll from VS2008.

luxtau luxtau closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.