udoprog / c10t

A minecraft cartography tool
Other
225 stars 50 forks source link

Build fails (likely Boost related?) #131

Closed pauldacheez closed 13 years ago

pauldacheez commented 13 years ago
[ 27%] Built target c10t-image
[ 31%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/blocks.cpp.o
[ 36%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/level.cpp.o
In file included from /Users/Paul/Desktop/minecraft_server/c10t/src/mc/world.hpp:13,
                 from /Users/Paul/Desktop/minecraft_server/c10t/src/mc/level.hpp:12,
                 from /Users/Paul/Desktop/minecraft_server/c10t/src/mc/level.cpp:3:
/Users/Paul/Desktop/minecraft_server/c10t/src/fileutils.hpp: In member function ‘bool dirlist::has_next(bool (*)(const std::string&), bool (*)(const std::string&))’:
/Users/Paul/Desktop/minecraft_server/c10t/src/fileutils.hpp:57: error: invalid initialization of reference of type ‘const std::string&’ from expression of type ‘boost::filesystem3::path’
make[2]: *** [src/mc/CMakeFiles/c10t-mc.dir/level.cpp.o] Error 1
make[1]: *** [src/mc/CMakeFiles/c10t-mc.dir/all] Error 2
make: *** [all] Error 2<code>

I get this pile of error when making c10t. I complied libpng 1.5.1 and installed cmake 2.8.2 by the default options (64-bit/10.6), but Boost 1.4.6 was compiled using the 32/64/10.5 script on the wiki in order to stop make from complaining about only having i386 Boost when trying to compile c10t in 64-bit. This error happens regardless of build arch. I have tried make clean. (I haven't tried cleaning cmake's buildfiles since there's no built-in clean tool and I haven't a clue what would need to be deleted.)

Running OS X 10.6.6, using built-in Terminal with built-in bash, have a Core 2 Duo "Merom", which is 64-bit.

Also, I'm pretty sure the issue tracker isn't the best place for support requests, but...

pauldacheez commented 13 years ago

I just looked around and realized that Boost 1.45 is causing problems. 1.46 should be just as problematic, eh?

I'll try using 1.44.

pauldacheez commented 13 years ago

Nope, same exact error.

berenm commented 13 years ago

Boost filesystem has recently changed its API and code needs to be rewritten to support boost filesystem v3, or a macro definition can be added before includes to use boost filesystem v2 instead when using boost >= 1.45. See: http://www.boost.org/doc/libs/1_46_0/libs/filesystem/v3/doc/index.htm

pauldacheez commented 13 years ago

sigh So I force Boost to use filesystem v3 and re-git clone the code for c10t. Now I get more error.

$ make
Scanning dependencies of target c10t-mc
[  4%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/blocks.cpp.o
[  9%] Building CXX object src/mc/CMakeFiles/c10t-mc.dir/level.cpp.o
In file included from /Users/Paul/Desktop/minecraft_server/c10t/src/mc/world.hpp:13,
                 from /Users/Paul/Desktop/minecraft_server/c10t/src/mc/level.hpp:12,
                 from /Users/Paul/Desktop/minecraft_server/c10t/src/mc/level.cpp:3:
/Users/Paul/Desktop/minecraft_server/c10t/src/fileutils.hpp: In member function ‘bool dirlist::has_next(bool (*)(const std::string&), bool (*)(const std::string&))’:
/Users/Paul/Desktop/minecraft_server/c10t/src/fileutils.hpp:57: error: invalid initialization of reference of type ‘const std::string&’ from expression of type ‘boost::filesystem3::path’
/usr/local/include/boost/system/error_code.hpp: At global scope:
/usr/local/include/boost/system/error_code.hpp:214: warning: ‘boost::system::posix_category’ defined but not used
/usr/local/include/boost/system/error_code.hpp:215: warning: ‘boost::system::errno_ecat’ defined but not used
/usr/local/include/boost/system/error_code.hpp:216: warning: ‘boost::system::native_ecat’ defined but not used
make[2]: *** [src/mc/CMakeFiles/c10t-mc.dir/level.cpp.o] Error 1
make[1]: *** [src/mc/CMakeFiles/c10t-mc.dir/all] Error 2
make: *** [all] Error 2

I think I should save myself the trouble and use a different mapper until a current OS X binary shows up, eh?

udoprog commented 13 years ago

I find it difficult to follow this bug up, seeing as I don't have a mac available.

I've successfully built c10t on a mac with boost 1.45 installed through macports, would you mind confirming or denying if that works for you?

pauldacheez commented 13 years ago

I'll try it. What's the MacPorts package name for 1.45?

pauldacheez commented 13 years ago

Er, wow, I found that out quickly. It's simply "boost."

pauldacheez commented 13 years ago

...It's still installing...

pauldacheez commented 13 years ago

...c10t successfully built. WHAT.

...I guess I just fail at installing Boost.

Now I'm rendering maps and getting this: libpng warning: Application built with libpng-1.4.5 but running with 1.5.1 Segmentation fault

I guess I also fail at installing libpng. I'll try updating it to the latest Macports version, then rebuilding.

pauldacheez commented 13 years ago

To clarify further, it renders properly, but segfaults when trying to save the files.

pauldacheez commented 13 years ago

MacPorts fails me here with libpng. Using 1.5.1 from libpng.org... Compiling with compatibility options... Recompiling c10t... Generating maps... ...same issue.

Uninstalling MacPorts libpng 1.4.5... Recompiling libpng 1.5.1 + c10t... c10t refuses to compile.

git clone https://github.com/udoprog/c10t.git... Compiling... CMake complains that /usr/bin/c++ is broken.

Restart instance of Terminal... Compiling... c10t refuses to compile. Evidently not recognizing the installation of libpng 1.5.1.

What to do now...

pauldacheez commented 13 years ago

Editing the makefile to include the dirs that the wiki page claims libpng installs itself in doesn't work, although I'd expect the compiler to already know to look in there.

pauldacheez commented 13 years ago

I've got no idea how to install libpng 1.5.1 and have it be recognized by the compiler. Any ideas, anyone?

pauldacheez commented 13 years ago

Last two or three git revisions of c10t looked promising. But updating and rebuilding gives me the same error as before...

...Which, I just realized, hasn't even been posted on this issue page.

Linking CXX static library libc10t-image.a
[ 47%] Built target c10t-image
Scanning dependencies of target c10t
[ 52%] Building CXX object src/CMakeFiles/c10t.dir/main.cpp.o
In file included from /Users/Paul/Desktop/minecraft_server/c10t/src/main.cpp:24:
/Users/Paul/Desktop/minecraft_server/c10t/src/image/format/png.hpp: In static member function ‘static bool png_format::save(image_base*, const std::string&, png_config&)’:
/Users/Paul/Desktop/minecraft_server/c10t/src/image/format/png.hpp:48: error: ‘Z_DEFAULT_STRATEGY’ was not declared in this scope
/opt/local/include/boost/system/error_code.hpp: At global scope:
/opt/local/include/boost/system/error_code.hpp:214: warning: ‘boost::system::posix_category’ defined but not used
/opt/local/include/boost/system/error_code.hpp:215: warning: ‘boost::system::errno_ecat’ defined but not used
/opt/local/include/boost/system/error_code.hpp:216: warning: ‘boost::system::native_ecat’ defined but not used
make[2]: *** [src/CMakeFiles/c10t.dir/main.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/c10t.dir/all] Error 2
make: *** [all] Error 2

None of these errors show up when I have libpng 1.4.5 installed from MacPorts. But libpng 1.5.1 doesn't seem to be on MacPorts.

pauldacheez commented 13 years ago

...I'm stuck until someone can help me here. Unless c10t is changed to require libpng 1.4.5 or above.

udoprog commented 13 years ago

I've successfully used the latest libpng + boost + zlib from macports, how do you install these libraries?

The following is what I do; port install libpng

It will give you the libraries under /opt/local/lib, if you have a conflicting library in your system, it will probably use that first. If you wish to debug this, just run make VERBOSE=1 and you'll see what cmake tries to do for you.

Other than that, you can add the option '-v' to gcc if you really want to go down and dirty, gcc is just a frontend to a whole bunch of tools.

pauldacheez commented 13 years ago

Now I see it. It was building with 1.4.5, but using the existing 1.5.1 libs that were still sitting around. I'll try deleting all the lib files I can find, and if that doesn't work, I'll build it on another Mac.

pauldacheez commented 13 years ago

...All will happen in about five hours, as I'm at school and I haven't forwarded the proper ports for VNC.

pauldacheez commented 13 years ago

Awwright, let's do this.

Removed all libpng-related files from every unix/macports-esque dir I could find... Installed MacPorts libpng... Building c10t... Complains about having i386 libpng and trying to build x86_64 c10t. Edit /opt/local/etc/macports/macports.conf to build x86_64 by default... sudo port uninstall -f libpng && sudo port install libpng... Building c10t... Complains about the i386 libpng again. Building c10t with cmake set to build in i386... COMPLAINS ABOUT i386 LIBPNG. Redo git clone of c10t... Building c10t...

ld: warning: duplicate dylib /opt/local/lib/libboost_thread-mt.dylib
ld: warning: duplicate dylib /opt/local/lib/libboost_filesystem-mt.dylib
ld: warning: duplicate dylib /opt/local/lib/libboost_system-mt.dylib
[100%] Built target c10t

Success!

Generating maps...

SUCCESS!!!!!!!!!!

.....Hey, they're much darker than my old maps. Last one I built was on 2/21.

pauldacheez commented 13 years ago

...Ah, it's just the elevation coloring. Anyway, I guess this issue can be closed.

udoprog commented 13 years ago

Real happy you got it running : ) - hope this has been an educational experience!

pauldacheez commented 13 years ago

It was very educational, indeed. Thanks for all your assistance.