Trolltech Home | Qt4-preview-feedback Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt4-preview-feedback Archive, January 2008
Qt Eclipse Intergration - Error in Makefile


Message 1 in thread

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/vtkusers/2007-December/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'<%60PvInitialize@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: *** [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-feedback/2007-07/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'<%60PvInitialize@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 aded "PvAPI.dll", "PvAPI.a" and "PvAPI.lib" manually to my project
using Properties->C/C++ Project paths->Libaries. Thanks a lot!!

Message 2 in thread

Hi,

Arthi Vasudevan wrote:
> LIBS += -LC:\eclipsecpp\Qt\lib -lPvAPI        ( also tried  LIBS += 
> -L"c:\eclipsecpp\Qt\lib" -lPvAPI )
> INCLUDEPATH += C:\eclipsecpp\Qt\include
> 
> 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' <mailto:%60PvInitialize@0'>
> ......

It seems to me as if your linker actually finds all libraries (also PvAPI) but cannot find the referenced symbols in any of them.
If it didn't find PvAPI, an error message like the following would appear:

   ld.exe: cannot find -lPvAPI
   collect2: ld returned 1 exit status

So, I believe that Your .pro file is correct, but the library isn't for some reason.

> ... I would also like to 
> let you know that I aded "PvAPI.dll", "PvAPI.a" and " PvAPI.lib" 
> manually to my project using Properties->C/C++ Project paths->Libaries. 
> Thanks a lot!!

These settings do not have effect since qmake is used for generating the makefile. And qmake only uses the information from the .pro file.

Best regards,
Alessandro Portale

To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx


Message 3 in thread

Thank you very much Mr. Portale! That solves one problem! :-) Now I need to
make sure PvAPI.a actually includes all the references that I want for my
project.

PS: Do you have any suggestions as to how I should proceed? This is how I
created the .a file:

PvAPI.dll -> PvAPI.def (usinf "impdef") and PvAPI.def-> PvAPI.a (using
"dlltool")

Thanks again!
Arthi

On Jan 22, 2008 5:33 AM, Alessandro Portale <
Alessandro.Portale@xxxxxxxxxxxxx> wrote:

> Hi,
>
> Arthi Vasudevan wrote:
> > LIBS += -LC:\eclipsecpp\Qt\lib -lPvAPI        ( also tried  LIBS +=
> > -L"c:\eclipsecpp\Qt\lib" -lPvAPI )
> > INCLUDEPATH += C:\eclipsecpp\Qt\include
> >
> > 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' <mailto:%60PvInitialize@0'>
> > ......
>
> It seems to me as if your linker actually finds all libraries (also PvAPI)
> but cannot find the referenced symbols in any of them.
> If it didn't find PvAPI, an error message like the following would appear:
>
>   ld.exe: cannot find -lPvAPI
>   collect2: ld returned 1 exit status
>
> So, I believe that Your .pro file is correct, but the library isn't for
> some reason.
>
> > ... I would also like to
> > let you know that I aded "PvAPI.dll", "PvAPI.a" and " PvAPI.lib"
> > manually to my project using Properties->C/C++ Project paths->Libaries.
> > Thanks a lot!!
>
> These settings do not have effect since qmake is used for generating the
> makefile. And qmake only uses the information from the .pro file.
>
> Best regards,
> Alessandro Portale
>
> To unsubscribe - send "unsubscribe" in the subject to
> qt4-preview-feedback-request@xxxxxxxxxxxxx
>
>

Message 4 in thread

Hi,

if I understand correctly, You have a PvAPI.dll/.lib for Visual Studio and want to use it with MinGW. I actually have no experience with transforming the libs with impdef and dlltool.
If those tools do not do what they should, I see two solutions for your issue.

 1) Use the free Visual Studio Express for your development. It is fast and its debugger has all needed features. Qt OpenSource can be used with it.
 2) Ask Prosilica to provide you with MinGW builds of their SDK (But I guess, You already did that)

Best Regards,
Alessandro Portale

Arthi Vasudevan schrieb:
> Thank you very much Mr. Portale! That solves one problem! :-) Now I need 
> to make sure PvAPI.a actually includes all the references that I want 
> for my project.
>  
> PS: Do you have any suggestions as to how I should proceed? This is how 
> I created the .a file:
>  
> PvAPI.dll -> PvAPI.def (usinf "impdef") and PvAPI.def-> PvAPI.a (using 
> "dlltool")
>  
> Thanks again!
> Arthi
> 
> On Jan 22, 2008 5:33 AM, Alessandro Portale 
> <Alessandro.Portale@xxxxxxxxxxxxx 
> <mailto:Alessandro.Portale@xxxxxxxxxxxxx>> wrote:
> 
>     Hi,
> 
>     Arthi Vasudevan wrote:
>      > LIBS += -LC:\eclipsecpp\Qt\lib -lPvAPI        ( also tried  LIBS +=
>      > -L"c:\eclipsecpp\Qt\lib" -lPvAPI )
>      > INCLUDEPATH += C:\eclipsecpp\Qt\include
>      >
>      > 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' <mailto:%60PvInitialize@0'>
>      > ......
> 
>     It seems to me as if your linker actually finds all libraries (also
>     PvAPI) but cannot find the referenced symbols in any of them.
>     If it didn't find PvAPI, an error message like the following would
>     appear:
> 
>       ld.exe: cannot find -lPvAPI
>       collect2: ld returned 1 exit status
> 
>     So, I believe that Your .pro file is correct, but the library isn't
>     for some reason.
> 
>      > ... I would also like to
>      > let you know that I aded "PvAPI.dll", "PvAPI.a" and " PvAPI.lib"
>      > manually to my project using Properties->C/C++ Project
>     paths->Libaries.
>      > Thanks a lot!!
> 
>     These settings do not have effect since qmake is used for generating
>     the makefile. And qmake only uses the information from the .pro file.
> 
>     Best regards,
>     Alessandro Portale
> 
>     To unsubscribe - send "unsubscribe" in the subject to
>     qt4-preview-feedback-request@xxxxxxxxxxxxx
>     <mailto:qt4-preview-feedback-request@xxxxxxxxxxxxx>
> 

To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx


Message 5 in thread

Wow! That was real quick Mr. Portale!! Thanks again.

Regards,
Arthi

On Jan 22, 2008 9:21 AM, Alessandro Portale <
Alessandro.Portale@xxxxxxxxxxxxx> wrote:

> Hi,
>
> if I understand correctly, You have a PvAPI.dll/.lib for Visual Studio and
> want to use it with MinGW. I actually have no experience with transforming
> the libs with impdef and dlltool.
> If those tools do not do what they should, I see two solutions for your
> issue.
>
>  1) Use the free Visual Studio Express for your development. It is fast
> and its debugger has all needed features. Qt OpenSource can be used with it.
>  2) Ask Prosilica to provide you with MinGW builds of their SDK (But I
> guess, You already did that)
>
> Best Regards,
> Alessandro Portale
>
> Arthi Vasudevan schrieb:
> > Thank you very much Mr. Portale! That solves one problem! :-) Now I need
> > to make sure PvAPI.a actually includes all the references that I want
> > for my project.
> >
> > PS: Do you have any suggestions as to how I should proceed? This is how
> > I created the .a file:
> >
> > PvAPI.dll -> PvAPI.def (usinf "impdef") and PvAPI.def-> PvAPI.a (using
> > "dlltool")
> >
> > Thanks again!
> > Arthi
> >
> > On Jan 22, 2008 5:33 AM, Alessandro Portale
> > <Alessandro.Portale@xxxxxxxxxxxxx
>  > <mailto:Alessandro.Portale@xxxxxxxxxxxxx>> wrote:
> >
> >     Hi,
> >
> >     Arthi Vasudevan wrote:
> >      > LIBS += -LC:\eclipsecpp\Qt\lib -lPvAPI        ( also tried  LIBS
> +=
> >      > -L"c:\eclipsecpp\Qt\lib" -lPvAPI )
> >      > INCLUDEPATH += C:\eclipsecpp\Qt\include
> >      >
> >      > 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' <mailto:%60PvInitialize@0'>
> >      > ......
> >
> >     It seems to me as if your linker actually finds all libraries (also
> >     PvAPI) but cannot find the referenced symbols in any of them.
> >     If it didn't find PvAPI, an error message like the following would
> >     appear:
> >
> >       ld.exe: cannot find -lPvAPI
> >       collect2: ld returned 1 exit status
> >
> >     So, I believe that Your .pro file is correct, but the library isn't
> >     for some reason.
> >
> >      > ... I would also like to
> >      > let you know that I aded "PvAPI.dll", "PvAPI.a" and " PvAPI.lib"
> >      > manually to my project using Properties->C/C++ Project
> >     paths->Libaries.
> >      > Thanks a lot!!
> >
> >     These settings do not have effect since qmake is used for generating
> >     the makefile. And qmake only uses the information from the .pro
> file.
> >
> >     Best regards,
> >     Alessandro Portale
> >
> >     To unsubscribe - send "unsubscribe" in the subject to
> >     qt4-preview-feedback-request@xxxxxxxxxxxxx
> >     <mailto:qt4-preview-feedback-request@xxxxxxxxxxxxx>
>  >
>
> To unsubscribe - send "unsubscribe" in the subject to
> qt4-preview-feedback-request@xxxxxxxxxxxxx
>
>