Opened 12 years ago

Closed 8 years ago

#37237 closed defect (fixed)

widelands @build17: error: ‘void Widelands::Ship::set_fleet(Widelands::Fleet*)’ is private

Reported by: gilles.risch@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: tiger leopard haspatch Cc: ryandesign (Ryan Carsten Schmidt)
Port: widelands

Description

I just tried in install widelands build17 on my PowerBook G4 with Max OS X version 10.5.8 but the build process fails. The build log is attached.

Kind regards, Gilles

Attachments (4)

main.log (129.4 KB) - added by gilles.risch@… 12 years ago.
Portfile (3.0 KB) - added by gilles.risch@… 12 years ago.
small workaround
Portfile.diff (192 bytes) - added by gilles.risch@… 12 years ago.
Portfile-widelands.diff (628 bytes) - added by gilles.risch@… 12 years ago.

Download all attachments as: .zip

Change History (15)

Changed 12 years ago by gilles.risch@…

Attachment: main.log added

comment:1 Changed 12 years ago by mf2k (Frank Schima)

Keywords: ppc leopard added; widelands powerpc build failure removed

comment:2 Changed 12 years ago by gilles.risch@…

Hello,

building the game manually as it is described on the widelands wiki page (http://wl.widelands.org/wiki/BuildingWidelands/#building_under_mac_os_x) isn´t successful either. Here´s the output:

...

  -> Release mode selected
 
-- The C compiler identification is GNU 4.0.1
-- The CXX compiler identification is GNU 4.0.1
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Disabled Unit Tests
-- Boost version: 1.52.0
-- Found the following Boost libraries:
--   signals
-- Using compiler flags: -O3 -DNDEBUG
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework  
-- Found PythonInterp: /opt/local/bin/python (found version "2.7.3") 
-- Version of Widelands Build is bzr6441[widelands](Release)
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.3") 
-- Found PNG: /opt/local/lib/libpng.dylib (found version "1.5.13") 
-- SDLMAIN_LIBRARY is 
-- Found SDLIMAGE: /opt/local/lib/libSDL_image.dylib  
-- Found SDLMIXER: /opt/local/lib/libSDL_mixer.dylib  
-- Found SDLNET: /opt/local/lib/libSDL_net.dylib  
-- Found SDLTTF: /opt/local/lib/libSDL_ttf.dylib  
-- Found Lua51: /opt/local/lib/liblua.dylib (found version "5.1.4") 
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
Doxygen not found, disabling 'make doc'
CMake Warning at src/minizip/CMakeLists.txt:3 (message):
  You are using widelands-bundled minizip sources.  Please install your
  distribution's minizip library or urge your distribution maintainer to
  include the minizip library in your package repository.  Thank you.


-- Configuring done
-- Generating done
-- Build files have been written to: /Users/roodemol/Downloads/widelands/build
Scanning dependencies of target BzrRevision
-- Version of Widelands Build is bzr6441[widelands](Release)
[  0%] Built target BzrRevision
Scanning dependencies of target translang_zh_CN
[  0%] Generating translations for locale zh_CN category maps
...

[ 69%] Building CXX object src/CMakeFiles/widelands_all.dir/economy/flag.cc.o
/Users/roodemol/Downloads/widelands/src/ui_basic/panel.h:246: warning: 'hot' attribute directive ignored
/Users/roodemol/Downloads/widelands/src/ui_basic/button.h:72: warning: 'hot' attribute directive ignored
[ 69%] Building CXX object src/CMakeFiles/widelands_all.dir/economy/fleet.cc.o
/Users/roodemol/Downloads/widelands/src/ui_basic/panel.h:246: warning: 'hot' attribute directive ignored
/Users/roodemol/Downloads/widelands/src/ui_basic/button.h:72: warning: 'hot' attribute directive ignored
/Users/roodemol/Downloads/widelands/src/economy/fleet.cc: In member function 'virtual void Widelands::Fleet::Loader::load_pointers()':
/Users/roodemol/Downloads/widelands/src/logic/ship.h:106: error: 'void Widelands::Ship::set_fleet(Widelands::Fleet*)' is private
/Users/roodemol/Downloads/widelands/src/economy/fleet.cc:697: error: within this context
/Users/roodemol/Downloads/widelands/src/economy/portdock.h:106: error: 'void Widelands::PortDock::set_fleet(Widelands::Fleet*)' is private
/Users/roodemol/Downloads/widelands/src/economy/fleet.cc:701: error: within this context
make[2]: *** [src/CMakeFiles/widelands_all.dir/economy/fleet.cc.o] Error 1
make[1]: *** [src/CMakeFiles/widelands_all.dir/all] Error 2
make: *** [all] Error 2

It seams that the error is inside the fleet.cc. I used the gcc version 4.0.1 (Apple Inc. build 5493).

Kind regards, Gilles

Last edited 12 years ago by gilles.risch@… (previous) (diff)

comment:3 in reply to:  2 ; Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: tiger added; ppc removed
Summary: Widelands does not build on my PowerBook G4 with Mac OS X 10.5.8widelands: error: ‘void Widelands::Ship::set_fleet(Widelands::Fleet*)’ is private

Replying to gilles.risch@…:

building the game manually as it is described on the widelands wiki page (http://wl.widelands.org/wiki/BuildingWidelands/#building_under_mac_os_x) isn´t successful either.

Then it's not a MacPorts-specific problem, and should be reported to the developers of widelands to be fixed.

error: ‘void Widelands::Ship::set_fleet(Widelands::Fleet*)’ is private

This reminds me of an error I saw with harfbuzz 0.9.5 which was also only occurring with gcc 4.0.1 and other older compilers. That problem was "fixed" in harfbuzz 0.9.6. I have not yet investigated what they changed to make it work.

comment:4 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

It looks like they just did they obvious, and marked those members as public instead of private:

diff -ru harfbuzz-0.9.5/src/hb-ot-layout-common-private.hh harfbuzz-0.9.6/src/hb-ot-layout-common-private.hh
--- harfbuzz-0.9.5/src/hb-ot-layout-common-private.hh	2012-09-15 20:16:08.000000000 -0500
+++ harfbuzz-0.9.6/src/hb-ot-layout-common-private.hh	2012-11-12 13:16:45.000000000 -0600
@@ -403,6 +403,8 @@
       glyphs->add (glyphArray[i]);
   }
 
+  public:
+  /* Older compilers need this to be public. */
   struct Iter {
     inline void init (const struct CoverageFormat1 &c_) { c = &c_; i = 0; };
     inline bool more (void) { return i < c->glyphArray.len; }
@@ -414,6 +416,7 @@
     const struct CoverageFormat1 *c;
     unsigned int i;
   };
+  private:
 
   protected:
   USHORT	coverageFormat;	/* Format identifier--format = 1 */
@@ -497,6 +500,8 @@
       rangeRecord[i].add_coverage (glyphs);
   }
 
+  public:
+  /* Older compilers need this to be public. */
   struct Iter {
     inline void init (const CoverageFormat2 &c_) {
       c = &c_;
@@ -522,6 +527,7 @@
     const struct CoverageFormat2 *c;
     unsigned int i, j, coverage;
   };
+  private:
 
   protected:
   USHORT	coverageFormat;	/* Format identifier--format = 2 */

comment:5 in reply to:  3 ; Changed 12 years ago by gilles.risch@…

This reminds me of an error I saw with harfbuzz 0.9.5 which was also only occurring with gcc 4.0.1 and other older compilers. That problem was "fixed" in harfbuzz 0.9.6. I have not yet investigated what they changed to make it work.

That said I tried a different compiler that has been installed by macports (acPorts apple-gcc42 5666.3_9). With that compiler the code compiled, with more or less warnings, but it did not link the object files:

$sudo port -v install  widelands configure.compiler=apple-gcc-4.2

...

[100%] Building CXX object src/CMakeFiles/widelands.dir/main.cc.o
[100%] Building CXX object src/CMakeFiles/widelands.dir/build_info.cc.o
Linking CXX executable widelands
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.5.o
     (maybe you meant: cstring=center_mainview_here, cstring=center_main_mapview_on_location , Editor_Interactive::toggle_mainmenu()       , _SDL_main )
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [src/widelands] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_games_widelands/widelands/work/widelands-build17-src/build'
make[1]: *** [src/CMakeFiles/widelands.dir/all] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_games_widelands/widelands/work/widelands-build17-src/build'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_games_widelands/widelands/work/widelands-build17-src/build'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_games_widelands/widelands/work/widelands-build17-src/build" && /usr/bin/make -w all 
Exit code: 2

...

comment:6 in reply to:  4 Changed 12 years ago by gilles.risch@…

Replying to ryandesign@…:

It looks like they just did they obvious, and marked those members as public instead of private:

diff -ru harfbuzz-0.9.5/src/hb-ot-layout-common-private.hh harfbuzz-0.9.6/src/hb-ot-layout-common-private.hh
--- harfbuzz-0.9.5/src/hb-ot-layout-common-private.hh	2012-09-15 20:16:08.000000000 -0500
+++ harfbuzz-0.9.6/src/hb-ot-layout-common-private.hh	2012-11-12 13:16:45.000000000 -0600
@@ -403,6 +403,8 @@
       glyphs->add (glyphArray[i]);
   }
 
