From: Joe P. <joe...@sn...> - 2001-03-12 16:31:22
|
On Monday 12 March 2001 03:12 am, David Paschal wrote: > Remind me again which version of RedHat you're using? Are these the stock > versions of glibc and gcc that came with this version? I'm using a RedHat 6.1 system, but I built the compiler (gcc 2.95.2) from source. The glibc version (2.1.3-22) is the redhat-supplied rpm update that I installed because of the reported security vulnerability in earlier packages. I wouldn't go back to an earlier version. My system doesn't seem to be broken. I've been building Qt and KDE2 from source, as well as many C-only apps. > > A suggested fix is to "change '::' to ' : : ' in > > sys/io.h" . > > Does that work? Of course, that isn't a proper solution, since I don't > want people to have to hack system include files in order to build hpoj. I don't know. I didn't try it, though I will if I need to. The comments I found were from gcc, glibc or redhat development mailing lists, so they may not be useful advice for many other people. > > I'm wondering if this problem only affects C++ and not C code. Could you > please try writing a simple "hello world" program compiled as C (not C++), > and include this file? If it works OK for C code, then perhaps I could add > a small C wrapper for the in/out functions to avoid including this file in > a C++ file. Of course, it wouldn't be good for performance, since those > functions would no longer be inlined. I tried to compile a file containing the code below calling both gcc and g++ as the compiler. The filename ending was '.c' in both cases. gcc had no trouble compiling it, but when I attempted to compile it with g++, it barfed (possibly on the '::') causing the same errors I reported earlier. If the file is resaved with a .cpp suffix and gcc is called to compile it, it barfs. /* filename: test_including_io_h.c */ #include </usr/include/sys/io.h> #include <stdio.h> int main(){ printf("Hello World\n"); exit(0); } Here is the output when attempting to compile the above code with g++. ]$ g++ -o test_including_io_h test_including_io_h.c In file included from test_including_io_h.c:4: /usr/include/sys/io.h: In function `void outb(unsigned char, short unsigned int)': /usr/include/sys/io.h:98: parse error before `::' /usr/include/sys/io.h: In function `void outb_p(unsigned char, short unsigned int)': /usr/include/sys/io.h:104: parse error before `::' /usr/include/sys/io.h: In function `void outw(short unsigned int, short unsigned int)': /usr/include/sys/io.h:111: parse error before `::' /usr/include/sys/io.h: In function `void outw_p(short unsigned int, short unsigned int)': /usr/include/sys/io.h:118: parse error before `::' /usr/include/sys/io.h: In function `void outl(unsigned int, short unsigned int)': /usr/include/sys/io.h:125: parse error before `::' /usr/include/sys/io.h: In function `void outl_p(unsigned int, short unsigned int)': /usr/include/sys/io.h:131: parse error before `::' -- Joe |