[gnu.g++] g++ and sunview

sho@pur-phy (Sho Kuwamoto) (07/01/89)

I forgot to include my .signature last time (I think) so here it is.
Any help *mailed* to me would be greatly appreciated, since the
coonnection between LA and Purdue died no less than 10 times in the
proces of posting the prev. article and this followup.  Thank you for
your help.

-Sho
address: sho@risc.com <-- NOTE:  Not the same as above.
-- 
address: sho@risc.com <-- NOTE:  Not the same as above.

sho@pur-phy (Sho Kuwamoto) (07/01/89)

Hmm... It looks like what I really forgot was the article itself...
At least I can't find it from this end.  My apologies if this is a
duplicate. 
---
I am relatively new to Sun programming *and* C++, so I have no idea if
these questions have simple answers.  I would appreciate any help you
have, but please send by email to the address in my .sig, since I have
to telnet halfway across the country to read news.  If you are
interested in any/all of the responses, please send me mail.  If there
is enough interest, I will summarize to the net.

From most important to least important:

1) Does anyone know of a public domain or otherwise easily available
set of .h files for Sunview and g++?  I've been hacking out little
bits and pieces, but it seems inefficient, especially since I have no
idea what some of the Sun definitions are for...

2) Is there any way I can receive news about g++ or the suns on a
mailing list?  It is a royal pain for me to read news.

3) (probably a g++ question, but you never know.) I've been getting a
strange error, and I have no clue what is causing it:
   pf.o: Undefined symbol __DYNAMIC referenced from text
Any clue as to what pf.o is, and when __DYNAMIC is used?  I've
grepped through .h files, pored over manuals, etc. with no success.
I've tried various combinations of extern "C"...  And I've double
checked that nothing like that appears in my orig. code...

I'd appreciate any help you can give me.  I just hope that I can keep
from going insane long enough...

-Sho











-- 
address: sho@risc.com <-- NOTE:  Not the same as above.

sho@pur-phy (Sho Kuwamoto) (07/05/89)

This may be some quirk in SunView, but my troubles with g++ and
sunview seem to come from some fundamental misunderstanding on my part
of g++ linkage.  After reducing the program as much as possible, I
came up with this:

--file test.cc
extern "C"{
#include <suntool/sunview.h>
}

main()
{
  Frame frame;
  frame = window_create(0, FRAME, 0);
}
--
g++ test.cc -I/usr3/sho/include/c++ -lsuntool -lsunwindow -lpixrect
--
which gives me the error:
pf.o: Undefined symbol __DYNAMIC referenced from text

where .../include/c++ contains the slightly mangled sunview .h files.
voss@cs.uiuc.edu suggested I make all my sunview calls from gcc and
link together.  Well, to make it as simple as possible, I removed the
extern "C" declaration and compiled with gcc to get an object file.  I
linked it with the sunview libraries using the g++ linker, and I got
the same error.  Are the sunview libraries incompatible with g++?  Or
am I linking C code and C++ code together incorrectly?  I am running
g++ 1.35.0 and gcc 1.35.

-Sho



-- 
address: sho@risc.com <-- NOTE:  Not the same as above.

marantz@porthos.rutgers.edu (Roy Marantz) (07/11/89)

In article <2343@pur-phy> sho@pur-phy (Sho Kuwamoto) writes:

> This may be some quirk in SunView, but my troubles with g++ and
> sunview seem to come from some fundamental misunderstanding on my part
> of g++ linkage.  After reducing the program as much as possible, I
> came up with this:

...

> pf.o: Undefined symbol __DYNAMIC referenced from text

...

I believe that the symbol __DYNAMIC is defined by the loader when you
use dynamic (instead of static) linking.  The g++ says (or implies)
that it doesn't have the correct crt0 program to handle dynamic
loading, so try telling ld(1) to statically link the program.

Roy
-- 
uucp:   {backbone}!rutgers!aramis.rutgers.edu!marantz
arpa:   marantz@aramis.rutgers.edu

sho@JUPITER.RISC.COM (Sho Kuwamoto) (07/13/89)

Thanks for all your help on getting sunview to work with g++.  Some people
asked me to forward my mail, so I will do so shortly (yeah, right) what I
ended up linking with gcc instead of g++ and that seems to work for me, which
means, I think, that our ld++ was made improperly.  Oh well. 

-Sho