This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Mysterious C++


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]