Opened 18 years ago

Closed 18 years ago

#6575 closed defect (worksforme)

BUG: c++ code does not compile

Reported by: mammon_@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.0
Keywords: Cc:
Port:

Description

OS X 10.4.4 XCode 2.2.0 Ports version 1.200

# port selfupdate DarwinPorts base version 1.200 installed Downloaded DarwinPorts base version 1.200 The DarwinPorts installation is not outdated and so was not updated # port install id3v2 ---> Fetching id3lib ---> Attempting to fetch id3lib-3.8.3.tar.gz from http://puzzle.dl.sourceforge.net/id3lib ---> Verifying checksum(s) for id3lib ---> Extracting id3lib ---> Configuring id3lib Error: Target com.apple.configure returned: configure failure: shell command "cd "/opt/local/var/db/dports/build/_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_audio_id3lib/work/id3lib-3.8.3" && ./configure --prefix=/opt/local" returned error 1 Command output: checking iconv.h presence... yes checking for iconv.h... yes checking where to find iconv_open... libiconv checking whether iconv takes const char or char ... const char checking whether to typecast in iconv... no checking libcw/sys.h usability... no checking libcw/sys.h presence... no checking for libcw/sys.h... no checking cctype usability... no checking cctype presence... no checking for cctype... no checking climits usability... no checking climits presence... no checking for climits... no checking cstdio usability... no checking cstdio presence... no checking for cstdio... no checking cstdlib usability... no checking cstdlib presence... no checking for cstdlib... no checking bitset usability... no checking bitset presence... no checking for bitset... no checking cstring usability... no checking cstring presence... no checking for cstring... no checking fstream usability... no checking fstream presence... no checking for fstream... no configure: error: Missing a vital header file for id3lib - download them here: http://gcc.gnu.org/libstdc++/ or better - compile a newer compiler like gcc3.x

Error: The following dependencies failed to build: id3lib Error: /opt/local/bin/port: Status 1 encountered during processing.

I rooted around in /opt/local, found Ports versions of g++ and gcc, symlnked them and tested on a tarball of the same library. /opt/local/bin# ln -s /opt/local/bin/g++-dp-4.0 /opt/local/bin/g++ /opt/local/bin# ln -s /opt/local/bin/gcc-dp-4.0 /opt/local/bin/gcc $ CXX=/opt/local/bin/g++ ./configure --prefix=/opt/local

worked fine.

ran port install again to create this bug report, and it worked fine. # port install id3lib ---> Configuring id3lib ---> Building id3lib with target all ---> Staging id3lib into destroot ---> Packaging tgz archive for id3lib 3.8.3_0 ---> Installing id3lib 3.8.3_0 ---> Activating id3lib 3.8.3_0 ---> Cleaning id3lib

you need to either create symlinks in /opt/local/bin when installing the compilers, or fix the environment used by port install to reference them, or find way to actuslly make this work on the command line.

Change History (4)

comment:1 Changed 18 years ago by mww@…

Summary: c++ code does not compileBUG: c++ code does not compile

are you really on 10.0??? If so, we'll have to remark that dp officially only supports 10.3 and 10.4 right now - we will integrate patches for older versions of OS X if supplied, but it is not regarded as a bug if stuff won't work on older them. Adding the symlinks to our gcc-suits will probably create quite some havoc among users of 10.3 and 10.4 if they install one of the dp-gccs; also you then won't be able to install any pairing of gcc33/34/40/41/42 simultaneously.

comment:2 Changed 18 years ago by mammon_@…

op_sys: Mac OS X 10.0Mac OS X 10.4

sorry, was in a rush, didn't see the OS drop-down box. as mentioned in the post, I am on 10.4.4 with XCode 2.2.0 installed [upgraded to 2.2.1 since the post].

my understanding was that ports would use the XCode tools, and while they work fine for C programs, they fail for C++ -- probably just need to tweak the environment.

i realized this when my coworker bought a powerbook and i talked him through installing darwin ports. i'd had no problems, but he tried to build a c++ program [forget which] and it failed. A week later i saw the same problem on my box, decided to report it.

as i was in the thick of being pissed off at itunes, i didn't try to fix the xcode env -- just got the build working with the symlinks that i mentioned. obviously the proper fix is to make xcode work, assuming that port uses it [documentation claims to, but after the last day of mucking with os x id3 utilities, i don't believe docs any more].

it may help to point out that what fails is #include <iostream>. i tried a simple hello world on the command line and it failed. looks like the latest xcode changed something...

comment:3 Changed 18 years ago by blb@…

id3lib builds fine here with Xcode 2.2.1; can you post the config.log generated by id3lib?

comment:4 Changed 18 years ago by mww@…

Resolution: worksforme
Status: newclosed

strange error: can't reproduce, reporter is unwilling to provide hard data (e. g. config.log)

if things change, please feel free to re-open this bug;

Note: See TracTickets for help on using tickets.