C++ header files with PHP causes 20 errors

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



Hello everyone!

I have been going thru a lot of different compiling steps and tests - and somehow managed to get round the things. But now, I have a rather unsolvable issue since I am not a compiler guru :)

This is the error - or more, just a part from it:

In file included from main/internal_functions.c:65:
In file included from /Users/Ingwie/Work/drag0n-php/ext/wxwidgets/php_wxwidgets.h:19:
In file included from /Users/Ingwie/Work/drag0n-php/ext/wxwidgets/common.h:35:
In file included from /usr/local/include/wx-2.9/wx/wx.h:16:
In file included from /usr/local/include/wx-2.9/wx/object.h:20:
In file included from /usr/local/include/wx-2.9/wx/memory.h:16:
In file included from /usr/local/include/wx-2.9/wx/string.h:51:
In file included from /usr/local/include/wx-2.9/wx/strvararg.h:21:
In file included from /usr/local/include/wx-2.9/wx/strconv.h:18:
/usr/local/include/wx-2.9/wx/buffer.h:20:1: error: unknown type name 'class'
class WXDLLIMPEXP_FWD_BASE wxCStrData;
^
/usr/local/include/wx-2.9/wx/buffer.h:28:1: error: unknown type name 'namespace'
namespace wxPrivate
^
/usr/local/include/wx-2.9/wx/buffer.h:28:20: error: expected ';' after top level declarator
namespace wxPrivate
                   ^

As you can see, it complains about the c++ definition "namespace" and "class". This keeps going thru the whooooole file - when it just gives up with:

fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
make: *** [main/internal_functions.lo] Error 1


It all started after i got this command printed:

/bin/sh /Users/Ingwie/Work/drag0n-php/libtool --silent --preserve-dup-deps --mode=compile cc  -Imain/ -I/Users/Ingwie/Work/drag0n-php/main/ -DPHP_ATOM_INC -I/Users/Ingwie/Work/drag0n-php/include -I/Users/Ingwie/Work/drag0n-php/main -I/Users/Ingwie/Work/drag0n-php -I/Users/Ingwie/Work/drag0n-php/ext/date/lib -I/Users/Ingwie/Work/drag0n-php/ext/ereg/regex -I/usr/include/libxml2 -I/usr/local/include -I/Users/Ingwie/Work/drag0n-php/ext/mbstring/oniguruma -I/Users/Ingwie/Work/drag0n-php/ext/mbstring/libmbfl -I/Users/Ingwie/Work/drag0n-php/ext/mbstring/libmbfl/mbfl -I/Users/Ingwie/Work/drag0n-php/ext/sqlite3/libsqlite -I/Users/Ingwie/Work/drag0n-php/ext/pthreads -I/usr/include/tidy -I/Users/Ingwie/Work/drag0n-php/ext/tokenizer/includes -I/usr/local/lib/wx/include/osx_cocoa-unicode-2.9 -I/usr/local/include/wx-2.9 -I/Users/Ingwie/Work/drag0n-php/TSRM -I/Users/Ingwie/Work/drag0n-php/Zend  -no-cpp-precomp  -I/usr/include -g -O2 -fvisibility=hidden -DZTS  -c main/internal_functions.c -o main/internal_functions.lo 
In file included from main/internal_functions.c:54:


...now this is kind of annoying. ._. Here is my configuration, maybe you can help me.

Config-wrapper:
#!/bin/bash
export PREFIX=/Applications/drag0n/drag0n.app/Contents/System
export EPREFIX=$PREFIX/usr
export LIBS="$(gpgme-config --libs) $(libgcrypt-config --libs) $(xml2-config --libs) -lstdc++"
export CC="cc"
./configure \
	--prefix=$PREFIX \
	--bindir=$PREFIX/bin \
	--sbindir=$EPREFIX/sbin \
	--libexecdir=$EPREFIX/local/libexec \
	--sysconfdir=$PREFIX/etc \
	--sharedstatedir=$EPREFIX/com \
	--localstatedir=$PREFIX/var \
	--libdir=$PREFIX/usr/local/lib \
	--includedir=$EPREFIX/local/include \
	--oldincludedir=$PREFIX/local/include \
	--datarootdir=$EPREFIX/local/share \
	--infodir=$EPREFIX/local/share/info \
	--localedir=$EPREFIX/local/share/locale \
	--mandir=$EPREFIX/local/share/man \
	--docdir=$PREFIX/doc/plain \
	--htmldir=$PREFIX/doc/html \
	--dvidir=$PREFIX/doc/dvi \
	--pdfdir=$PREFIX/doc/pdf \
	--psdir=$PREFIX/doc/ps \
	--enable-embed=static \
	--enable-static=yes \
	--with-config-file-path="" \
	--with-config-file-scan-dir="" \
	--enable-maintainer-zts \
	--enable-pthreads \
	--with-wxwidgets \
	--with-wxwidgets-monolithic \
	--with-ssh2 \
	--with-gpg \
	--with-gnupg \
	--enable-mbstring \
	--enable-sockets \
	--enable-ftp \
	--enable-soap \
	--enable-zip \
	--enable-opcache \
	--with-tidy \
	--with-libedit \
	--with-curl=/usr/local \
	--with-mcrypt \
	--with-gd \
	--with-pear \
	--with-libedit \
	--enable-intl \
	--enable-soap \
	--enable-libxml "$*"
exit 0

The modules:
pthreads: https://github.com/krakjoe/pthreads
wxphp (which causes the issues): https://github.com/wxphp/wxphp
gnupg can be found on PECL. A fix to make it work is in the LIBS export.

OS: Mac OS X 10.8.4 w/latest xCode and Dev-Tools installed

If i leave wxphp out, everything compiles well. But, with wxphp, it just breaks.

Hope anybody of you can help me.


Regards, Ingwie!




[Index of Archives]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [Postgresql]     [PHP Books]     [PHP Databases]     [PHP SOAP]
  Powered by Linux