Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

317
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!