Mysterious C++

Gabriel Dos Reis gdr@integrable-solutions.net
Sun Dec 12 04:36:00 GMT 2004


"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



More information about the Gcc mailing list