+  public:
+  /* Older compilers need this to be public. */
   struct Iter {
     inline void init (const struct CoverageFormat1 &c_) { c = &c_; i = 0; };
     inline bool more (void) { return i < c->glyphArray.len; }
@@ -414,6 +416,7 @@
     const struct CoverageFormat1 *c;
     unsigned int i;
   };
+  private:
 
   protected:
   USHORT	coverageFormat;	/* Format identifier--format = 1 */
@@ -497,6 +500,8 @@
       rangeRecord[i].add_coverage (glyphs);
   }
 
+  public:
+  /* Older compilers need this to be public. */
   struct Iter {
     inline void init (const CoverageFormat2 &c_) {
       c = &c_;
@@ -522,6 +527,7 @@
     const struct CoverageFormat2 *c;
     unsigned int i, j, coverage;
   };
+  private:
 
   protected:
   USHORT	coverageFormat;	/* Format identifier--format = 2 */

I also tried this suggestion and changed "set_fleet(Widelands::Fleet*)" from private to public inside ship.h and portdock.h. Wideland compiled with gcc 4.0.1 but did not link neither, same error as with apple-gcc42.

comment:7 in reply to:  5 Changed 12 years ago by gilles.risch@…

Linking CXX executable widelands
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.5.o
     (maybe you meant: cstring=center_mainview_here, cstring=center_main_mapview_on_location , Editor_Interactive::toggle_mainmenu()       , _SDL_main )
ld: symbol(s) not found

...

I found the solution to this problem. I had an old version of libsdl in the /Library/Frameworks/ directory and the linker preferred that over the one installed by macports. After removing it, the installation of the port worked. -> the port should be build with gcc 4.2 or higher.

Changed 12 years ago by gilles.risch@…

Attachment: Portfile added

small workaround

comment:8 Changed 12 years ago by gilles.risch@…

Hello,

I have uploaded a suggestion for a portfile to compile Wideland on Max OS X 10.5.8. It simply replaces gcc 4.0 with gcc4.2. This should work an all Leopard installations because gcc 4.2 is included in the latest running Xcode release.

Regards, Gilles

comment:9 Changed 12 years ago by mf2k (Frank Schima)

Please attach a unified diff of the portfile against trunk so we can see what changes you made.

Changed 12 years ago by gilles.risch@…

Attachment: Portfile.diff added

comment:10 Changed 12 years ago by gilles.risch@…

I hope that one helps.

Changed 12 years ago by gilles.risch@…

Attachment: Portfile-widelands.diff added

comment:11 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Keywords: haspatch added
Resolution: fixed
Status: newclosed
Summary: widelands: error: ‘void Widelands::Ship::set_fleet(Widelands::Fleet*)’ is privatewidelands @build17: error: ‘void Widelands::Ship::set_fleet(Widelands::Fleet*)’ is private

The default compiler was changed to gcc42 for Leopard (r92109) and to apple-gcc42 for Tiger (r115646) so there should no longer be a case where gcc40 is used so this problem should no longer arise.

Note: See TracTickets for help on using tickets.