This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Mysterious C++
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: "Sam Lauber" <sam124 at operamail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 12 Dec 2004 05:35:17 +0100
- Subject: Re: Mysterious C++
- Organization: Integrable Solutions
- References: <20041212035907.CEF17416118@ws5-2.us4.outblaze.com>
"Sam Lauber" <sam124@operamail.com> writes:
Please could convince your editor to makes your lines no more than 80
charcaters? Thanks in advance.
| I had the idea of accessing C++ namespaces in a C program to make a
| complicated version of Hello World. I wrote a function "ns" to
| access the functions in a greeting namespace. The greeting namespace
| was
|
| namespace greeting {
| char *greeting;
| void print(void), setstr(char *);
| }
|
| I wrote a C program to use the C++ program, compiled it with g++
| cpp.c++ -x c c.c -g, and it didn't work. But when I added -O3 to the
If you intend to run a program that contains a bit of C++, then you
ought to compile the translation unit that contains main with a C++
front-end.
And posting only a fragment of programs that does not reproduce
the problem does not help. And see
htp://gcc.gnu.org/bugzilla/
for reporting problems. Thanks for your attention.
-- Gaby