PDA

View Full Version : Issue with QMake



jcr
13th March 2006, 22:08
Hi
I am trying to rewrite a Makefile using qmake.
The original Makefile contains the lines:
prog: pg.o
gcc pg.o -L "C:\Program Files\PostgreSQL\8.1\lib" -lpq
How should I rewrite them in the .pro files?
something like:
LIBS += "C:\Program Files\PostgreSQL\8.1\bin\*"
what about the -lpg?
I would appreciate any help
Thanks
JCR

PS: I understand I could use the Qt PostgreSQL driver, but, for the time being, it would be easier just to port the make file.:)

jacek
13th March 2006, 22:21
It should be:
LIBS += -L"C:\Program Files\PostgreSQL\8.1\lib" -lpq

jcr
13th March 2006, 23:09
Hi,
Thanks for the lead but I am still unable to compile:
The old makefile contains:
prog: pg.o
gcc pg.o -L "C:\Program Files\PostgreSQL\8.1\lib" -lpq
pg.o: pg.c
gcc -c -I "C:\Program Files\PostgreSQL\8.1\include" pg.c
and the .pro file (among other lines)
INCLUDEPATH += "C:\Program Files\PostgreSQL\8.1\include"
LIBS += -L"C:\Program Files\PostgreSQL\8.1\lib" -lpg

I am pasting here the end of the message error:

g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -Wl,-s -Wl,-subsystem,console -o "a.exe" object_script
.a.Release -L"C:\Qt\4.1.1\lib" c:\Boost\lib\libboost_serialization-mgw-mt-s.lib c:\Boost\lib\libboost_date_time-mgw-mt-s.lib c:\Boost\lib\libboost_filesystem
-mgw-mt-s.lib -L"C:\Program Files\PostgreSQL\8.1\lib" -lpg -lQtGui4 -lQtNetwork4 -lQtCore4
c:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\ mingw32\bin\ld.exe: cannot find -lpg
collect2: ld returned 1 exit status
mingw32-make[1]: *** [a.exe] Error 1
mingw32-make[1]: Leaving directory `c:/ventures/finance'
mingw32-make: *** [release] Error 2


Thanks
JCR

jacek
13th March 2006, 23:26
It's just a typo --- it should be -lpq instead of -lpg.

jcr
13th March 2006, 23:31
my apologies...:o
I had just realized that and re-ran everything and it works fine!
thank you very much Jacek
JCR