Re: Re: Support for C++ extension in UNIX builds
| From: | Mark Spruiell | Date: | Fri, 22 Aug 2003 20:28:35 +0000 |
| Subject: | Re: Re: Support for C++ extension in UNIX builds | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-4134@lists.php.net to get a copy of this message | ||
>
> fwiw, I've never had these problems with gcc's C++ compiler on Solaris when
> building C++ extensions, and the final linking step is usually done by gcc,
> not g++. When you do the linking, do you link to the stdc++ library?
Unlike GCC, Sun's C and C++ compilers are independent entities, therefore you
can't link a C++ program or shared library when the C compiler is driving the
linker. It's also not possible to compile PHP's C code with Sun's C++ compiler.
I guess we're a little spoiled by GCC. :)
- Mark
> J
>
>
> Mark Spruiell wrote:
>
>> I've written a PHP5 extension in C++ that builds great on Linux with GCC,
>> whether I compile it into PHP or build it as a shared library.
>>
>> On Solaris with Sun CC, however, I've had to manually edit the Makefile or
>> the libtool script in order to successfully build my extension. When I
>> compile the extension into PHP, I have to change $(CC) to $(CXX) in
>> certain places in the Makefile. When I build it as a dynamic library, I
>> have to edit libtool so that it uses $(CXX) and not ld to create the
>> shared library.
>>
>> Am I overlooking some configuration step that eliminates the need to
>> manually edit these files?
>>
>> Thanks,
>> - Mark
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>