building psycopg2 on windows using mingw, "cannot find -lpq"

G

GHUM

The compile works, BUT linking fails:

2.5\Release\psycopg\_psycopg.def -Lc:\python25\libs -Lc:
\python25\PCBuild -Lc:/p
ostgres/83RC2/lib -lpython25 -lpq -lws2_32 -ladvapi32 -o build
\lib.win32-2.5\psy
copg2\_psycopg.pyd
c:\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe:
cannot find -lpq
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

if I google for the error

"ld.exe: cannot find -lpq"

there is allways the information that the lib-dir of libpq is missing;
but :

-Lc:/postgres/83RC2/lib

is clearly in the commandline, and within c:/postgres/83RC2/lib
there is one libqp.lib

What am I missing? any hints?

Best wishes,

Harald

(complete output:
c:\mingw\bin\gcc.exe -mno-cygwin -shared -s build
\temp.win32-2.5\Release\psycopg
\psycopgmodule.o build\temp.win32-2.5\Release\psycopg\pqpath.o build
\temp.win32-
2.5\Release\psycopg\typecast.o build\temp.win32-2.5\Release\psycopg
\microprotoco
ls.o build\temp.win32-2.5\Release\psycopg\microprotocols_proto.o build
\temp.win3
2-2.5\Release\psycopg\connection_type.o build\temp.win32-2.5\Release
\psycopg\con
nection_int.o build\temp.win32-2.5\Release\psycopg\cursor_type.o build
\temp.win3
2-2.5\Release\psycopg\cursor_int.o build\temp.win32-2.5\Release\psycopg
\lobject_
type.o build\temp.win32-2.5\Release\psycopg\lobject_int.o build
\temp.win32-2.5\R
elease\psycopg\adapter_qstring.o build\temp.win32-2.5\Release\psycopg
\adapter_pb
oolean.o build\temp.win32-2.5\Release\psycopg\adapter_binary.o build
\temp.win32-
2.5\Release\psycopg\adapter_asis.o build\temp.win32-2.5\Release\psycopg
\adapter_
list.o build\temp.win32-2.5\Release\psycopg\adapter_datetime.o build
\temp.win32-
2.5\Release\psycopg\_psycopg.def -Lc:\python25\libs -Lc:
\python25\PCBuild -Lc:/p
ostgres/83RC2/lib -lpython25 -lpq -lws2_32 -ladvapi32 -o build
\lib.win32-2.5\psy
copg2\_psycopg.pyd
c:\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe:
cannot find -lpq
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
)
 
D

Diez B. Roggisch

GHUM said:
The compile works, BUT linking fails:

2.5\Release\psycopg\_psycopg.def -Lc:\python25\libs -Lc:
\python25\PCBuild -Lc:/p
ostgres/83RC2/lib -lpython25 -lpq -lws2_32 -ladvapi32 -o build
\lib.win32-2.5\psy
copg2\_psycopg.pyd
c:\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe:
cannot find -lpq
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

if I google for the error

"ld.exe: cannot find -lpq"

there is allways the information that the lib-dir of libpq is missing;
but :

-Lc:/postgres/83RC2/lib

is clearly in the commandline, and within c:/postgres/83RC2/lib
there is one libqp.lib

What am I missing? any hints?

Are you sure using forward slashes in the path works here?

Diez
 
G

GHUM

The compile works, BUT linking fails:
Are you sure using forward slashes in the path works here?

Not at all. But that commandline is generated by setup.py, not by me :
(
and setup.py extracts the paths from pg_config

so: I have no idea how to make it use backslash :(

Thanks for the idea,

Harald
 
G

GHUM

I use psycopg2 all the time on windows. I use the binary installer
instead of source. Works great for me.

-Tom
Me2. Just in 7 out of 200 it does not work with the currently
available binary installer, on some startups, so I decided to follow a
recommendation out of the psycopg2 list to compile it from trunk :(

Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top