Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

315
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda