PDA

View Full Version : problem with vfw lib



cae
13th November 2009, 09:54
Hi everyone,

i've started programming (or trying it) a week ago with QT Creator 1.2.1 based on QT 4.5.3 32bit on a Windows SP3, i runed configure.exe on the qt command promt, i had no problems compiling examples or simple programs, but now i have to continue with someone elses work, and there begins my problem.

The program uses an Aviutils h & cpp with some structs and functions,and this Aviutils.cpp has an #include <vfw.h> .

Finally, when i try to build de project i recive this error




./release\AviUtils.o:AviUtils.cpp:(.text+0xd): undefined reference to `AVIFileInit@0'
./release\AviUtils.o:AviUtils.cpp:(.text+0x51): undefined reference to `AVIFileOpenW@16'
./release\AviUtils.o:AviUtils.cpp:(.text+0xe5): undefined reference to `AVIFileExit@0'
./release\AviUtils.o:AviUtils.cpp:(.text+0x14a): undefined reference to `AVIFileExit@0'
.
.
.


I tried adding to de .pro file

win32:LIBS += -L \
C:\QT\2009.04\mingw\lib\libvfw32.a


I set on Tools->Options->CMake = C:\Qt\2009.04\mingw\bin\mingw32-g++.exe
There are serveral .exe files inside that folder but i tried many of them with the same result.

i've readed many problems that could have the same solution but... nothing worked...

I think the problem is that the program doesnt find de "cpp" of vfw.h wich is somthing like a dynamic library that maybe i dont know how to link it to the program....

Can any body help me?

high_flyer
13th November 2009, 09:57
win32:LIBS += -LC:\QT\2009.04\mingw\lib /
-llibvfw32


the -L states library search path
the -l states the lib it self.

cae
13th November 2009, 10:13
Thanks!!! but....


c:\Documents and Settings\Cesar\Escritorio\PruebaZeus\Zeus\Zeus.pro :48: Parse Error ('-llibvfw32')
Error processing project file: Zeus.pro
mingw32-make: *** [makefile] Error 3
Exited with code 2.
Error while building project Zeus
When executing build step 'Make'

does itself know that the functions are explained in the libvfw32 without telling him that?

anyway the error seems to be that the file is not found?

by the way, i installed qt with mingw, i read it had to use *.a libs instead of *.dll, but it's that file the one i'm trying to define there....

high_flyer
13th November 2009, 10:40
No the error is a parsing error, and it was my mistake:

win32:LIBS += -LC:\QT\2009.04\mingw\lib \
-llibvfw32

I used '/' instead of '\' for the line break.

libname.a and libname.so are unix types for static and shared libs.

But as IFAIK (can't remember any more) MinGW under windows should support both the unix and windows types.

So if your lib is a *.a use -llibvfw32.a or -lLibvfw32.lib depending on what you have.

cae
13th November 2009, 11:05
THANKSSSSS!!!!!! it works!!!!!

I've been 2 days trying it, but finally.... if i knew it i would have written beffore!!
:p:p:p:p