Article View: gnu.gcc.help
Article #46543HELP: gcc/g++ on AIX 3.2.5 (sockets)
From: Todd B. Templeton
Date: Sun, 06 Nov 1994 23:27
Date: Sun, 06 Nov 1994 23:27
56 lines
3793 bytes
3793 bytes
Hi, GNUrus! I'm having a whacking annoying problem using gcc/g++ on an RS/6000 running AIX 3.2.5. The version of the compiler I have installed (2.6.0) was built on another RS/6000 (370) and installed on this one (320). I'm trying to use g++ to compile my source which uses the socket routines. Unfortunately, g++ cannot seem to get things arranged so the socket routines will resolve at link time. Everything else works fine, just the socket routines are broken. In order to save disk space, I did not install the AIX c compilers on the 320. The libraries and include files are there, but the compilers are not. Also, the libraries are the c libraries not the c++ libraries. I suspect this may have something to do with the problem, however, if it does, why does it only affect the socket routines? If not, why don't the socket routines work? 'Tis puzzling. If I compile in C++ mode, g++ barks that the function socket (int, int, int) is undefined and my options are socket (), or socket ( struct socket * ). To my knowledge, the two "available" definitions are not valid declarations for the socket call. On the other hand, if I stay in C++ mode but tell g++ that the socket routines are actually C routines, then g++ works fine. Unfortunately, ld starts barking and says it cannot resolve the symbols .socket__Fiii, .bind__FiP8socketaddrUl, .listen__FiUi, .accept__FiP-sockaddrPDUl, .recv__FiPvUli, and .send__FiPvUli. Huh? I've never heard of 'em. Obviously, some internal routines, but why would g++ cause ld not to find them? So, since g++ barks and growls, I tried gcc and converted the program to pure ANSI C. This isn't really an option for me, I just thought I would try. Now gcc barks and says it does not know what the variables sockaddr_in or sockaddr are, both of which are known by g++. Again, huh? I use the same include files. I've been writing C for 10 years, C++ for three and I've flown AIX since the days of 2.2.1 on the RT (Uugh!). But...this one has me stumped. If anyone can give me any suggestions, I would really appreciate it--even if it is only RTFM (actually, I would be ecstatic if it were to be RTFM, but I think it is a bit more complicated than that). By the bye, these programs compile fine on the 370 under xlC, but I have the same problem with the socket routines using gcc/g++. Also, they work fine on an HP 9000/720 using the HP C/C++ compilers that I am occationally forced, quite against my will, to use. :-) I have not installed the gcc compiler on the HP as I do little development on the wretched thing, so it would simply be a waste of time. Please help...I'm really stuck. Thanks in advance. <----------------------------------------------------------------------------> Todd Templeton | All opinions are solely my own and do not reflect the Lead Software Engineer | views of Phelps Dodge Corporation or its management. <---------------------------------------------------------------------------->
Technical Details
Message-ID:
<39jopu$gt1@anode.phelpsd.com>Path:
arc1-ca.pugleaf.net!nntp.gmd.de!xlink.net!howland.reston.ans.net!news.sprintlink.net!news.primenet.com!anode.phelpsd.com!phxtest1.hq.pdcorphq.com!toddtShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,b11eb39563ec3a4f,start X-Google-Attributes: gid11318c,public X-Google-Thread: 115614,b11eb39563ec3a4f,start X-Google-Attributes: gid115614,public X-Google-ArrivalTime: 1994-11-07 07:32:41 PST Path: arc1-ca.pugleaf.net!nntp.gmd.de!xlink.net!howland.reston.ans.net!news.sprintlink.net!news.primenet.com!anode.phelpsd.com!phxtest1.hq.pdcorphq.com!toddt From: toddt@phxtest1.hq.pdcorphq.com (Todd B. Templeton) Newsgroups: gnu.gcc.help,comp.unix.aix Subject: HELP: gcc/g++ on AIX 3.2.5 (sockets) Date: 6 Nov 1994 23:27:58 GMT Organization: Phelps Dodge Corporation Lines: 56 Message-ID: <39jopu$gt1@anode.phelpsd.com> NNTP-Posting-Host: phxtest1.phelpsd.com X-Newsreader: TIN [version 1.2 PL2]