Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing stdc++ in during linking? #4

Open
skwirrel opened this issue Oct 21, 2014 · 2 comments
Open

Missing stdc++ in during linking? #4

skwirrel opened this issue Oct 21, 2014 · 2 comments

Comments

@skwirrel
Copy link

"make test" failed for me (running on Ubuntu 12.10) with

Warning: PHP Startup: Unable to load dynamic library '/www/sass/sassphp/modules/sass.so' - /www/sass/sassphp/modules/sass.so: undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE in Unknown on line 0

I suspect this may be similar to...
kjdev/php-ext-snappy#1

After some digging I re-ran the libtool link command with an additional "-lstdc++" thus...

libtool --mode=link cc -DPHP_ATOM_INC -I/www/sass/sassphp/include -I/www/sass/sassphp/main -I/www/sass/sassphp -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib  -DHAVE_CONFIG_H  -g -O2  -lsass -L/www/sass/sassphp/lib/libsass/ -lstdc++ -o sass.la -export-dynamic -avoid-version -prefer-pic -module -rpath /www/sass/sassphp/modules  src/sass.lo src/utilities.lo 

Followed by the libtool install...

libtool --mode=install cp ./sass.la /www/sass/sassphp/modules

When I reran make-test it all worked fine.

I appreaciate this isn't the final solution - I guess there is some magic needs adding to the .m4 file or some such but I'm afraid this is at the very edge of my understanding. I hope this helps.

@chrinor2002
Copy link

I was able to resolve this in my case by adding the flag to the LDFLAGS in config.m4:

LDFLAGS="-lsass -L"pwd"/lib/libsass/ -lstdc++"

Seems to work, but I have no clue if thats the right place to be putting that.

@entr
Copy link

entr commented Jun 2, 2015

my make test

/bin/bash /home/zlatev/sassphp/libtool --mode=link cc -DPHP_ATOM_INC -I/home/zlatev/sassphp/include -I/home/zlatev/sassphp/main -I/home/zlatev/sassphp -I/home/zlatev/phpfarm/inst/php-5.6.8/include/php -I/home/zlatev/phpfarm/inst/php-5.6.8/include/php/main -I/home/zlatev/phpfarm/inst/php-5.6.8/include/php/TSRM -I/home/zlatev/phpfarm/inst/php-5.6.8/include/php/Zend -I/home/zlatev/phpfarm/inst/php-5.6.8/include/php/ext -I/home/zlatev/phpfarm/inst/php-5.6.8/include/php/ext/date/lib  -DHAVE_CONFIG_H  -DLIBSASS_VERSION="\"3.2.4\"" -g -O2  -lsass -L/home/zlatev/sassphp/lib/libsass/lib/ -lstdc++ -o sass.la -export-dynamic -avoid-version -prefer-pic -module -rpath /home/zlatev/sassphp/modules  src/sass.lo src/utilities.lo 
cc -shared  src/.libs/sass.o src/.libs/utilities.o  -lsass -L/home/zlatev/sassphp/lib/libsass/lib/ -lstdc++  -Wl,-soname -Wl,sass.so -o .libs/sass.so
/usr/bin/ld: cannot find -lsass
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
make: *** [sass.la] Error 1

Edit: Never mind. Apparently I was missing g++ and/or build-essentials.

grubdragon added a commit to grubdragon/lanterndb that referenced this issue Aug 25, 2023
On compiling postgresql and lanterndb from source from scratch, without
installing postgresql core, the lanterndb extension compiles and
installs, but it is unable to execute `CREATE EXTENSION lanterndb;` with
the error `undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE`.
This is due to libstc++ not being linked. Switching the LINKER_LANGUAGE
to CXX allows the build system to use a C++ linker and solves the issue.

References:
- sensational/sassphp#4
- Iorethan/opencv_pfm#1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants