Hi Kevin: Thank you very much for your reply!
Your are absolute right. The wsmp was written by Fortran. After I added the underscore, I have new "undefined reference" coming up. Here is a few examples of them: : undefined reference to `ftn_i_jishft' ../lib/libwsmp64.a(torder.o)(.text+0x11f9): In function `fllagbgref5_': : undefined reference to `ftn_i_jishft' ../lib/libwsmp64.a(torder.o)(.data+0x10): In function `.C4_283': : undefined reference to `pgf90_compiled' ../lib/libwsmp64.a(kl.o)(.text+0x99): In function `fllagbkref_': : undefined reference to `__mth_i_dlog' ../lib/libwsmp64.a(kl.o)(.text+0xbb): In function `fllagbkref_': : undefined reference to `__mth_i_dlog' ../lib/libwsmp64.a(kl.o)(.text+0x2479): In function `fllaglastbk_': : undefined reference to `__mth_i_dlog' ../lib/libwsmp64.a(kl.o)(.text+0x249b): In function `fllaglastbk_': : undefined reference to `__mth_i_dlog' ../lib/libwsmp64.a(kl.o)(.text+0x4847): In function `bkref2_': : undefined reference to `__mth_i_dlog' ../lib/libwsmp64.a(kl.o)(.text+0x61ef): more undefined references to `__mth_i_dl og' follow ../lib/libwsmp64.a(kl.o)(.data+0x40): In function `.C4_365': : undefined reference to `pgf90_compiled' ../lib/libwsmp64.a(vkl.o)(.text+0x3dd): In function `lastvk2_': : undefined reference to `__mth_i_dlog' Could you please tell me how to solve those errors. They are not functions in wsmp, but called by wsmp. Thanks a lot! Yinghong On Tue, 12 Jul 2005, Kevin B. McCarty wrote: > Yinghong Zhou wrote: > > > I also used rtc() in my program. The linker doesn't report error on this > > one. Following is how I declare the functions in my program: > > > > extern "C" { > > void wssmp( int* N, int* IA, int* JA, double* AVALS, double* DIAG, > > int* PERM, int* INVP, double* B, int *LDB, > > int* NRHS, double* AUX, int* NAUX, int* MRP, int* IPARM, > > double* DPARM ); > > double rtc(); > > void wsetmaxthrds(int*); > > void wsetnobigmal(); > > } > > With functions having this sort of signature, I am guessing that the > library was written in FORTRAN? > > > Here is how my Makefile looks: > > all: > > g++ -o wgsmp wgsmp_ex1.cpp -L../lib/libgoto_opteron-64-r0.99-3.so > > -L../lib -lwsmp64 -lpthread -Wno-deprecated > > > > The author said it may have something to do with the compiler inserting > > trailing underscores, etc. > > G77 for reasons unknown likes to add an underscore to the end of the > names of functions defined in FORTRAN. So in your code, you probably > need to declare and use wssmp_() instead of wssmp(), etc., everywhere. > To avoid the need for the ugly underscore, you can > > #define wssmp wssmp_ > > (etc.) at the top of the file where you declare the functions. > > regards, > > -- > Kevin B. McCarty <[EMAIL PROTECTED]> Physics Department > WWW: http://www.princeton.edu/~kmccarty/ Princeton University > GPG: public key ID 4F83C751 Princeton, NJ 08544 > > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] > > -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]