Closed GoogleCodeExporter closed 9 years ago
I'm guessing you need to install libxul-dev or xulrunner-dev as that is the
normal cause of that error.
Original comment by kdeko...@gmail.com
on 19 Nov 2011 at 4:12
On Gentoo, you don't need -dev files. All headers and libs are always
installed. Furthermore, xulrunner is provided by the Firefox package. Here
are all the files that belong to the Firefox 8.0 installation:
http://pastebin.com/raw.php?i=43GTy4x1
All header files and libs seem to exist.
Original comment by rea...@gmail.com
on 19 Nov 2011 at 4:24
If pkg-config --cflags libxul
Doesn't give you something like this
-I/usr/include/xulrunner-sdk-2 -I/usr/include/nspr4
The either your pkg-config path is incorrect or you need to point at files with
./configure --with-xulrunner-sdk=/usr/include/firefox
That path may vary depending one how your files are arranged.
Original comment by kdeko...@gmail.com
on 19 Nov 2011 at 4:29
I think this assumes that you installed xulrunner seperately. Here, Firefox is
compiled with xulrunner built-in (as recommended by Mozilla.)
I'm going to try the --with-xulrunner-sdk option.
Original comment by rea...@gmail.com
on 19 Nov 2011 at 4:33
I tried with "-with-xulrunner-sdk=/usr/include/firefox" but it still uses wrong
include paths. The "npapi.h" header is in "/usr/include/firefox" but GM's
build system uses "/usr/include/firefox/include" which is wrong.
x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I.. -fPIC
-DPACKAGE_LOCALE_DIR=\""/usr/share/locale"\" -DPACKAGE_SRC_DIR=\""."\"
-DPACKAGE_DATA_DIR=\""/usr/share"\" -I/usr/include/firefox/include
-I/usr/include/firefox/include/plugin -I/usr/include/firefox/include/nspr
-I/usr/include/firefox/include/xpcom -I/usr/include/firefox/include/string
-I/usr/include/firefox/include/java -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -I/usr/include/gmtk -pthread
-I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -DMOZILLA_STRICT_API -DXP_UNIX -DHAVE_CURL
-pipe -mtune=core2 -march=native -O2 -c -o plugin_list.o plugin_list.cpp
In file included from plugin.cpp:39:0:
plugin.h:40:19: fatal error: npapi.h: No such file or directory
Original comment by rea...@gmail.com
on 20 Nov 2011 at 3:48
As a temporary workaround, I did:
cd /usr/include/firefox
ln -s . include
And that worked in letting GM find npapi.h and the rest of the headers.
However, the build aborts with:
In file included from np_entry.cpp:44:0:
npupp.h:703:49: error: declaration of C function 'char*
NP_GetMIMEDescription()' conflicts with
/usr/include/firefox/include/npfunctions.h:303:24: error: previous declaration
'const char* NP_GetMIMEDescription()' here
np_entry.cpp:83:30: error: new declaration 'char* NPP_GetMIMEDescription()'
/usr/include/firefox/include/npapi.h:792:13: error: ambiguates old declaration
'const char* NPP_GetMIMEDescription()'
np_entry.cpp: In function 'char* NP_GetMIMEDescription()':
np_entry.cpp:87:35: error: invalid conversion from 'const char*' to 'char*'
Original comment by rea...@gmail.com
on 20 Nov 2011 at 3:51
Please undo the ln for the include and try adding
--enable-new-libxul to your configure command. Or save yourself sometime and
install libxul. It will not matter if you build with libxul or with the
xulrunner in firefox, they should be compatible.
Original comment by kdeko...@gmail.com
on 21 Nov 2011 at 2:17
I got it to work. I patched the sources to change the "char*" return types to
"const char*" since it seems the xulrunner API changed that for the new
version. I'm attaching the patch.
Installing libxul is not the optimal solution, since it's a big package to
compile and takes time. Also, Firefox 8 comes with the newest version of it
included anyway, so I don't really see why I should have another, older version
installed. And patch to fix it was trivial, so I think it's best if the support
for the new xul API changes would be added to GM.
Original comment by rea...@gmail.com
on 22 Nov 2011 at 2:09
Attachments:
Patch applied, but probably compiling only stopped due to a strict compiler
flag. Marking as fixed
Original comment by kdeko...@gmail.com
on 22 Nov 2011 at 2:24
Thanks. Though I didn't test if the patch breaks compilation against older
versions of Firefox or Xulrunner.
About the compiler: I'm on GCC 4.5.3, but I'm using default compiler flags.
AFAIK, this behavior was made the default (that is, without specifying some
strict flag) since GCC 4.4.
Original comment by rea...@gmail.com
on 22 Nov 2011 at 9:08
Uhh I think I get to opposite error...
x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I.. -fPIC
-DPACKAGE_LOCALE_DIR=\""/usr/share/locale"\" -DPACKAGE_SRC_DIR=\""."\"
-DPACKAGE_DATA_DIR=\""/usr/share"\" -fshort-wchar -I/usr/include/xulrunner-2.0
-I/usr/include/nspr -DMOZ_NO_MOZALLOC -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -I/usr/include/gmtk -pthread
-I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -DMOZILLA_STRICT_API -DXP_UNIX -DHAVE_CURL
-march=native -O2 -pipe -fprefetch-loop-arrays -ftree-vectorize -c -o
np_entry.o np_entry.cpp
In file included from np_entry.cpp:44:0:
npupp.h:711:55: error: declaration of C function ‘const char*
NP_GetMIMEDescription()’ conflicts with
/usr/include/xulrunner-2.0/npfunctions.h:303:20: error: previous declaration
‘char* NP_GetMIMEDescription()’ here
np_entry.cpp:88:36: error: new declaration ‘const char*
NPP_GetMIMEDescription()’
/usr/include/xulrunner-2.0/npapi.h:788:7: error: ambiguates old declaration
‘char* NPP_GetMIMEDescription()’
make[3]: *** [np_entry.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory
`/var/tmp/portage/www-plugins/gecko-mediaplayer-1.0.5_beta1_p20111203/work/gecko
-mediaplayer-1.0.5_beta1_p20111203/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
`/var/tmp/portage/www-plugins/gecko-mediaplayer-1.0.5_beta1_p20111203/work/gecko
-mediaplayer-1.0.5_beta1_p20111203/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/var/tmp/portage/www-plugins/gecko-mediaplayer-1.0.5_beta1_p20111203/work/gecko
-mediaplayer-1.0.5_beta1_p20111203'
make: *** [all] Error 2
# pkg-config --cflags libxul
-fshort-wchar -I/usr/include/xulrunner-2.0 -I/usr/include/nspr
Original comment by weedy2...@gmail.com
on 6 Dec 2011 at 11:25
The latest SVN has patches that should correct this.
Original comment by kdeko...@gmail.com
on 6 Dec 2011 at 11:34
Original issue reported on code.google.com by
rea...@gmail.com
on 19 Nov 2011 at 10:14