Thread: [Cppcms-users] Booster-PCRE linking
Brought to you by:
artyom-beilis
|
From: Sab <rim...@gm...> - 2013-03-20 15:23:08
|
Hi Artyom,
I'm cross compiling my application and having trouble with linking the
static libraries. CppCMS compiles fine but when I compile my application
that uses cppcms, I get undefined reference to 'pcre_exec', 'pcre_compile'
and 'pcre_fullinfo' needed by libbooster.a e.g. in function
'booster::regex::match'.
Here is how I compile CppCMS in my environment installer Makefile:
Shared3rdParty/cppcms-1.0.2.target/pub/libcppcms.a:
Shared3rdParty/zlib-1.2.7.target/pub/lib/libz.a
Shared3rdParty/pcre-8.32.target/pub/lib/libpcre.a
cd Shared3rdParty/cppcms-1.0.2.target && mkdir -p -v build
cd Shared3rdParty/cppcms-1.0.2.target/build && cmake \
-DCMAKE_TOOLCHAIN_FILE="../../Product/gcc-${TOOLSUITE}.cmake" \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DDISABLE_ICU_LOCALE=ON \
-DDISABLE_POSIX_LOCALE=ON \
-DDISABLE_SHARED=ON \
-DDISABLE_GCRYPT=ON \
-DDISABLE_OPENSSL=ON \
-DDISABLE_OPENSSL=ON \
-DCMAKE_INSTALL_PREFIX="../pub" \
-DDISABLE_SCGI=ON \
-DDISABLE_HTTP=ON \
-DZLIB_INCLUDE_DIR="../../zlib-1.2.7.target/pub/include" \
-DZLIB="../../zlib-1.2.7.target/pub/lib/libz.a" \
-DPCRE_LIB="../../pcre-8.32.target/pub/lib/libpcre.so" \
-DCMAKE_INCLUDE_PATH="../../pcre-8.32.target/pub/include" \
-DCMAKE_LIBRARY_PATH="../../pcre-8.32.target/pub/lib" ..
cd Shared3rdParty/cppcms-1.0.2.target/build && make && make install
Here is how I compile pcre in the same makefile:
Shared3rdParty/pcre-8.32.target/pub/lib/libpcre.a:
cd Shared3rdParty/pcre-8.32.target && ./configure --host=${TOOLSUITE}
--prefix=`pwd`/pub
cd Shared3rdParty/pcre-8.32.target && make && make install
I do see the right path in CppCMS's CMakeCache.txt:
//Path to a library.
PCRE_LIB:FILEPATH=/work/eBox/Shared3rdParty/pcre-8.32.target/pub/lib/libpcre.so
and:
//Dependencies for the target
booster-static_LIB_DEPENDS:STATIC=general;
/usr/arm-linux-gnueabi/lib/libpthread.so;
general;
/work/eBox/Shared3rdParty/pcre-8.32.target/pub/lib/libpcre.so;general;
/usr/arm-linux-gnueabi/lib/libdl.so;
The pcre lib compiles fine and it is in the right path.
Cppcms uses the right path too.
Why isn't pcre get linked correctly to booster?
Sab
|
|
From: Artyom B. <art...@ya...> - 2013-03-23 15:02:32
|
Is it still relevant? What usually you do is not to specifiy explicitly the PCRE path but rather let CMake find it, -DCMAKE_INCLUDE_PATH="../../pcre-8.32.target/pub/include" \ -DCMAKE_LIBRARY_PATH="../../pcre-8.32.target/pub/lib:zlib-1.2.7.target/pub" .. Without ZLIB=... PCRE_LIB= etc. Note it is also to run make install in PCRE and ZLIB - install them to a single location with all correct files and libraries and THAN use rater than pointing to source directories. Also it seems that you are mixing shared and static libraries (../../pcre-8.32.target/pub/lib/libpcre.so") Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Sab <rim...@gm...> >To: cpp...@li... >Sent: Wednesday, March 20, 2013 5:22 PM >Subject: [Cppcms-users] Booster-PCRE linking > >Hi Artyom, > >I'm cross compiling my application and having trouble with linking the >static libraries. CppCMS compiles fine but when I compile my application >that uses cppcms, I get undefined reference to 'pcre_exec', 'pcre_compile' >and 'pcre_fullinfo' needed by libbooster.a e.g. in function >'booster::regex::match'. > >Here is how I compile CppCMS in my environment installer Makefile: > >Shared3rdParty/cppcms-1.0.2.target/pub/libcppcms.a: > Shared3rdParty/zlib-1.2.7.target/pub/lib/libz.a > Shared3rdParty/pcre-8.32.target/pub/lib/libpcre.a > cd Shared3rdParty/cppcms-1.0.2.target && mkdir -p -v build > cd Shared3rdParty/cppcms-1.0.2.target/build && cmake \ > -DCMAKE_TOOLCHAIN_FILE="../../Product/gcc-${TOOLSUITE}.cmake" \ > -DCMAKE_BUILD_TYPE=MinSizeRel \ > -DDISABLE_ICU_LOCALE=ON \ > -DDISABLE_POSIX_LOCALE=ON \ > -DDISABLE_SHARED=ON \ > -DDISABLE_GCRYPT=ON \ > -DDISABLE_OPENSSL=ON \ > -DDISABLE_OPENSSL=ON \ > -DCMAKE_INSTALL_PREFIX="../pub" \ > -DDISABLE_SCGI=ON \ > -DDISABLE_HTTP=ON \ > -DZLIB_INCLUDE_DIR="../../zlib-1.2.7.target/pub/include" \ > -DZLIB="../../zlib-1.2.7.target/pub/lib/libz.a" \ > -DPCRE_LIB="../../pcre-8.32.target/pub/lib/libpcre.so" \ > -DCMAKE_INCLUDE_PATH="../../pcre-8.32.target/pub/include" \ > -DCMAKE_LIBRARY_PATH="../../pcre-8.32.target/pub/lib" .. > cd Shared3rdParty/cppcms-1.0.2.target/build && make && make install > >Here is how I compile pcre in the same makefile: > >Shared3rdParty/pcre-8.32.target/pub/lib/libpcre.a: > cd Shared3rdParty/pcre-8.32.target && ./configure --host=${TOOLSUITE} >--prefix=`pwd`/pub > cd Shared3rdParty/pcre-8.32.target && make && make install > > >I do see the right path in CppCMS's CMakeCache.txt: > >//Path to a library. >PCRE_LIB:FILEPATH=/work/eBox/Shared3rdParty/pcre-8.32.target/pub/lib/libpcre.so > >and: > >//Dependencies for the target >booster-static_LIB_DEPENDS:STATIC=general; >/usr/arm-linux-gnueabi/lib/libpthread.so; >general; >/work/eBox/Shared3rdParty/pcre-8.32.target/pub/lib/libpcre.so;general; >/usr/arm-linux-gnueabi/lib/libdl.so; > > >The pcre lib compiles fine and it is in the right path. >Cppcms uses the right path too. >Why isn't pcre get linked correctly to booster? > >Sab > > > >------------------------------------------------------------------------------ >Everyone hates slow websites. So do we. >Make your web apps faster with AppDynamics >Download AppDynamics Lite for free today: >http://p.sf.net/sfu/appdyn_d2d_mar >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |