Compiling c but not c++ on HPUXv11 (resource.h)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am using gcc 3.4.3 on a HP c3750 workstation (UX v11). Compiling c works but not c++. Here is a "Hello world" exemple (demo.cpp)
#include <stdio.h>
//#include <iostream>
using namespace std;
int main(int argc, char *argv[]){ printf("Hello world !\n"); return -1; }

Compiling (gcc -o demo demo.cpp) gives :
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (/var/tmp//ccKBZK7d.o) was detected. The linked output may not run on a PA 1.x system.
but at least the binary is here

With the following code
#include <stdio.h>
#include <iostream>
using namespace std;
int main(int argc, char *argv[]){ printf("Hello world !\n"); return -1; }

Compiling (gcc -o demo demo.cpp) gives :
In file included from /usr/include/sys/wait.h:83,
from /usr/local/lib/gcc/hppa2.0w-hp-hpux11.11/3.4.3/include/stdlib.h:307, from /usr/local/lib/gcc/hppa2.0w-hp-hpux11.11/3.4.3/include/wchar.h:33,
                from /usr/local/include/c++/3.4.3/cwchar:54,
                from /usr/local/include/c++/3.4.3/bits/postypes.h:46,
                from /usr/local/include/c++/3.4.3/iosfwd:50,
                from /usr/local/include/c++/3.4.3/ios:44,
                from /usr/local/include/c++/3.4.3/ostream:45,
                from /usr/local/include/c++/3.4.3/iostream:45,
                from demo.cpp:2:
/usr/include/sys/resource.h:135: error: expected constructor, destructor, or type conversion before "int"
/usr/include/sys/resource.h:135: error: expected `,' or `;' before "int"
/usr/include/sys/resource.h:136: error: expected constructor, destructor, or type conversion before "int"
/usr/include/sys/resource.h:136: error: expected `,' or `;' before "int"
In file included from /usr/local/include/c++/3.4.3/bits/locale_facets.h:46,
                from /usr/local/include/c++/3.4.3/bits/basic_ios.h:44,
                from /usr/local/include/c++/3.4.3/ios:51,
                from /usr/local/include/c++/3.4.3/ostream:45,
                from /usr/local/include/c++/3.4.3/iostream:45,
                from demo.cpp:2:
/usr/local/include/c++/3.4.3/cwctype:52:20: wctype.h: No such file or directory

here are lines 125 to 136 of resource.h
125: /* Function prototypes */
126:
127: #ifndef _KERNEL
128: #ifdef __cplusplus
129:    extern "C" {
130: #endif /* __cplusplus */
131:
132:   extern int getpriority __((int, id_t));
133:   extern int getrusage __((int, struct rusage *));
134:   extern int setpriority __((int, id_t, int));
135: _LF_EXTERN_OR_STATIC_OR_INLINE int getrlimit __((int, struct rlimit *)); 136: _LF_EXTERN_OR_STATIC_OR_INLINE int setrlimit __((int, const struct rlimit *));

As for wctype.h, it seems that it does not exist under HPUXv11.00, but wchar.h does. [http://www.freenix.fr/unix/linux/HOWTO/Unicode-HOWTO-5.html]

How can I get through all this ?.

Thanks in advance,

Francois

	

	
		
___________________________________________________________________________ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux