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

2019-06-23 Thread Bob Friesenhahn
On Sun, 23 Jun 2019, Yuri wrote: So is there an easy way to override this and always use C++ way of linking? To do this you might need to set LD or CC to your C++ compiler. A better way is to make your main program be C++ since that assures it can work. Consider that C++ exceptions can no

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

2019-06-23 Thread Yuri
On 2019-06-23 17:29, Bob Friesenhahn wrote: I doubt that libtool can be smart enough to intuit when the C++ compiler needs to be used for linking when the program being linked is C.  The only way it could tell this is via library dependencies.  Just supplying the library dependencies is not

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

2019-06-23 Thread Bob Friesenhahn
On Sun, 23 Jun 2019, Yuri wrote: Those variables could be used to tune build process. For instance CXX=my-c++ ./configure ... could be used to change C++ compiler. It seems to know that c++ is the C++ compiler, but then uses cc anyway: I doubt that libtool can be smart enough to intuit whe

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

2019-06-23 Thread Yuri
On 2019-06-23 12:45, Roumen Petrov wrote: If clang is default OS compiler is expected symbolic link c++ to clang++ or similar. May be some OS setup commands could set such links. Remark: At end ./configure --help outputs environment variables . Those variables could be used to tune build pr

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

2019-06-23 Thread Roumen Petrov
Yuri wrote: On 2019-06-23 12:19, Roumen Petrov wrote: cc ? I'm not sure which compiler suite is used on FreeBSD but it seems to me C++ compiler is not installed. clang8 is used. cc is a C compiler, c++ is a C++ compiler. Ok. Dunno why is not detected c++ at configure time. I'm not familiar

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

2019-06-23 Thread Yuri
On 2019-06-23 12:19, Roumen Petrov wrote: cc ? I'm not sure which compiler suite is used on FreeBSD but it seems to me C++ compiler is not installed. clang8 is used. cc is a C compiler, c++ is a C++ compiler. Yuri ___ https://lists.gnu.org/ma

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

2019-06-23 Thread Roumen Petrov
Yuri wrote: 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

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

2019-06-23 Thread Yuri
On 2019-06-23 12:06, Bob Friesenhahn wrote: Are you using expected file extensions for C++ code?  Is your main program a C++ module or a C module? C++ code uses .cpp extension. main programs are all in .c files. Yuri ___ https://lists.gnu.or

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

2019-06-23 Thread Bob Friesenhahn
On Sun, 23 Jun 2019, Yuri wrote: On FreeBSD libtool can't find operator new[] because it is in C mode: How to switch libtool to the C++ mode? Are you using expected file extensions for C++ code? Is your main program a C++ module or a C module? Bob -- Bob Friesenhahn bfrie...@simple.dallas

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

2019-06-23 Thread Yuri
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_cmd