This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

HP-UX 10.20 & g++ 2.95.2: Have to use -threads


Hi folks,

I tried to find this in your FAQs, but without luck: If I want
to compile a tiny C++ program (see attachment) on HP-UX 10.20 using
g++ 2.95.2, then I have to use -threads on the g++ command line

	% g++ -o tiny tiny.C -threads
	%

When I skip the -threads, then I get some undefined symbols

	% g++ -o tiny tiny.C         
	/usr/ccs/bin/ld: Unsatisfied symbols:
	   pthread_once (code)
	   pthread_setspecific (code)
	   pthread_getspecific (code)
	   pthread_keycreate (code)
	collect2: ld returned 1 exit status
	%

It seems that libgcc.a as well as threads/libgcc.a contain references
to libcma.1, even when I configured gcc with --disable-threads.

If I can help you in any way to figure this out (or if this is
already known and I was too blind to find the workaround), then
please send me a note.


Many thanx

Harri
-- 
Harald Dunkel | harri@Synopsys.COM | If your operating system seems to
Synopsys GmbH | Kaiserstr. 100     | be made by Dr. Frankenstein, then
52134 Herzogenrath, Germany        | it is time for a change.
+49 2407 9558 (fax? 44: 0)         |                        Try Linux!
#include <iostream.h>

class base {
    public:
	virtual void f1();
	virtual void f2();
};

class derived : public base {
    public:
	void f1();
};

void base::f1()
{
	cout << "This is base::f1()\n";
}

void base::f2()
{
	cout << "This is base::f2() calling f1()\n";
	f1();
}

void derived::f1()
{
	cout << "This is derived::f1()\n";
}

int main()
{
	derived d;
	d.f2();
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]