Re: Does g++ really need to compile main, if c++ code is involved?

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

 



* Jens Kilian:

>> I tried to find answers to that, by searching this mailing list
>> and the internet in general, but didn't find anything. Most
>> people don't seem to be aware of that "compile main with c++-compiler"
>> rule. If I missed some resource, please excuse.
>
> I remember only one compiler (HP aCC) which requires compiling main()
> as C++.  As far as I know GCC never needed this.

Some systems need collect2 support for initializers:

  <http://gcc.gnu.org/onlinedocs/gccint/Collect2.html>

> Note that you will still need to link using g++, or pass all the
> equivalent options to the linker.

Doing this for the shared library should be sufficient, though.




[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