3582 Build Errors, OS X 10.6

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Message
Author
neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: 3582 Build Errors, OS X 10.6

#31 Post by neuro »

After a whole bunch of adventures with compiling GG, then trying to compile and install Boost 1.45, then compiling OGRE and installing those libraries...

I was able to get Boost 1.45 libraries compiled and installed (in my /usr/local/include and /usr/local/lib)!

I've looked at the steps here (http://www.freeorion.org/index.php/Compile_In_Linux) to get GG running now... It throws two "could not be found" for OGRE and OIS (after a sojourn THERE to try to get OGRE installed and running - fail - I tabled it and came back).

I had to revert GG to r 853 based on these steps, just to get it to compile properly.

Compiling GG only gives me one error and I think it has to do with filesystems...

ld: warning: ignoring file /sw/lib/libfreetype.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: ignoring file /sw/lib/libtiff.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
"_FT_Done_FreeType", referenced from:
___tcf_17 in Font.cpp.o
"_FT_New_Memory_Face", referenced from:
GG::Font::GetFace(std::vector<unsigned char, std::allocator<unsigned char> > const&, FT_FaceRec_*&)in Font.cpp.o
GG::Font::Font(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, std::vector<unsigned char, std::allocator<unsigned char> > const&)in Font.cpp.o
GG::Font::Font<__gnu_cxx::__normal_iterator<GG::UnicodeCharset*, std::vector<GG::UnicodeCharset, std::allocator<GG::UnicodeCharset> > > >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, std::vector<unsigned char, std::allocator<unsigned char> > const&, __gnu_cxx::__normal_iterator<GG::UnicodeCharset*, std::vector<GG::UnicodeCharset, std::allocator<GG::UnicodeCharset> > >, __gnu_cxx::__normal_iterator<GG::UnicodeCharset*, std::vector<GG::UnicodeCharset, std::allocator<GG::UnicodeCharset> > >)in Font.cpp.o
"_FT_New_Face", referenced from:
GG::Font::GetFace(FT_FaceRec_*&) in Font.cpp.o
GG::Font::Font(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)in Font.cpp.o
GG::Font::Font<__gnu_cxx::__normal_iterator<GG::UnicodeCharset*, std::vector<GG::UnicodeCharset, std::allocator<GG::UnicodeCharset> > > >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, __gnu_cxx::__normal_iterator<GG::UnicodeCharset*, std::vector<GG::UnicodeCharset, std::allocator<GG::UnicodeCharset> > >, __gnu_cxx::__normal_iterator<GG::UnicodeCharset*, std::vector<GG::UnicodeCharset, std::allocator<GG::UnicodeCharset> > >)in Font.cpp.o
"_FT_Done_Face", referenced from:
GG::detail::FTFaceWrapper::~FTFaceWrapper()in Font.cpp.o
GG::detail::FTFaceWrapper::~FTFaceWrapper()in Font.cpp.o
GG::Font::Font(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, std::vector<unsigned char, std::allocator<unsigned char> > const&)in Font.cpp.o
GG::Font::Font(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)in Font.cpp.o
GG::Font::Font<__gnu_cxx::__normal_iterator<GG::UnicodeCharset*, std::vector<GG::UnicodeCharset, std::allocator<GG::UnicodeCharset> > > >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, std::vector<unsigned char, std::allocator<unsigned char> > const&, __gnu_cxx::__normal_iterator<GG::UnicodeCharset*, std::vector<GG::UnicodeCharset, std::allocator<GG::UnicodeCharset> > >, __gnu_cxx::__normal_iterator<GG::UnicodeCharset*, std::vector<GG::UnicodeCharset, std::allocator<GG::UnicodeCharset> > >)in Font.cpp.o
GG::Font::Font<__gnu_cxx::__normal_iterator<GG::UnicodeCharset*, std::vector<GG::UnicodeCharset, std::allocator<GG::UnicodeCharset> > > >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, __gnu_cxx::__normal_iterator<GG::UnicodeCharset*, std::vector<GG::UnicodeCharset, std::allocator<GG::UnicodeCharset> > >, __gnu_cxx::__normal_iterator<GG::UnicodeCharset*, std::vector<GG::UnicodeCharset, std::allocator<GG::UnicodeCharset> > >)in Font.cpp.o
"_FT_Get_Char_Index", referenced from:
GG::Font::GenerateGlyph(FT_FaceRec_*, unsigned int)in Font.cpp.o
"_FT_Load_Glyph", referenced from:
GG::Font::GenerateGlyph(FT_FaceRec_*, unsigned int)in Font.cpp.o
"_FT_Render_Glyph", referenced from:
GG::Font::GenerateGlyph(FT_FaceRec_*, unsigned int)in Font.cpp.o
"_FT_Set_Char_Size", referenced from:
GG::Font::Init(FT_FaceRec_*&) in Font.cpp.o
"_FT_MulFix", referenced from:
GG::Font::Init(FT_FaceRec_*&) in Font.cpp.o
"_FT_Init_FreeType", referenced from:
__static_initialization_and_destruction_0(int, int)in Font.cpp.o
"_TIFFGetField", referenced from:
boost::gil::detail::tiff_reader::get_dimensions() in Texture.cpp.o
...
...more errors
...


