libtool uses cc to link a mixed C/C++ project and fails to find operator new

Yuri <[email protected]>
Newsgroups gmane.comp.gnu.libtool.general
Message-ID <[email protected]>
On FreeBSD libtool can't find operator new[] because it is in C mode:

libtool: link: cc -fno-strict-aliasing -fopenmp -ftree-vectorize 
-pthread -O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong 
-fno-strict-aliasing -fno-strict-aliasing -fstack-protector-strong -o 
RNALfold RNALfold_cmdl.o RNALfold.o 
../../src/ViennaRNA/.libs/libRNA_conv.a ./.libs/libhelpers.a -lm 
-pthread -fopenmp
libtool: link: cc -fno-strict-aliasing -fopenmp -ftree-vectorize 
-pthread -O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong 
-fno-strict-aliasing -fno-strict-aliasing -fstack-protector-strong -o 
RNALalifold RNALalifold_cmdl.o RNALalifold.o  
../../src/ViennaRNA/.libs/libRNA_conv.a ./.libs/libhelpers.a -lm 
-pthread -fopenmp
ld: error: undefined symbol: operator new[](unsigned long)
 >>> referenced by svm.cpp
 >>>               svm.o:(Kernel::Kernel(int, svm_node* const*, 
svm_parameter const&)) in archive ../../src/ViennaRNA/.libs/libRNA_conv.a



I added "LT_LANG([C++]) to configure.ac but it didn't help:

AC_PROG_LIBTOOL
LT_INIT([pic-only, static])
LT_LANG([C++])
AC_SUBST(LIBTOOL_DEPS)


How to switch libtool to the C++ mode?


The source tarball: 
https://www.tbi.univie.ac.at/RNA/download/sourcecode/2_4_x/ViennaRNA-2.4.13.tar.gz


Thank you,

Yuri


_______________________________________________
https://lists.gnu.org/mailman/listinfo/libtool
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.