Author Topic: error in linking external library itpp  (Read 3010 times)

arash

  • Guest
error in linking external library itpp
« on: December 20, 2007, 04:00:09 pm »
hi
I have needed to write a mathematical program.so i choosed itpp library.i installed msys-1.0.10 and mingw-5.1.3 then i compiled the dependencies library for itpp:
liblapack,libblas and fftw3(lapack and blas have been written whit fortran)
after that i built itpp and compiled itpp tutorial sample
program in msys environment whit the following comand successfully.
Code: [Select]
g++ `itpp-config --cflags` example.cpp -o example.exe `itpp-config --static --libs`output of itpp-config --cflags is:
              
Code: [Select]
-I/usr/local/include -march=i486 -O2output of itpp-config --static --libs is:
      
Code: [Select]
-L/usr/local/lib -litpp -L/usr/local/lib -lfftw3 -llapack -lblas -lfrtbegin -lg2c -lmingw32 -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32then i decided to use codeblocks for developing my program.i installed last version without mingw
and configured it according to this instructions:
Code: [Select]
Code::Blocks:
Open up Code::Blocks, it will ask you what compiler to use, tell it MinGW if that's an option. If not, just ignore it and move on. When C::B starts up, go to "Settings > Compiler and debugger...", and it will open a new window.

Select the "Search directories" tab, and if it's cool, it should already have MinGW\include selected, but if not, press the "Add" button and enter "C:\MinGW\include" into the text box. Then go to the 'Linker' sub-tab and do all of the same above except enter "C:\MinGW\lib" into the box. Do the exact same thing you did to the "Compiler" sub-tab to the "Resource compiler" sub-tab.

Then enter "Toolchain Executables", put "C:\MinGW" into the installation directory and add to each text box this list as follows... (these really should already be there)
- mingw32-gcc.exe
- mingw32-g++.exe
- mingw32-g++.exe
- ar.exe
- gdb.exe
- windres.exe
- mingw32-make.exe
And after doing that select the "Additional Paths" sub-tab and insert "C:\MinGW\libexec\gcc\mingw32\3.4.5" (or whatever your installation version is, the recent one is 3.4.5) into that list. You will have to do this step if you selected MinGW at first or not!
Then go ahead and make a test program by creating a new Win32 GUI Project and seeing if it runs. Everything should be in order.
and added this forteen library in the stting -> compiler-> linker tab
 
Code: [Select]
D:\msys\local\lib\libitpp.a
D:\msys\local\lib\liblapack.a
D:\msys\local\lib\libfftw3.a
D:\msys\local\lib\libblas.a
D:\MinGW\lib\libshell32.a
D:\MinGW\lib\libfrtbegin.a
D:\MinGW\lib\libg2c.a
D:\MinGW\lib\libkernel32.a
D:\MinGW\lib\libmingw32.a
D:\MinGW\lib\libmingwex.a
D:\MinGW\lib\libmoldname.a
D:\MinGW\lib\libmsvcrt.a
D:\MinGW\lib\libadvapi32.a
D:\MinGW\lib\libuser32.a
after this long story i tried to compile example.cpp in codeblocks in linking step is occured

