LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   help compiling this C++ code (https://www.linuxquestions.org/questions/programming-9/help-compiling-this-c-code-506028/)

hedpe 11-29-2006 06:03 PM

help compiling this C++ code
 
Hi,

I am trying to compile code with the Click software router which is in c++. I am getting the following errors:
Code:

g++-3.2.1 -DHAVE_CONFIG_H -I../include -I../include -I. -I..  -DCLICK_USERLEVEL -g -O2  -c ../elements/local/cmp.cc
../elements/local/cmp.cc: In function `int __gmpz_cmp(const __mpz_struct*,
  const __mpz_struct*)':
../elements/local/cmp.cc:36: declaration of `int __gmpz_cmp(const
  __mpz_struct*, const __mpz_struct*)' throws different exceptions
../elements/local/gmp.h:671: than previous declaration `int __gmpz_cmp(const
  __mpz_struct*, const __mpz_struct*) throw ()'
make: *** [cmp.o] Error 1

Here is cmp.cc:
http://www.rafb.net/paste/results/Wsytav71.html

and gmp.h:
http://www.rafb.net/paste/results/LSCP9670.html

Thanks!
George

asgeirss 11-30-2006 11:44 PM

Hi George,

Your links don't seem to work, I can't read the source files.

Basically the error means that gmpz_cmp is using different sets of exceptions... Were the two files distributed together?

If they were not distributed in one package, then it might be a version incompatibility. Otherwise, you could always try editing one of the
two source files so that the 'throw' statements are the same.

Good luck.
- Dave

hedpe 11-30-2006 11:45 PM

ahhh, i got it working... there was an #ifdef that was breaking things... the function prototype was not matching the function being compiled.

Thank you very much :)

- George


All times are GMT -5. The time now is 07:00 AM.