And now, when I compile FreeOrion in XCode, only one batch of errors in one file :

FileDlg.cpp

/Users/dominictancredi/Downloads/freeorion-sdk/FreeOrion/Xcode/../GG/src/dialogs/FileDlg.cpp:119: error: invalid initialization of reference of type 'const std::string&' from expression of type 'boost::filesystem3::path'

/Users/dominictancredi/Downloads/freeorion-sdk/FreeOrion/Xcode/../GG/src/dialogs/FileDlg.cpp:115: error: in passing argument 1 of 'bool<unnamed>::WindowsRoot(const std::string&)'

/Users/dominictancredi/Downloads/freeorion-sdk/FreeOrion/Xcode/../GG/src/dialogs/FileDlg.cpp:342: error: 'complete' is not a member of 'fs'

etc.


I think if I can disable or comment out the issues HERE I should be golden. Any suggestions?

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: 3582 Build Errors, OS X 10.6

#32 Post by Geoff the Medio »

I don't think using GG 853 is going to work properly with up-to-date FreeOrion... That's almost 200 revisions old. The point of using 853 in the instructions was to avoid the need for GG 1.44, but you've already build 1.45, so why is it necessary?

Also, the "could not be found" errors were about CMake... Have you abandoned the XCode existing projects and are trying to generate your own using CMake now?

Your GG undefined symbols problems appear to be related to the library warnings immediate above them. It looks like you need a version of the FreeType library compiled for your architecture?

Based on this change to GG, you may need to be using the latest GG to avoid the FileDlg.cpp errors with never Boost versions.

You can possibly comment out a bunch of problematic code in FileDlg.cpp if you don't mind having nonfunctional file dialogs, but Font.cpp and Texture.cpp need to be functional.

neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: 3582 Build Errors, OS X 10.6

#33 Post by neuro »

Ok, I did a lot of trial-and-error to try to get at least something working....

First, I re-updated my GG back to r 1041 (i.e. svn update).

Did a make clean and then cmake .
Got this output :

Dominic-Tancredis-MacBook-Pro:GG dominictancredi$ cmake .
-- Build platform: macos
-- Configuring GiGi
-- Configuring GiGiSDL
-- Configuring GiGiOgre
-- checking for one of the modules 'OGRE'
Warning: Ogre could not be found. Disabling the Ogre build.
-- Configuring Ogre OIS Input Plugin
-- checking for one of the modules 'OIS'
Warning: OIS could not be found. Disabling the OIS build.
-- Configuring Tests
-- Boost version: 1.45.0
-- Found the following Boost libraries:
-- unit_test_framework
-- Generating Doxygen documentation
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/dominictancredi/Downloads/freeorion-sdk/FreeOrion/GG


