Saturday, July 5th 2008, 4:55am UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

arthivasu

Beginner

Posts: 1

Occupation: Student

1

Saturday, January 19th 2008, 9:47pm

Error in makefile

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!! :-)
  • Go to the top of the page

2

Saturday, May 3rd 2008, 2:42am

RE: Error in makefile

.a files are prefixed with lib for consistency . so libFile.a is consistent and you can link by saying -lFile otherwise you need to use a different extension, .lib comes to mind
  • Go to the top of the page

Rate this thread