473,404 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

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

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
)
Jan 21 '08 #1
4 4716
On Mon, 2008-01-21 at 01:57 -0800, GHUM wrote:
What am I missing? any hints?
I use psycopg2 all the time on windows. I use the binary installer
instead of source. Works great for me.

-Tom

Jan 21 '08 #2
GHUM wrote:
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
Jan 21 '08 #3
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
*-Lc:/postgres/83RC2/lib

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
Jan 22 '08 #4
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
Jan 22 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Stan | last post by:
My webserver calls a component on another server through DCOM, the component goes to SQL, SQL raises the exception and here is what the client gets: "Cannot find member name...
3
by: Dmitry Jouravlev | last post by:
Hi, I have a number of C++ solutions in Visual Studio .NET and when i compile them using "Whole Program Optimization", certain projects report a LNK1171 error saying that c2.dll could not be...
2
by: Andrew | last post by:
VS.net Win 2k3 I'm getting the following error when attempting to debug. I'm not debugging remotely, just a local project. "Unable to start debugging. Cannot find port. Check the remote...
3
by: David T. Ashley | last post by:
Hi, Red Hat Enterprise Linux 4.X. I'm writing command-line PHP scripts for the first time. I get the messages below. What do they mean? Are these operating system library modules, or...
3
by: OJ | last post by:
Hi, I have added code to run on a button click event which adds usercontrols to an asp:Panel control held in a contentplaceholder defined by the masterpage. for (int x = 0; x <...
15
by: Bjorn Jensen | last post by:
Hi! An beginner question: Pleas help me with this (-: Error (the arrow points on the s in sqrt) ===== tal.java:6: cannot find symbol symbol : method sqrt(int) location: class tal...
2
by: Mike Hofer | last post by:
In my ASP.NET application, *one* page would not render in the application. All others would show up just fine, but when the user clicked the button to browse to this one page, I'd get a nasty error...
2
by: Nils Magnus Englund | last post by:
Hello, In the root of a web site (C:\Inetpub\wwwroot), I have a .NET 1.1 application. I've just added a .NET 2.0 application to another directory under the web site root...
8
by: clyfish | last post by:
In cmd, I can use find like this. C:\>netstat -an | find "445" TCP 0.0.0.0:445 0.0.0.0:0 LISTENING UDP 0.0.0.0:445 *:* C:\> And os.system is OK....
3
scubak1w1
by: scubak1w1 | last post by:
Hello, Did a search here, manuals and Googled, etc generally, so apologies if I did not find the answer to my issue - that is, I try and 'self help' as mush as I can... I adjusted my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.