src/dae/daeURI.cpp:16:21: pcrecpp.h: No such file or dir

Hi all,

I’m trying to compile Collada-DOM 2.2 (http://sourceforge.net/project/showfile … _id=644738) on Linux (CentOS 4.x), and I receive the following compile error:

src/dae/daeURI.cpp:16:21: pcrecpp.h: No such file or directory

make: 3.81
gcc: 3.4.6
kernel: 2.6.9-78.0.8.ELsmp

See terminal session below for reference. If anyone could help me out, it would be greatly appreciated.

Best regards,
John

(collada-dom)% make -f Makefile.linux
make os=linux project=minizip -C dom
make[1]: Entering directory /var/tmp/collada-dom/dom' Compiling external-libs/minizip/src/ioapi.c to build/linux-1.4/obj/ioapi.o Compiling external-libs/minizip/src/mztools.c to build/linux-1.4/obj/mztools.o Compiling external-libs/minizip/src/unzip.c to build/linux-1.4/obj/unzip.o external-libs/minizip/src/unzip.c: In function unzlocal_GetCurrentFileInfoInternal’:
external-libs/minizip/src/unzip.c:610: warning: suggest explicit braces to avoid ambiguous else' external-libs/minizip/src/unzip.c:690: warning: suggest explicit braces to avoid ambiguous else’
external-libs/minizip/src/unzip.c:715: warning: suggest explicit braces to avoid ambiguous else' external-libs/minizip/src/unzip.c: In function unzlocal_CheckCurrentFileCoherencyHeader’:
external-libs/minizip/src/unzip.c:979: warning: suggest explicit braces to avoid ambiguous else' external-libs/minizip/src/unzip.c: In function unzGetGlobalComment’:
external-libs/minizip/src/unzip.c:1537: warning: unused variable err' Compiling external-libs/minizip/src/zip.c to build/linux-1.4/obj/zip.o external-libs/minizip/src/zip.c:194: warning: 'free_linkedlist' defined but not used Creating build/linux-1.4/libminizip.a Linking build/linux-1.4/libminizip.so.1.2.3 make[1]: Leaving directory /var/tmp/collada-dom/dom’
make os=linux project=dom -C dom
make[1]: Entering directory /var/tmp/collada-dom/dom' Compiling src/dae/daeArray.cpp to build/linux-1.4/obj/daeArray.o Compiling src/dae/daeAtomicType.cpp to build/linux-1.4/obj/daeAtomicType.o Compiling src/dae/dae.cpp to build/linux-1.4/obj/dae.o Compiling src/dae/daeDatabase.cpp to build/linux-1.4/obj/daeDatabase.o Compiling src/dae/daeDocument.cpp to build/linux-1.4/obj/daeDocument.o Compiling src/dae/daeDom.cpp to build/linux-1.4/obj/daeDom.o Compiling src/dae/daeElement.cpp to build/linux-1.4/obj/daeElement.o Compiling src/dae/daeError.cpp to build/linux-1.4/obj/daeError.o Compiling src/dae/daeErrorHandler.cpp to build/linux-1.4/obj/daeErrorHandler.o Compiling src/dae/daeIDRef.cpp to build/linux-1.4/obj/daeIDRef.o Compiling src/dae/daeIOPluginCommon.cpp to build/linux-1.4/obj/daeIOPluginCommon.o Compiling src/dae/daeMemorySystem.cpp to build/linux-1.4/obj/daeMemorySystem.o Compiling src/dae/daeMetaAny.cpp to build/linux-1.4/obj/daeMetaAny.o Compiling src/dae/daeMetaAttribute.cpp to build/linux-1.4/obj/daeMetaAttribute.o Compiling src/dae/daeMetaChoice.cpp to build/linux-1.4/obj/daeMetaChoice.o Compiling src/dae/daeMetaCMPolicy.cpp to build/linux-1.4/obj/daeMetaCMPolicy.o Compiling src/dae/daeMetaElementAttribute.cpp to build/linux-1.4/obj/daeMetaElementAttribute.o Compiling src/dae/daeMetaElement.cpp to build/linux-1.4/obj/daeMetaElement.o Compiling src/dae/daeMetaGroup.cpp to build/linux-1.4/obj/daeMetaGroup.o Compiling src/dae/daeMetaSequence.cpp to build/linux-1.4/obj/daeMetaSequence.o Compiling src/dae/daeRawResolver.cpp to build/linux-1.4/obj/daeRawResolver.o Compiling src/dae/daeRefCountedObj.cpp to build/linux-1.4/obj/daeRefCountedObj.o Compiling src/dae/daeSIDResolver.cpp to build/linux-1.4/obj/daeSIDResolver.o Compiling src/dae/daeStandardURIResolver.cpp to build/linux-1.4/obj/daeStandardURIResolver.o Compiling src/dae/daeStringRef.cpp to build/linux-1.4/obj/daeStringRef.o Compiling src/dae/daeStringTable.cpp to build/linux-1.4/obj/daeStringTable.o Compiling src/dae/daeTinyXMLPlugin.cpp to build/linux-1.4/obj/daeTinyXMLPlugin.o Compiling src/dae/daeURI.cpp to build/linux-1.4/obj/daeURI.o src/dae/daeURI.cpp:16:21: pcrecpp.h: No such file or directory src/dae/daeURI.cpp: In function void <unnamed>::parsePath(const std::string&, std::string&, std::string&, std::string&)‘:
src/dae/daeURI.cpp:143: error: pcrecpp' has not been declared src/dae/daeURI.cpp:143: error: expected initializer before "findDir" src/dae/daeURI.cpp:144: error: pcrecpp’ has not been declared
src/dae/daeURI.cpp:144: error: expected initializer before “findExt”
src/dae/daeURI.cpp:147: error: findDir' was not declared in this scope src/dae/daeURI.cpp:148: error: findExt’ was not declared in this scope
src/dae/daeURI.cpp:147: warning: unused variable ‘findDir’
src/dae/daeURI.cpp:148: warning: unused variable ‘findExt’
src/dae/daeURI.cpp: In function bool cdom::parseUriRef(const std::string&, std::string&, std::string&, std::string&, std::string&, std::string&)': src/dae/daeURI.cpp:707: error: pcrecpp’ has not been declared
src/dae/daeURI.cpp:707: error: expected initializer before “re”
src/dae/daeURI.cpp:709: error: re' was not declared in this scope src/dae/daeURI.cpp:709: warning: unused variable 're' make[1]: *** [build/linux-1.4/obj/daeURI.o] Error 1 make[1]: Leaving directory /var/tmp/collada-dom/dom’
make: *** [all] Error 2
Exit 2

I think you need to install pcre and pcre-devel packages for CentOS 4.x.

Hi Marcus,

Thanks for your quick response! I should have mentioned in the original posting that pcre and pcre-devel is already installed:

rpm -q pcre pcre-devel

pcre-4.5-4.el4_6.6
pcre-devel-4.5-4.el4_6.6

One interesting thing I found by snooping around is that the reported missing file “pcrecpp.h” is not apart of pcre-devel, but is actually found under:

(collada-dom)% find . -name pcrecpp.h
./dom/external-libs/pcre/pcrecpp.h

This leads me to think that there is an issue with the makefile. Could it be that <collada-src-dir>/dom/external-libs/pcre is missing as an include directory for the project. However, makefiles is not my strongest point and I haven’t figured out where to insert the missing include directory yet.

Any help would be greatly appreciated. Thanks in advance.

// John

In dom/make/readme it says:

Linux Notes
101 -----------
102
103 The Linux build has been tested with Ubuntu Gutsy. You need to have libxml,
104 PCRE, and boost filesystem development files installed on your machine to build
105 the DOM. The Ubuntu packages are named libxml2-dev, libpcre3-dev, and
106 libboost-filesystem-dev.
107
108 It should be easy to get the DOM building on other versions of Linux, but you’ll
109 need to figure out what packages to install for libxml, PCRE, and boost filesystem.

Also in dom/make/dom.mk it says:

38 ifeq ((os),linux) 39 libOpts += -lpcre -lpcrecpp 40 else 41 # On Mac, Windows and PS3 we need to be told where to find pcre 42 ifeq ((os),windows)
43 ccFlags += -DPCRE_STATIC
44 endif
45 includeOpts += -Iexternal-libs/pcre
46 libOpts += (addprefix external-libs/pcre/lib/(buildID)/,libpcrecpp.a libpcre.a )
47 endif

All this means that your Linux system is expected to have the required header files in a system include directory. Since your system does not have it then there is a problem with your installation wrt the assumptions. Examine your PCRE installed files more carefully and make sure the devel headers and libs are really present. Often times a UNIX/Linux system treats development packages as optional installs.

Hi Mark,

Thanks for your quick response!

I have confirmed that I have libxml2-devel, pcre-devel, and boost-devel (which includes boot filesystem) installed in my CentOS 4.x system. However, it turns out the the pcre libraries shipped with CentOS 4.8 is too old (pcre version 4.5-4). It does not include the pcrecpp.h amonst others:

rpm -q pcre-devel

pcre-devel-4.5-4.el4_6.6

rpm -ql pcre-devel

/usr/bin/pcre-config
/usr/include/pcre
/usr/include/pcre/pcre.h
/usr/include/pcre/pcreposix.h
/usr/lib64/libpcre.a
/usr/lib64/libpcre.so
/usr/lib64/libpcreposix.a
/usr/lib64/libpcreposix.so

The solution was to down load the newest pcre source from ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ and compile it with .configure; make; make install. This installs pcre to /usr/local (not to mess up my system to much), so I had to add the line “includeOpts += -I/usr/local/include/pcre” too dom/make/dom.mk:

ifeq ($(os),linux)
  • includeOpts += -I/usr/local/include/pcre
    libOpts += -lpcre -lpcrecpp
    else

Now Collada compiles successfully though minizip, dae, and modules, but fails in src/1.4/dom/domTapered_cylinder.cpp.

Compiling src/1.4/dom/domTapered_cylinder.cpp to build/linux-1.4/obj/domTapered_cylinder.o
make[1]: *** No rule to make target src/1.4/dom/domTargetableFloat3.cpp', needed by build/linux-1.4/obj/domTargetableFloat3.o’. Stop.
make[1]: Leaving directory `/var/tmp/collada-dom/dom’
make: *** [all] Error 2

Appreciate your input on this.

// John

It’s a parallel build so it looks to me like it’s actually failing on domTargetableFloat3.cpp. I don’t see any reason for that based on what you’ve posted.

Try doing a clean build.

Hi Marcus,

Silly me, of course I should try with a clean build:) However, the make clean command really messes up the build directory (note missing files and directories):

(collada-dom)% make -f Makefile.linux clean
make os=linux project=minizip -C dom clean
make[1]: Entering directory /var/tmp/collada-dom/dom' Removing build files. make[1]: Leaving directory /var/tmp/collada-dom/dom’
make os=linux project=dom -C dom clean
make[1]: Entering directory /var/tmp/collada-dom/dom' Removing build files. make[1]: Leaving directory /var/tmp/collada-dom/dom’
make os=linux project=fx -C fx clean
make: *** fx: No such file or directory. Stop.
make: *** [clean] Error 2
Exit 2
dhcp10(collada-dom)% ls
dom/ Makefile.linux
dhcp10(collada-dom)% ls dom/
external-libs/ include/ make/ Makefile src/
dhcp10(collada-dom)% ls dom/make/
common.mk dom.mk dom.mk~ minizip.mk rulesC.mk rules.mk
dhcp10(collada-dom)% ls dom/include/
1.4/ dae/ dae.h dom.h modules/
dhcp10(collada-dom)% ls dom/src/
1.4/ dae/ modules/

After removing the build directory and re-extracting collada-dom-2.2.zip and re-editing dom/make/dom.mk as described earlier libcollada14dom compiled successfully. However, now I get an compile error in the fx project:

make os=linux project=fx -C fx
make[1]: Entering directory /var/tmp/collada-dom/fx' Compiling src/cfxAnnotatable.cpp to build/linux-1.4/obj/cfxAnnotatable.o In file included from src/cfxAnnotatable.cpp:9: include/cfxAnnotate.h:15:19: Cg/cg.h: No such file or directory In file included from src/cfxAnnotatable.cpp:9: include/cfxAnnotate.h:43: error: CGannotation’ does not name a type
include/cfxAnnotate.h:54: error: CGannotation' does not name a type make[1]: *** [build/linux-1.4/obj/cfxAnnotatable.o] Error 1 make[1]: Leaving directory /var/tmp/collada-dom/fx’
make: *** [all] Error 2
Exit 2

The solution to this compile problem was to install Nvidia’s Cg toolkit: http://developer.download.nvidia.com/cg … x86_64.rpm
After the Cg tookit was installed libcollada14fx compiled successfully.

However, now I get the following compile error in the rt project:

In file included from include/Crt/CrtPlatform.h:14,
from src/Crt/CrtEffect.cpp:8:
include/Crt/CrtLinux.h:28: error: conflicting declaration ‘typedef int GLsizeiptr’
/usr/include/GL/glext.h:3372: error: ‘GLsizeiptr’ has a previous declaration as typedef ptrdiff_t GLsizeiptr' include/Crt/CrtLinux.h:28: error: declaration of typedef int GLsizeiptr’
/usr/include/GL/glext.h:3372: error: conflicts with previous declaration typedef ptrdiff_t GLsizeiptr' include/Crt/CrtLinux.h:28: error: declaration of typedef int GLsizeiptr’
/usr/include/GL/glext.h:3372: error: conflicts with previous declaration typedef ptrdiff_t GLsizeiptr' include/Crt/CrtLinux.h:31: error: expected constructor, destructor, or type conversion before "void" include/Crt/CrtLinux.h:32: error: expected constructor, destructor, or type conversion before "void" include/Crt/CrtLinux.h:33: error: expected constructor, destructor, or type conversion before "void" include/Crt/CrtLinux.h:34: error: expected constructor, destructor, or type conversion before "void" include/Crt/CrtLinux.h:78: warning: 'void MessageBox(char*, char*, char*, int)' defined but not used make[1]: *** [build/linux-1.4/obj/CrtEffect.o] Error 1 make[1]: Leaving directory /var/tmp/collada-dom/rt’
make: *** [all] Error 2
Exit 2

I managed to fix this compile error by making the following changes to rt/include/Crt/CrtLinux.h:


 - #ifndef GLsizeiptr
 - typedef int             GLsizeiptr;
 - #endif 

 + #ifndef GLAPI
 + #  define GLAPI extern
 + #endif

After these changes libcollada14rt compiled successfully.

However, the story does not end here:) The next compile error was encountered when compiling the viewer project:

make os=linux project=viewer -C viewer
make[1]: Entering directory /var/tmp/collada-dom/viewer' Compiling projects/linux/main.cpp to build/linux-1.4/obj/main.o In file included from ../rt/include/1.4/Crt/CrtScene.h:24, from projects/linux/main.cpp:16: ../rt/include/Crt/CrtPhysics.h:152:19: warning: no newline at end of file Linking build/linux-1.4/viewer /usr/bin/ld: skipping incompatible ../rt/external-libs/bullet/lib/linux/libbulletopenglsupport.a when searching for -lbulletopenglsupport /usr/bin/ld: cannot find -lbulletopenglsupport collect2: ld returned 1 exit status make[1]: *** [build/linux-1.4/viewer] Error 1 make[1]: Leaving directory /var/tmp/collada-dom/viewer’
make: *** [all] Error 2
Exit 2

I guess this means that I have to compile and install Bullet 2.74 Physics SDK before proceeding?

Best regards,
John

Another update. I compiled and installer bullet-2.74 and updated rt/make/rt.mk and viewer/make/viewer.mk to use this bullet library. However, this resulted in compile error because of API changes in the bullet library.

From rt/external-libs/bullet/lib/linux/VERSION I found out that collada-dom 2.2 uses bullet-2.51. Luckily, I found the depricated source here: http://www.continuousphysics.com/ftp/pu … t-2.51.tgz

With the bullet-2.51 library installed and the necessary changes to rt/make/rt.mk and viewer/make/viewer.mk files made, I was finally able to compile all projects in collada-dom-2.2 on CentOS 4.x, x86_64… puh!!:slight_smile:

May I suggest that you consider using CMake or autoconf make systems in future releases. That would be great!!

Best regards,
John