Code: [Select]
Switching to target: default
Compiling: main.cpp
Linking console executable: D:\Documents and Settings\ra\My Documents\codeblock\example\console.exe
blas.a(xerbla.o):xerbla.f:(.text+0xe): undefined reference to `s_wsfe'
D:\msys\local\lib\libblas.a(xerbla.o):xerbla.f:(.text+0x2a): undefined reference to `do_fio'
D:\msys\local\lib\libblas.a(xerbla.o):xerbla.f:(.text+0x46): undefined reference to `do_fio'
D:\msys\local\lib\libblas.a(xerbla.o):xerbla.f:(.text+0x4b): undefined reference to `e_wsfe'
D:\msys\local\lib\libblas.a(xerbla.o):xerbla.f:(.text+0x5d): undefined reference to `s_stop'
D:\msys\local\lib\liblapack.a(zgetri.o):zgetri.f:(.text+0xb17): undefined reference to `ztrsm_'
D:\msys\local\lib\liblapack.a(zgetrf.o):zgetrf.f:(.text+0x4b8): undefined reference to `ztrsm_'
D:\msys\local\lib\liblapack.a(dgetri.o):dgetri.f:(.text+0x8f4): undefined reference to `dtrsm_'
D:\msys\local\lib\liblapack.a(dgetrf.o):dgetrf.f:(.text+0x4af): undefined reference to `dtrsm_'
D:\msys\local\lib\liblapack.a(ztrtri.o):ztrtri.f:(.text+0x35e): undefined reference to `s_cat'
D:\msys\local\lib\liblapack.a(ztrtri.o):ztrtri.f:(.text+0x62b): undefined reference to `ztrmm_'
D:\msys\local\lib\liblapack.a(ztrtri.o):ztrtri.f:(.text+0x6ab): undefined reference to `ztrsm_'
D:\msys\local\lib\liblapack.a(ztrtri.o):ztrtri.f:(.text+0x88d): undefined reference to `ztrmm_'
D:\msys\local\lib\liblapack.a(ztrtri.o):ztrtri.f:(.text+0x922): undefined reference to `ztrsm_'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x144): undefined reference to `s_copy'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x222): undefined reference to `s_copy'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x246): undefined reference to `s_copy'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x26a): undefined reference to `s_copy'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x2ab): undefined reference to `s_cmp'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x2d9): undefined reference to `s_cmp'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x312): undefined reference to `s_copy'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x33d): undefined reference to `s_cmp'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x373): undefined reference to `s_cmp'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x39d): undefined reference to `s_cmp'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x3c7): undefined reference to `s_cmp'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x3f5): undefined reference to `s_cmp'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x423): more undefined references to `s_cmp' follow
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x4a1): undefined reference to `s_copy'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x4ce): undefined reference to `s_copy'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x4fb): undefined reference to `s_copy'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x528): undefined reference to `s_copy'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x553): undefined reference to `s_cmp'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x599): undefined reference to `s_cmp'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x5e2): undefined reference to `s_cmp'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x624): undefined reference to `s_cmp'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x652): undefined reference to `s_cmp'
D:\msys\local\lib\liblapack.a(ilaenv.o):ilaenv.f:(.text+0x680): more undefined references to `s_cmp' follow
D:\msys\local\lib\liblapack.a(zgetf2.o):zgetf2.f:(.text+0x1c7): undefined reference to `izamax_'
D:\msys\local\lib\liblapack.a(zgetf2.o):zgetf2.f:(.text+0x279): undefined reference to `zgeru_'
D:\msys\local\lib\liblapack.a(zgetf2.o):zgetf2.f:(.text+0x2c0): undefined reference to `z_abs'
D:\msys\local\lib\liblapack.a(dtrtri.o):dtrtri.f:(.text+0x41f): undefined reference to `s_cat'
D:\msys\local\lib\liblapack.a(dtrtri.o):dtrtri.f:(.text+0x691): undefined reference to `dtrmm_'
D:\msys\local\lib\liblapack.a(dtrtri.o):dtrtri.f:(.text+0x70e): undefined reference to `dtrsm_'
D:\msys\local\lib\liblapack.a(dtrtri.o):dtrtri.f:(.text+0x8e9): undefined reference to `dtrmm_'
D:\msys\local\lib\liblapack.a(dtrtri.o):dtrtri.f:(.text+0x983): undefined reference to `dtrsm_'
D:\msys\local\lib\liblapack.a(dgetf2.o):dgetf2.f:(.text+0x149): undefined reference to `idamax_'
D:\msys\local\lib\liblapack.a(dgetf2.o):dgetf2.f:(.text+0x32f): undefined reference to `dger_'
D:\msys\local\lib\liblapack.a(zgebak.o):zgebak.f:(.text+0x314): undefined reference to `zdscal_'
D:\msys\local\lib\liblapack.a(zgebak.o):zgebak.f:(.text+0x360): undefined reference to `zdscal_'
D:\msys\local\lib\liblapack.a(zgebak.o):zgebak.f:(.text+0x391): undefined reference to `zdscal_'
D:\msys\local\lib\liblapack.a(zgebak.o):zgebak.f:(.text+0x3bc): undefined reference to `zdscal_'
D:\msys\local\lib\liblapack.a(zgebak.o):zgebak.f:(.text+0x3e7): undefined reference to `zdscal_'
D:\msys\local\lib\liblapack.a(zgebak.o):zgebak.f:(.text+0x40d): more undefined references to `zdscal_' follow
D:\msys\local\lib\liblapack.a(zgehrd.o):zgehrd.f:(.text+0x95c): undefined reference to `ztrmm_'
D:\msys\local\lib\liblapack.a(zgehrd.o):zgehrd.f:(.text+0x9c4): undefined reference to `zaxpy_'
D:\msys\local\lib\liblapack.a(zgehrd.o):zgehrd.f:(.text+0xa38): undefined reference to `zaxpy_'
D:\msys\local\lib\liblapack.a(zgehrd.o):zgehrd.f:(.text+0xa8f): undefined reference to `zaxpy_'
D:\msys\local\lib\liblapack.a(zgehrd.o):zgehrd.f:(.text+0xadf): undefined reference to `zaxpy_'
D:\msys\local\lib\liblapack.a(zgehrd.o):zgehrd.f:(.text+0xb3b): undefined reference to `zaxpy_'
D:\msys\local\lib\liblapack.a(zgehrd.o):zgehrd.f:(.text+0xb8d): more undefined references to `zaxpy_' follow
D:\msys\local\lib\liblapack.a(zgebal.o):zgebal.f:(.text+0xa00): undefined reference to `izamax_'
D:\msys\local\lib\liblapack.a(zgebal.o):zgebal.f:(.text+0xa0f): undefined reference to `z_abs'
D:\msys\local\lib\liblapack.a(zgebal.o):zgebal.f:(.text+0xa59): undefined reference to `izamax_'
D:\msys\local\lib\liblapack.a(zgebal.o):zgebal.f:(.text+0xa7d): undefined reference to `z_abs'
D:\msys\local\lib\liblapack.a(zgebal.o):zgebal.f:(.text+0xe40): undefined reference to `zdscal_'
D:\msys\local\lib\liblapack.a(zgebal.o):zgebal.f:(.text+0xe71): undefined reference to `zdscal_'
D:\msys\local\lib\liblapack.a(zlange.o):zlange.f:(.text+0xad): undefined reference to `z_abs'
D:\msys\local\lib\liblapack.a(zlange.o):zlange.f:(.text+0xda): undefined reference to `z_abs'
D:\msys\local\lib\liblapack.a(zlange.o):zlange.f:(.text+0xfb): undefined reference to `z_abs'
D:\msys\local\lib\liblapack.a(zlange.o):zlange.f:(.text+0x134): undefined reference to `z_abs'
D:\msys\local\lib\liblapack.a(zlange.o):zlange.f:(.text+0x14d): undefined reference to `z_abs'
D:\msys\local\lib\liblapack.a(zlange.o):zlange.f:(.text+0x166): more undefined references to `z_abs' follow
D:\msys\local\lib\liblapack.a(dlamch.o):dlamch.f:(.text+0xde4): undefined reference to `s_wsfe'
D:\msys\local\lib\liblapack.a(dlamch.o):dlamch.f:(.text+0xe00): undefined reference to `do_fio'
D:\msys\local\lib\liblapack.a(dlamch.o):dlamch.f:(.text+0xe05): undefined reference to `e_wsfe'
D:\msys\local\lib\liblapack.a(zhseqr.o):zhseqr.f:(.text+0x47e): undefined reference to `s_cat'
D:\msys\local\lib\liblapack.a(dgehrd.o):dgehrd.f:(.text+0x7eb): undefined reference to `dtrmm_'
D:\msys\local\lib\liblapack.a(dgehrd.o):dgehrd.f:(.text+0x84f): undefined reference to `daxpy_'
D:\msys\local\lib\liblapack.a(dgehrd.o):dgehrd.f:(.text+0x8bf): undefined reference to `daxpy_'
D:\msys\local\lib\liblapack.a(dgehrd.o):dgehrd.f:(.text+0x912): undefined reference to `daxpy_'
D:\msys\local\lib\liblapack.a(dgehrd.o):dgehrd.f:(.text+0x95e): undefined reference to `daxpy_'
D:\msys\local\lib\liblapack.a(dgehrd.o):dgehrd.f:(.text+0x9b7): undefined reference to `daxpy_'
D:\msys\local\lib\liblapack.a(dgehrd.o):dgehrd.f:(.text+0xa05): more undefined references to `daxpy_' follow
D:\msys\local\lib\liblapack.a(dgebal.o):dgebal.f:(.text+0x732): undefined reference to `idamax_'                  and....(i think in total there was 125 error like this erros)
collect2: ld returned 1 exit status
Process terminated with status 1 (1 minutes, 24 seconds)
0 errors, 0 warnings
please help me
thanks

« Last Edit: December 20, 2007, 04:51:04 pm by arash »