udoprog / c10t

A minecraft cartography tool
Other
225 stars 50 forks source link

Broken build in fileutils.hpp #168

Closed Sephrin closed 13 years ago

Sephrin commented 13 years ago

The extra call to .string() appears to be erroneous as i received

/home/ryan/work/c10t/c10t/src/fileutils.hpp: In member function 'bool dirlist::hasnext(bool ()(const std::string&), bool (_)(const std::string&))': /home/ryan/work/c10t/c10t/src/fileutils.hpp:57: error: 'struct std::basic_string<char, std::char_traits, std::allocator >' has no member named 'string'

when compiling with master.
I am using boost 1.42, zlib 1.2.5, libpng 1.4.5, and libfreetype 2.4.4

I have sucesfully compiled all targets by removing the string() call. Patch follows

From 8121a14d86a7a596a0204f890634183ef17c5ccc Mon Sep 17 00:00:00 2001 From: Ryan Lake ryan@tmrlake.com Date: Mon, 16 May 2011 19:44:33 -0600 Subject: [PATCH] Program was making an extra member call to string()

Path was already returning a std::basic_string calling string() on that was breaking the build.

src/fileutils.hpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/fileutils.hpp b/src/fileutils.hpp index bfad108..3b8f2a7 100644 --- a/src/fileutils.hpp +++ b/src/fileutils.hpp @@ -54,7 +54,7 @@ public: directories.push(itr->path()); } else if (fs::is_regular_file(itr->status())) {

1.7.4.1

udoprog commented 13 years ago

This works in boost lte 1.45. However, It's been changed with fillesystem v3, or boost 1.46. Maybe it would be possible to use some type of define guard to salvage the day?

Sephrin commented 13 years ago

Im not that familiar with cmake but ill look into getting a define set, that would be the best way to go about it. boost > 1.42 is still in testing for gentoo so im sure 1.42 is still the main release for quite a few distros.

Sephrin commented 13 years ago

Sorry blurry eyes make for dumb clicks.

Sephrin commented 13 years ago

From c8156f20235bd27e477326ddd7acf15310d0e05a Mon Sep 17 00:00:00 2001 From: Ryan Lake ryan@tmrlake.com Date: Tue, 17 May 2011 00:29:12 -0600 Subject: [PATCH] Added a BOOST_VERSION check to allow < 1.46 to compile

With boost < 1.46 ite->path().filename() is all thats needed with

= 1.46 ite->path().filename().string() is needed.

src/fileutils.hpp | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/fileutils.hpp b/src/fileutils.hpp index bfad108..5a0648d 100644 --- a/src/fileutils.hpp +++ b/src/fileutils.hpp @@ -54,7 +54,11 @@ public: directories.push(itr->path()); } else if (fs::is_regular_file(itr->status())) {

1.7.4.1

Sephrin commented 13 years ago

I have tested this with both boost 1.42 and 1.46, looks like it works. :)

udoprog commented 13 years ago

Commit 8b36c302bf1a9372537ec81da1e9cec85a085a5c should solve this issue, thanks for the help on this.