[MacPorts] #64555: ncpp is not using the right compiler or flags

MacPorts noreply at macports.org
Fri Jan 28 20:24:50 UTC 2022


#64555: ncpp is not using the right compiler or flags
------------------------+----------------------
 Reporter:  ryandesign  |      Owner:  mf2k
     Type:  defect      |     Status:  assigned
 Priority:  Normal      |  Milestone:
Component:  ports       |    Version:  2.7.1
 Keywords:              |       Port:  ncpp
------------------------+----------------------
 ncpp is not using the right compiler or flags therefore it fails to build
 on older systems that require those flags.

 https://build.macports.org/builders/ports-10.8_x86_64-builder/builds/79152/steps
 /install-port/logs/stdio

 {{{
 g++ -o raf/ACconfig.o -c -g -Wall -std=c++11 -Wno-write-strings -Wno-
 deprecated-register -g -Wall -Wno-write-strings -DPNG -I.
 -I/opt/X11/include -I/opt/local/include raf/ACconfig.cc
 g++ -o raf/PMSspex.o -c -g -Wall -std=c++11 -Wno-write-strings -Wno-
 deprecated-register -g -Wall -Wno-write-strings -DPNG -I.
 -I/opt/X11/include -I/opt/local/include raf/PMSspex.cc
 g++ -o raf/Queue.o -c -g -Wall -std=c++11 -Wno-write-strings -Wno-
 deprecated-register -g -Wall -Wno-write-strings -DPNG -I.
 -I/opt/X11/include -I/opt/local/include raf/Queue.cc
 g++ -o raf/TextFile.o -c -g -Wall -std=c++11 -Wno-write-strings -Wno-
 deprecated-register -g -Wall -Wno-write-strings -DPNG -I.
 -I/opt/X11/include -I/opt/local/include raf/TextFile.cc
 raf/TextFile.cc:13:17: error: no matching constructor for initialization
 of 'std::ifstream' (aka 'basic_ifstream<char>')
   std::ifstream file(filename);
                 ^    ~~~~~~~~
 /usr/include/c++/4.2.1/fstream:465:7: note: candidate constructor not
 viable: no known conversion from 'const std::string' (aka 'const
 basic_string<char>') to 'const char *' for 1st argument
       basic_ifstream(const char* __s, ios_base::openmode __mode =
 ios_base::in)
       ^
 /usr/include/c++/4.2.1/bits/fstream.tcc:894:25: note: candidate
 constructor (the implicit copy constructor) not viable: no known
 conversion from 'const std::string' (aka 'const basic_string<char>') to
 'const std::basic_ifstream<char>' for 1st argument
   extern template class basic_ifstream<char>;
                         ^
 /usr/include/c++/4.2.1/fstream:451:7: note: candidate constructor not
 viable: requires 0 arguments, but 1 was provided
       basic_ifstream() : __istream_type(), _M_filebuf()
       ^
 1 error generated.
 scons: *** [raf/TextFile.o] Error 1
 }}}

 The port makes some effort to manually set build args for the compiler to
 use, but then overwrites those args with others. It doesnt seem to have
 any code to use the right flags.

 Using the makefile 1.0 portgroup can help you use the right compiler and
 flags.

-- 
Ticket URL: <https://trac.macports.org/ticket/64555>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list