![]() |
![]() |
#1 |
Mar 2006
2 Posts |
![]()
When I try to bind libecm.a with a C++ file, I get
Code:
undefined reference to `ecm_factor(__mpz_struct*, __mpz_struct*, double, __ecm_param_struct*)' The library works fine when I use it in C files. I'm using: gmp-ecm 6.0.1 gmp 4.1.4 gcc 3.3.4 on x86 Linux Any help is greatly appreciated. Thanks, poire |
![]() |
![]() |
![]() |
#2 |
Jun 2005
3·5 Posts |
![]()
C++ mangles names but C does not. I believe this is the reason for the problem.
To solve it change: #include <ECM.h> to extern "C" { #include <ECM.h> } I hope that helps. Basically this tells the linker to look for the unmangled version of these functions i.e. the C version. Please tell us how you go with this fix. This is from memory so I hope it contains no mistakes. |
![]() |
![]() |
![]() |
#3 |
Mar 2006
2 Posts |
![]()
This solves the problem.
Thanks a lot. |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Posting log files or other text files | Xyzzy | Forum Feedback | 3 | 2018-12-30 19:37 |
Is libecm thread-safe? | frmky | GMP-ECM | 5 | 2009-02-28 16:08 |
Help using .ini files only in v24 | petrw1 | PrimeNet | 1 | 2008-10-15 03:24 |
using libecm from python | yqiang | GMP-ECM | 2 | 2007-04-22 00:14 |
The Status Files | Axel Fox | PrimeNet | 3 | 2004-07-20 02:27 |