Re: Linking DLL to Project
This post steps through doing the setup for a different library but they apply equally here.
Only the DLL should put into the Windows System32 directory: it is the only runtime requirement.
The header file needs to be found in the path you add to INCLUDEPATH
The link libraries need to be found in the path you add to LIBS with -L, and identified with the -l option (libfftw3.a or libfftw3.lib depending on compiler).
We don't know how you have 'installed' the library on Windows so we cannot give you exact paths. This is what the installation looks like on UNIX:
Code:
/tmp/fftw
/tmp/fftw/lib
/tmp/fftw/lib/libfftw3.so.3.2.4
/tmp/fftw/lib/libfftw3.a // link time library, may be .lib for MSVC
/tmp/fftw/lib/libfftw3.la
/tmp/fftw/lib/pkgconfig
/tmp/fftw/lib/pkgconfig/fftw3.pc
/tmp/fftw/lib/libfftw3.so // run time dynamic library, the DLL on Windows
/tmp/fftw/lib/libfftw3.so.3
/tmp/fftw/share
/tmp/fftw/share/info
/tmp/fftw/share/info/fftw3.info
/tmp/fftw/share/info/dir
/tmp/fftw/share/man
/tmp/fftw/share/man/man1
/tmp/fftw/share/man/man1/fftw-wisdom.1
/tmp/fftw/share/man/man1/fftw-wisdom-to-conf.1
/tmp/fftw/bin
/tmp/fftw/bin/fftw-wisdom
/tmp/fftw/bin/fftw-wisdom-to-conf
/tmp/fftw/include
/tmp/fftw/include/fftw3.h // compile time include
/tmp/fftw/include/fftw3.f
for which you would set
Code:
INCLUDEPATH += /tmp/fftw/include
LIBS += -L/tmp/fftw/lib -lfftw3
Re: Linking DLL to Project
Hello,
Could you have more details about compiling fftw and linking it to my .pro?
I tried to add fftw to my .pro
LIBS += -libfftw3-3\
-libfftw3f-3\
-libfftw3l-3\
"C:/OpenCV-2.3.1MinGW/lib/libopencv_core231.dll.a" \
"C:/OpenCV-2.3.1MinGW/lib/libopencv_highgui231.dll.a" \
"C:/OpenCV-2.3.1MinGW/lib/libopencv_imgproc231.dll.a" \
"C:/QtSDK/mingw/lib/libgdi32.a"
and i hace the following error
mingw32-make.exe: *** [debug] Error 2
14:44:23: Le processus "C:\QtSDK\mingw\bin\mingw32-make.exe" s'est terminé avec le code 2.
Thanks
Best regards,
Maroua
Re: Linking DLL to Project
Are You sure that this is correct name of library file : libopencv_core231.dll.a ?
Do not be libopencv_core231.dll or libopencv_core231.a ?
I'm not using mingw on Windows but for me it is strange.
Re: Linking DLL to Project
Quote:
Originally Posted by
maroua_
Hello,
Could you have more details about compiling fftw and linking it to my .pro?
I tried to add fftw to my .pro
Code:
LIBS += -libfftw3-3\
// blank line?
-libfftw3f-3\
// blank line?
-libfftw3l-3\
// blank line?
"C:/OpenCV-2.3.1MinGW/lib/libopencv_core231.dll.a" \
// blank line?
"C:/OpenCV-2.3.1MinGW/lib/libopencv_highgui231.dll.a" \
// blank line?
"C:/OpenCV-2.3.1MinGW/lib/libopencv_imgproc231.dll.a" \
// blank line?
"C:/QtSDK/mingw/lib/libgdi32.a"
If the name of the library file is libfftw3f-3.so (for example) then the LIBS entry should look like this:
that is, a -l option followed by "fftw3f-3" as the argument.
If the blank lines in your LIBS entry (marked above) are actually present in your PRO file then remove them.