Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

319
Visualizações
SymbolicC++ error on linux

I am trying to install SymbolicC++ from SymbolicC++3-3.35-ac.tar on Ubuntu 15.10. I did a ./configure, make, sudo make install with no errors.

I tried to compile the following with g++ test1.cpp -lsymbolicc++:

#include <iostream>
#include "symbolicc++.h" 
using namespace std;

int main(void)
{
  Symbolic x("x");
  cout << integrate(x+1, x) <<endl;       // => 1/2*x^(2)+x
  Symbolic y("y");
  cout << df(y, x) << endl;               // => 0
  cout << df(y[x], x) << endl;            // => df(y[x],x)
  cout << df(exp(cos(y[x])), x) << endl ; 
                             // => -sin(y[x])*df(y[x],x)*e^cos(y[x])
  return 0;
}

This code was from the Wikipedia article on SymbolicC++

I get the following errors:

doug@doug-Z170X-UD5:~/books_computerAlgebraSys$ g++ test1.cpp -lsymbolicc++
/usr/local/lib/libsymbolicc++.so: undefined reference to `Number<double>::Number(double const&)'
/usr/local/lib/libsymbolicc++.so: undefined reference to `Number<int>::Number(int const&)'
collect2: error: ld returned 1 exit status
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Try to add "-fno-elide-constructors" to the g++ command line:

g++ test1.cpp -lsymbolicc++ -fno-elide-constructors

From the project main page http://issc.uj.ac.za/symbolic/symbolic.html:

Users of SymbolicC++ with GCC on 64-bit may need to use the -fno-elide-constructors flag.

Edit: But that seems to apply more to the header-only version of the library (there are two versions, header-only and the Autoconf library version). But I tried with your example and the AC library and for me it builds and works fine even without the "-fno-elide-constructors" (Ubuntu 14.04 64-bit, g++ 4.8.4).

Edit 2: To wrap up, it seems that the library autoconf version does not work on every machine for some reason. With the header-only library, the -fno-elide-constructors flag needs to be used with 64-bit, and the -I option to point to the headers location (where the library is unpacked):

g++ test1.cpp -fno-elide-constructors -I<path_to_headers>
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda