Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Jul 1998 15:37:18 -0700
From:      Terry Lambert <terry@whistle.com>
To:        obrien@FreeBSD.ORG, jdp@FreeBSD.ORG, freebsd-ports@FreeBSD.ORG
Subject:   gcc/g++ 2.8.1 port maintainers/modifiers
Message-ID:  <35A1519D.60D4@whistle.com>

next in thread | raw e-mail | index | archive | help
There appears to be a problem with the non-installation of the
include files in the port.

Specifically, the include file "typeinfo" is not installed,
and it seems that there is not a sperate installation of a
"include/g++28/" directory, in general, and that an installed
"/usr/local/bin/g++28" therefore uses the previous "g++"
includes, which are for g++ 2.7.2.

This results in failures when attempting to use runtime type
information (RTTI).  This is just the most obvious failure;
I am sure there are other compiler/include file mismatches...


Specifically, things like:

#include <typeinfo>

// pseudocode... too lazy, too obvious, takes too much space...
class foo {
    ...
};

class fee : public foo {
    ...
};

class fum : public foo {
   ...
};

// real code follows...
void
gettype( char *s, foo *obj)
{
    if( typeid(foo) == typeid(*obj))
	printf( "object named '%s' is of type foo\n", s);
    else if( typeid(fee) == typeid(*obj))
	printf( "object named '%s' is of type fee\n", s);
    else
	printf( "object named '%s' is an unknown subclass (%s), s,
		typeid(*obj).name);
}

main()
{
    foo *foo1;
    fee *foo2;
    fum *foo3;

    foo1 = new foo;
    foo2 = new fee;
    foo3 = new fum;

    gettype( "foo1", foo1);
    gettype( "foo2", foo2);
    gettype( "foo3", foo3);
}

Fail because the wrong <typeinfo> gets included.

This works correctly when you use the gnu configure based install.


I recommend making the compiler reference an ./include/g++28/
directory, and installing the correct include hierarchy there,
wherever that is (probably /usr/local/) to resolve the problem.

Sorry, I don't have patches; I don't quite follow the way the
ports are supposed to actually work, and am too buried to be
able to pitch in on fixing the port.  8-(.

-- Regards,
-- Terry Lambert
-- Whistle Communications, Inc.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?35A1519D.60D4>