So yes, things are missing, but after trying to solve the Ogre + OIS issues, I just went to XCode to try to build (as a tangent, yes I tried to compile through the terminal, in an attempt to find ANY way to build FreeOrion. But it failed on this issue :

-- checking for module 'GiGi'
-- package 'GiGi' not found
CMake Error at CMakeLists.txt:83 (message):
GiGi library not found.


I opened up XCode, cleaned the project, and then re-built.
Now, I have an 18 errors in MultiplayerCommon.cpp but nowhere else (so far) :

/Users/dominictancredi/Downloads/freeorion-sdk/FreeOrion/Xcode/../util/MultiplayerCommon.cpp:36: error: 'class boost::filesystem3::path' has no member named 'directory_string'
/Users/dominictancredi/Downloads/freeorion-sdk/FreeOrion/Xcode/../util/MultiplayerCommon.cpp:54: error: 'class boost::filesystem3::path' has no member named 'file_string'
/Users/dominictancredi/Downloads/freeorion-sdk/FreeOrion/Xcode/../util/MultiplayerCommon.cpp:492: error: 'class boost::filesystem3::directory_entry' has no member named 'filename'
etc.


I'm using the right Boost library, correct? 1.45? But FO is not happy with the filesystem lib I think I compiled with it. Some searching led me to a few boost-related errors potentially with the lib-filesystem.

My goal is to just get this project back on it's feet and compiling so I can get to tackling a MapWnd issue on the wiki that I've been eyeing for a long-time now. Is there any way I can work-around these issues I'm having? I can't tell how close or how far I am from getting an actual, factual working build.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: 3582 Build Errors, OS X 10.6

#34 Post by Geoff the Medio »

neuro wrote:/Users/dominictancredi/Downloads/freeorion-sdk/FreeOrion/Xcode/../util/MultiplayerCommon.cpp:36: error: 'class boost::filesystem3::path' has no member named 'directory_string'
/Users/dominictancredi/Downloads/freeorion-sdk/FreeOrion/Xcode/../util/MultiplayerCommon.cpp:54: error: 'class boost::filesystem3::path' has no member named 'file_string'
These appear to be related to differences between the filesystem2 and filesystem3 Boost libraries. Try replacing the directory_string and file_string on those lines with just string.
/Users/dominictancredi/Downloads/freeorion-sdk/FreeOrion/Xcode/../util/MultiplayerCommon.cpp:492: error: 'class boost::filesystem3::directory_entry' has no member named 'filename'
Similarly, replace filename() with path().filename()

These changes are discussed here: http://www.boost.org/doc/libs/1_46_1/li ... cated.html

You should be able to search for the deprecated functions and their replacements based on the error messages you're getting, just as I have...

neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: 3582 Build Errors, OS X 10.6

#35 Post by neuro »

Thanks for the reference. I updated the deprecated commands like you suggested.

It helped remove a lot of the errors, but there are 2 remaining, and it sounds silly, but I can't seem to debug them.

MultiplayerCommon.cpp

Code: Select all

if (fs::exists(*it) && !fs::is_directory(*it) && it->path().filename()[0] != '.') {
                std::string filename = it->path().filename();

No match for 'operator[]' in 'boost::filesystem3::path::filename() const()[0]'
and
Conversion from 'boost::filesystem3::path' to non-scalar type 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >' requested


Which has to do with using the iterator to call the path().filename() method, instead of filename(). I tried variations of this, but I can't seem to understand how boost wants me to call this method within a method. Seems like chaining.

There's still 76 issues in GG (the same issues I've seen in this post and this post. I think I'm just not compiling it right, and have gone to trying to re-compile it in the terminal using make / cmake. I'm not an expert at this so it's challenging.

I can't tell if I've installed libogre properly and that's the issue, or if it's my version of boost (which I'm pretty sure I'm using the right version, excluding the filesystem updates for v3).

Maybe I should work on an earlier revision of FO? Or are there any developers on a Mac OS X Leopard system using XCode that would have any advice on compiling?

EDIT

Also, should I be using scons instead as per these instructions for compiling GG?

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: 3582 Build Errors, OS X 10.6

#36 Post by Geoff the Medio »

neuro wrote:...should I be using scons...
No; the SCons method is no longer supported, and I don't think it was ever actually working on OSX.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: 3582 Build Errors, OS X 10.6

#37 Post by Geoff the Medio »

neuro wrote:No match for 'operator[]' in 'boost::filesystem3::path::filename() const()[0]'
and
Conversion from 'boost::filesystem3::path' to non-scalar type 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >' requested
After filename() try adding .native()

Code: Select all

std::string filename = it->path().filename().native()
and

Code: Select all

...  it->path().filename().native()[0] != '.'
If the latter gives any problems, just remove it and the preceeding && :

Code: Select all

if (fs::exists(*it) && !fs::is_directory(*it)) {

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: 3582 Build Errors, OS X 10.6

#38 Post by Geoff the Medio »

neuro wrote:There's still 76 issues in GG (the same issues I've seen in this post
I think that first one - with boost gil problems - is a boost version issue. Make sure you're compiling against a newer version of boost, especially if you've got multiple versions on the same system and potentially old project files... This doesn't make much sense to me though, as you seem to be using a later version of boost elsewhere?
and this post.
I'm not sure why that's still a problem... Do you have BOOST_FILESYSTEM_VERSION == 3 defined? The same fix I suggested above should be used if it is defined... so... hmm. Maybe removed the #if block and just use the version of the code with .native() added to the end of that line?

Edit: I switched the default in my local boost/filesystem/operations.hpp file (in Boost 1.44) to use BOOST_FILESYSTEM_VERSION == 3 and am getting the same error building (MSVC 2010), so it's not just you... /Edit

Edit2: Try changing all the .native() to .string() in this and anywhere else that I suggested adding a .native() /Edit2

Edit3: Possibly including lines 120, 353, 689, 723 and 745 of FileDlg.cpp and numerous places in FreeOrion-specific code. /Edit3

Edit4: The attached patch fixes the compile errors in GG code on my Win32 build, and would presumably deal with the issues in XCode as well... /Edit4
Attachments

[The extension patch has been deactivated and can no longer be displayed.]


neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: 3582 Build Errors, OS X 10.6

#39 Post by neuro »

Ok, this was really helpful! Thank you!

First, I hunted for what you said, and finally updated my default BOOST_FILESYSTEM_VERSION to 3 in my XCode/dep/local/include/boost/filesystem/operations.hpp (it was at 2). I.e.:

# define BOOST_FILESYSTEM_VERSION 3

I noticed you committed a fix via SVN and updated to that (r 3994) because that included a lot of the updates you posted about.
I checked the patch file you posted here, and hand-compared it to what I had updated to SVN and it all looks good.

All the above got rid of the MultiPlayer.cpp errors, leaving me only with the 75-80 or so issues in GG compiling.

I re-compiled my boost library (1.45 I believe) to my /usr/local/include and /usr/local/lib and then copied both the "lib" and the "include/boost" files into my local xcode dependencies (probably wasn't necessary but I think just changing the BOOST_FILESYSTEM_VERSION 3 in the .hpp file wasn't enough to absolutely make sure I had the right compiled boost library.)

I think you're right about the multiple versions of Boost probably causing the error. I deleted the files in my "/usr/lib" and "/usr/local/lib" as well as "/usr/include" and "/usr/local/include". It should only be using the libraries + includes in my dependencies folder. It's still showing the errors so I'm going to keep hunting and trying to solve this.

neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: 3582 Build Errors, OS X 10.6

#40 Post by neuro »

Also, when I built boost, this was my initial output log... maybe there's something up with icu or some clue in here :


Dominic-Tancredis-MacBook-Pro:boost_1_45_0_beta1 dominictancredi$ sudo ./bjam install --libdir=/usr/lib
Password:
Performing configuration checks

- has_icu builds : no
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam
- ../config//has_gcc_visibility builds : yes
- ../config//has_long_double_support builds : yes
warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.

Component configuration:

- date_time : building
- filesystem : building
- graph : building
- graph_parallel : building
- iostreams : building
- math : building
- mpi : building
- program_options : building
- python : building
- random : building
- regex : building
- serialization : building
- signals : building
- system : building
- test : building
- thread : building
- wave : building

...patience...
...patience...
...patience...
...patience...
...found 23145 targets...
...updating 8175 targets...
common.mkdir /usr/local/include/boost
[a ton of copying files later...]

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: 3582 Build Errors, OS X 10.6

#41 Post by Geoff the Medio »

neuro wrote:All the above got rid of the MultiPlayer.cpp errors, leaving me only with the 75-80 or so issues in GG compiling.
Are these the GIL errors from here: viewtopic.php?p=37815#p37815 ?

Do you have GG_HAVE_LIBPNG defined? It should be defined to 1, which will cause includes for GIL stuff in Texture.cpp to be active.

neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: 3582 Build Errors, OS X 10.6

#42 Post by neuro »

I do have it defined... to 0. Ugh.

This is the Config.h file in the root of my project :


/** \file Config.h \brief Contains build-generated configuration macros used
throughout GG. */

#ifndef _GG_Config_h_
#define _GG_Config_h_


#define GG_USE_DEVIL_IMAGE_LOAD_LIBRARY 0
#define GG_HAVE_LIBJPEG 0
#define GG_HAVE_LIBPNG 0
#define GG_HAVE_LIBTIFF 0

#endif // _GG_Config_h_


I changed GG_HAVE_LIBPNG to 1 and re-compiled, and it got rid of a bunch of those errors!

Now, it's down to 2 errors in static_move_ptr.hpp in the FreeOrionClient part of the build.

/Users/dominictancredi/Downloads/freeorion-sdk/FreeOrion/Xcode/dep/local/include/boost/ptr_container/detail/static_move_ptr.hpp:154:50: error: macro "check" passed 2 arguments, but takes just 1
/Users/dominictancredi/Downloads/freeorion-sdk/FreeOrion/Xcode/dep/local/include/boost/ptr_container/detail/static_move_ptr.hpp:154: error: function definition does not declare parameters


that happens in here :

private:
template<typename TT, typename DD>
void check(const static_move_ptr<TT, DD>& ptr)
{
typedef move_ptrs::is_smart_ptr_convertible<TT, T> convertible;
BOOST_STATIC_ASSERT(convertible::value);
}


I'm going to research and see what could cause this. But thank you!

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: 3582 Build Errors, OS X 10.6

#43 Post by Geoff the Medio »

neuro wrote:I do have [Config.h] defined... to 0. Ugh.
There's something that sets that file up during a config step... Maybe using CMake without setting appropriate options reset it?
/Users/dominictancredi/Downloads/freeorion-sdk/FreeOrion/Xcode/dep/local/include/boost/ptr_container/detail/static_move_ptr.hpp:154:50: error: macro "check" passed 2 arguments, but takes just 1
/Users/dominictancredi/Downloads/freeorion-sdk/FreeOrion/Xcode/dep/local/include/boost/ptr_container/detail/static_move_ptr.hpp:154: error: function definition does not declare parameters
A quick google search for "static_move_ptr.hpp:154:50: error: macro" turns up a bunch of hits, so that's probably not a FreeOrion specific problem, and is likely something someone else has noticed. Looks like there's a "check" macro on OSX that's conflicting with one in Boost. You might try undefining check before whatever line includes that Boost header, or undefining in XCode if possible.

neuro
Space Squid
Posts: 74
Joined: Sun Mar 07, 2010 10:17 pm

Re: 3582 Build Errors, OS X 10.6

#44 Post by neuro »

Good call. I've been googling the issue.
I found a note here about the check issue.

The fix for me was to change this :

Code: Select all

void check(const static_move_ptr<TT, DD>& ptr)
to this :

Code: Select all

void check_(const static_move_ptr<TT, DD>& ptr)
The compile for that went through! However, I'm now debugging FreeOrionServer issues (26) in graph_concepts.hpp and concept_check.hpp :

/Users/dominictancredi/Downloads/freeorion-sdk/FreeOrion/Xcode/dep/local/include/boost/graph/graph_concepts.hpp:64: error: 'boost::concepts::requirement<boost::concepts::failed************ Model::************>::failed [with Model = boost::concepts::usage_requirements<boost::concepts::Graph<boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, boost::property<<unnamed>::vertex_system_id_t, int, boost::property<boost::vertex_index_t, int, boost::no_property> >, boost::property<boost::edge_weight_t, double, boost::no_property>, boost::no_property, boost::listS> > >]' is not a valid template argument for type 'void (*)()' because function 'static void boost::concepts::requirement<boost::concepts::failed************ Model::************>::failed() [with Model = boost::concepts::usage_requirements<boost::concepts::Graph<boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, boost::property<<unnamed>::vertex_system_id_t, int, boost::property<boost::vertex_index_t, int, boost::no_property> >, boost::property<boost::edge_weight_t, double, boost::no_property>, boost::no_property, boost::listS> > >]' has not external linkage


The lines for that issue are 49-50 on graph_concepts.hpp (1 of 26):

Code: Select all

BOOST_CONCEPT_USAGE(MultiPassInputIterator) {
            BOOST_CONCEPT_ASSERT((InputIterator<T>));
        }
Googling that as well to see what the issue might be. I found a reference over here about compiling now on GCC 4.2 with the new boost 1.46 (or I'm on 1.45) but trying to see if what they suggest is possible...

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: 3582 Build Errors, OS X 10.6

#45 Post by Geoff the Medio »

neuro wrote:The fix for me was to change this :

Code: Select all

void check(const static_move_ptr<TT, DD>& ptr)
to this :

Code: Select all

void check_(const static_move_ptr<TT, DD>& ptr)
The problem with that is that is requires a code change in (I think) Boost. It would be better to use an XCode define or code change in FreeOrion (such as undefining check) so it works even with unmodified boost code.

Post Reply