Opened 14 months ago

Last modified 14 months ago

#64555 assigned defect

ncpp is not using the right compiler or flags

Reported by: ryandesign (Ryan Schmidt) Owned by: mf2k (Frank Schima)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc:
Port: ncpp

Description

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.

Change History (2)

comment:1 Changed 14 months ago by mf2k (Frank Schima)

I tried to set it. I'll see what I can do. I have zero interest in ancient operating systems though.

comment:2 Changed 14 months ago by ryandesign (Ryan Schmidt)

Please do still have an interest in using the right compiler and flags, however. Doing so enables many MacPorts capabilities, only one of which is support for older operating systems.

Note: See TracTickets for help on using tickets.