RE: Extensions in g++ to compile C-code

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

 



Hi All,

I have a library whose source code is written in C language.
The function definition syntax followed is of the form : -
int foo(a,b)
int a;
int b;
{
    return a+b;
}

If i need to compile this using g++ compiler, are there any extensions
available to compile the same code without changing the code . If any other
way, pls suggest.

Thanks in advance,
Regards,
Megha.
----------------------------------------------------------------------------
--------------------------------

Hi Megha,

 U can use g++ -x c test.c  // where test.c is completely written in 'C'.
                                            // -x option of g++ is used to
specify the language of source

HTH,
Raghu.

[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