Hi all. I am a beginner to both QT and Eclipse. I use Qt 4.3.1 and C++ in Eclipse platform under Windows XP. I have integrated Qt and Eclipse and start Eclipse with MinGW. I am trying to link "PvAPI.a" to my project. This is how my *.pro file looks like: (according to solution one). The file name is "libPvAPI.a".
Reference:
http://public.kitware.com/pipermail/vtku…ber/093581.html
TEMPLATE = app
TARGET = AddressBook
QT += core \
gui \
opengl
HEADERS +=
SOURCES +=
FORMS +=
LIBS += -LC:\eclipsecpp\Qt\lib -lPvAPI ( also tried LIBS +=
-L"c:\eclipsecpp\Qt\lib" -lPvAPI )
INCLUDEPATH += C:\eclipsecpp\Qt\include
Result:
"... .....
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o
"release\AddressBook.exe" release\adddialog.o release\main.o release\addressbook.o release\moc_adddialog.o release\moc_addressbook.o
-L"c:\eclipsecpp\Qt\lib" -lopengl32 -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmain -LC:\eclipsecpp\Qt\lib -lPvAPI -lQtOpenGL4 -lQtGui4 -lQtCore4
release\main.o(.text+0x7):main.cpp: undefined reference to `PvInitialize@0'
release\main.o(.text+0x31):main.cpp: undefined reference to `CtrlCHandler(int)'
......
......
release\main.o(.text+0x142):main.cpp: undefined reference to `CameraUnsetup()'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\AddressBook.exe] Error 1
mingw32-make: *** [release] Error 2"
Now I tried renaming "libPvAPI.a" to "PvAPI.a" and repleced the 'LIBS' with the following line:
POST_TARGETDEPS += -C:\eclipsecpp\Qt\lib\PvAPI.a
Reference:
http://lists.trolltech.com/qt4-preview-f…7/msg00015.html
But the result was:
"..... ...... ......
-lqtmain -Lc:\eclipsecpp\Qt\lib -lPvAPI -lQtOpenGL4 -lQtGui4 -lQtCore4
release\main.o(.text+0x7):main.cpp: undefined reference to `PvInitialize@0'
.....
.....
release\main.o(.text+0x142):main.cpp: undefined reference to `CameraUnsetup()'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\AddressBook.exe] Error 1
mingw32-make[1]: Leaving directory `C:/eclipsecppws/AddressBook'
mingw32-make: *** [release] Error 2"
I would appreciate any help regarding this. Kindly let me know if I should make any modifications in the *.pro file. I would also like to let you know that I added "PvAPI.dll", "PvAPI.a" and "PvAPI.lib" manually to my project using Properties->C/C++ Project paths->Libaries. Thanks a lot!! :-)