Re: [MacPorts] #50713: unRAR 5.2.7 does nor build on Mac OS X 10.6.8, Snow Leopard, because "‘mprintf’ was not declared in this scope"

MacPorts noreply at macports.org
Thu Feb 25 03:34:53 PST 2016


#50713: unRAR 5.2.7 does nor build on Mac OS X 10.6.8, Snow Leopard, because
"‘mprintf’ was not declared in this scope"
------------------------------+--------------------------------
  Reporter:  Peter_Dyballa@…  |      Owner:  macports-tickets@…
      Type:  defect           |     Status:  new
  Priority:  Normal           |  Milestone:
 Component:  ports            |    Version:  2.3.4
Resolution:                   |   Keywords:
      Port:  unrar            |
------------------------------+--------------------------------

Comment (by Peter_Dyballa@…):

 After applying the suggested patch compilation stops again here:

 {{{
 /usr/bin/llvm-g++-4.2  -Os -DSILENT -DGUI -fPIC -arch x86_64
 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DRAR_SMP -DRARDLL -c
 unpack.cpp
 volume.cpp: In function ‘bool MergeArchive(Archive&, ComprDataIO*, bool,
 wchar)’:
 volume.cpp:123: error: ‘mprintf’ was not declared in this scope
 make: *** [volume.o] Error 1
 make: *** Waiting for unfinished jobs....
 list.cpp: In function ‘void ListArchive(CommandData*)’:
 list.cpp:41: error: ‘mprintf’ was not declared in this scope
 list.cpp:84: error: ‘mprintf’ was not declared in this scope
 list.cpp:127: error: ‘mprintf’ was not declared in this scope
 list.cpp:134: error: ‘mprintf’ was not declared in this scope
 list.cpp:141: error: ‘mprintf’ was not declared in this scope
 list.cpp:144: error: ‘mprintf’ was not declared in this scope
 list.cpp:162: error: ‘mprintf’ was not declared in this scope
 list.cpp:180: error: ‘mprintf’ was not declared in this scope
 list.cpp:182: error: ‘mprintf’ was not declared in this scope
 list.cpp: In function ‘void ListFileHeader(Archive&, FileHeader&, bool&,
 bool, bool, bool)’:
 list.cpp:199: error: ‘mprintf’ was not declared in this scope
 list.cpp:207: error: ‘mprintf’ was not declared in this scope
 list.cpp:212: error: ‘mprintf’ was not declared in this scope
 list.cpp:249: error: ‘mprintf’ was not declared in this scope
 list.cpp:388: error: ‘mprintf’ was not declared in this scope
 make: *** [list.o] Error 1
 make: Leaving directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_archivers_unrar/libunrar/work/unrar'
 Command failed:  cd
 "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_archivers_unrar/libunrar/work/unrar"
 && /usr/bin/make -j8 -w lib -f makefile CXX="/usr/bin/llvm-g++-4.2"
 DESTDIR=/opt/local CXXFLAGS="-Os -DSILENT -DGUI -fPIC -arch x86_64 "
 LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 "
 Exit code: 2
 Error: org.macports.build for port libunrar returned: command execution
 failed
 }}}

 After patching these errors come up:

 {{{

 /usr/bin/llvm-g++-4.2  -Os -DSILENT -DGUI -fPIC -arch x86_64
 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DRAR_SMP -DRARDLL -c
 filestr.cpp
 cmddata.cpp: In member function ‘void CommandData::ProcessSwitch(const
 wchar*)’:
 cmddata.cpp:410: error: ‘eprintf’ was not declared in this scope
 cmddata.cpp:643: error: ‘eprintf’ was not declared in this scope
 cmddata.cpp: In member function ‘void CommandData::BadSwitch(const
 wchar*)’:
 cmddata.cpp:900: error: ‘mprintf’ was not declared in this scope
 list.cpp: In function ‘void ListArchive(CommandData*)’:
 list.cpp:41: error: ‘mprintf’ was not declared in this scope
 /usr/bin/llvm-g++-4.2  -Os -DSILENT -DGUI -fPIC -arch x86_64
 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DRAR_SMP -DRARDLL -c
 recvol.cpp
 list.cpp:84: error: ‘mprintf’ was not declared in this scope
 list.cpp:127: error: ‘mprintf’ was not declared in this scope
 list.cpp:134: error: ‘mprintf’ was not declared in this scope
 list.cpp:141: error: ‘mprintf’ was not declared in this scope
 list.cpp:144: error: ‘mprintf’ was not declared in this scope
 list.cpp:162: error: ‘mprintf’ was not declared in this scope
 list.cpp:180: error: ‘mprintf’ was not declared in this scope
 list.cpp:182: error: ‘mprintf’ was not declared in this scope
 list.cpp: In function ‘void ListFileHeader(Archive&, FileHeader&, bool&,
 bool, bool, bool)’:
 list.cpp:199: error: ‘mprintf’ was not declared in this scope
 list.cpp:207: error: ‘mprintf’ was not declared in this scope
 list.cpp:212: error: ‘mprintf’ was not declared in this scope
 list.cpp:249: error: ‘mprintf’ was not declared in this scope
 list.cpp:388: error: ‘mprintf’ was not declared in this scope
 make: *** [cmddata.o] Error 1
 make: *** Waiting for unfinished jobs....
 make: *** [list.o] Error 1
 In file included from recvol.cpp:3:
 recvol3.cpp: In member function ‘bool RecVolumes3::Restore(RAROptions*,
 const wchar*, bool)’:
 recvol3.cpp:379: error: ‘LastPercent’ was not declared in this scope
 In file included from recvol.cpp:4:
 recvol5.cpp: In member function ‘bool RecVolumes5::Restore(RAROptions*,
 const wchar*, bool)’:
 recvol5.cpp:390: error: ‘LastPercent’ was not declared in this scope
 make: *** [recvol.o] Error 1
 make: Leaving directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_archivers_unrar/libunrar/work/unrar'
 Command failed:  cd
 "/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_archivers_unrar/libunrar/work/unrar"
 && /usr/bin/make -j8 -w lib -f makefile CXX="/usr/bin/llvm-g++-4.2"
 DESTDIR=/opt/local CXXFLAGS="-Os -DSILENT -DGUI -fPIC -arch x86_64 "
 LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 "
 Exit code: 2
 Error: org.macports.build for port libunrar returned: command execution
 failed
 }}}

 The function eprintf is also #define'd in consio.hpp, so let's try the
 same patch! Which leads to:

 {{{
 /usr/bin/llvm-g++-4.2  -Os -DSILENT -DGUI -fPIC -arch x86_64
 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DRAR_SMP -DRARDLL -c rs.cpp
 In file included from recvol.cpp:3:
 recvol3.cpp: In member function ‘bool RecVolumes3::Restore(RAROptions*,
 const wchar*, bool)’:
 recvol3.cpp:379: error: ‘LastPercent’ was not declared in this scope
 In file included from recvol.cpp:4:
 recvol5.cpp: In member function ‘bool RecVolumes5::Restore(RAROptions*,
 const wchar*, bool)’:
 recvol5.cpp:390: error: ‘LastPercent’ was not declared in this scope
 /usr/bin/llvm-g++-4.2  -Os -DSILENT -DGUI -fPIC -arch x86_64
 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DRAR_SMP -DRARDLL -c
 scantree.cpp
 make: *** [recvol.o] Error 1
 }}}

 `rdwrfn.hpp` seems to have its declaration. The same patch seems to be
 needed for this:

 {{{
 usr/bin/llvm-g++-4.2  -Os -DSILENT -DGUI -fPIC -arch x86_64
 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DRAR_SMP -DRARDLL -c qopen.cpp
 In file included from recvol.cpp:3:
 recvol3.cpp: In member function ‘bool RecVolumes3::Restore(RAROptions*,
 const wchar*, bool)’:
 recvol3.cpp:379: error: ‘LastPercent’ was not declared in this scope
 In file included from recvol.cpp:4:
 recvol5.cpp: In member function ‘bool RecVolumes5::Restore(RAROptions*,
 const wchar*, bool)’:
 recvol5.cpp:391: error: ‘LastPercent’ was not declared in this scope
 make: *** [recvol.o] Error 1
 }}}

 but it fails, because the actual cause are these lines:

 {{{
   343  #ifndef GUI
   344        int LastPercent=-1;
   345        mprintf(L"     ");
   346     #endif
 }}}

 and the compile command with `CXXFLAGS="-Os -DSILENT -DGUI -fPIC -arch
 x86_64"`. So we need to put the line

 {{{
   344        int LastPercent=-1;
 }}}

 outside of the `#ifndef GUI` clause? Well, I tried that, and unRAR
 compiled. I only do not know whether this is correct…

 All patch files, including that for Portfile will be attached!

-- 
Ticket URL: <https://trac.macports.org/ticket/50713#comment:1>
MacPorts <https://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list