473,659 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

The compile works, BUT linking fails:

2.5\Release\psy copg\_psycopg.d ef -Lc:\python25\li bs -Lc:
\python25\PCBui ld -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\mingw3 2\3.4.5\..\..\. .\..\mingw32\bi n\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\gc c.exe -mno-cygwin -shared -s build
\temp.win32-2.5\Release\psy copg
\psycopgmodule. o build\temp.win3 2-2.5\Release\psy copg\pqpath.o build
\temp.win32-
2.5\Release\psy copg\typecast.o build\temp.win3 2-2.5\Release\psy copg
\microprotoco
ls.o build\temp.win3 2-2.5\Release\psy copg\microproto cols_proto.o build
\temp.win3
2-2.5\Release\psy copg\connection _type.o build\temp.win3 2-2.5\Release
\psycopg\con
nection_int.o build\temp.win3 2-2.5\Release\psy copg\cursor_typ e.o build
\temp.win3
2-2.5\Release\psy copg\cursor_int .o build\temp.win3 2-2.5\Release\psy copg
\lobject_
type.o build\temp.win3 2-2.5\Release\psy copg\lobject_in t.o build
\temp.win32-2.5\R
elease\psycopg\ adapter_qstring .o build\temp.win3 2-2.5\Release\psy copg
\adapter_pb
oolean.o build\temp.win3 2-2.5\Release\psy copg\adapter_bi nary.o build
\temp.win32-
2.5\Release\psy copg\adapter_as is.o build\temp.win3 2-2.5\Release\psy copg
\adapter_
list.o build\temp.win3 2-2.5\Release\psy copg\adapter_da tetime.o build
\temp.win32-
2.5\Release\psy copg\_psycopg.d ef -Lc:\python25\li bs -Lc:
\python25\PCBui ld -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\mingw3 2\3.4.5\..\..\. .\..\mingw32\bi n\ld.exe:
cannot find -lpq
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
)
Jan 21 '08 #1
4 4740
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\psy copg\_psycopg.d ef -Lc:\python25\li bs -Lc:
\python25\PCBui ld -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\mingw3 2\3.4.5\..\..\. .\..\mingw32\bi n\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\psy copg\_psycopg.d ef -Lc:\python25\li bs -Lc:
\python25\PCBui ld -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
3509
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 System.Data.SqlClient.SqlError" I believe the issue is related to the fact that webserver runs the framework 1.1 and the component server has the framework 1.0 There are a number of posting in the different ng on this topic, but I cannot find a resolution.
3
4137
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 loaded. The error contains the correct path to c2.dll (and it is definately there). This only happens on some projects and only when "whole program optimization" option is turned on. If i turn off this option, the problem goes away. I have other...
2
2298
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 machine name." Any insight is appreciated.
3
16507
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 something in PHP that I don't have? Do I need to install more Linux packages? Or adjust PHP in some way?
3
3500
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 < (Master.PartyCtrl.Adults ); x++) { ASP.usercontrols_passenger_ascx passenger = new ASP.usercontrols_passenger_ascx(); this.pnlAdults.Controls.Add(passenger);
15
28812
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 System.out.println(i + ": " + sqrt(4));
2
2062
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 message from IE: "Cannot find server or DNS error." I set some break points and determined that the page was being loaded, but that the error page was being displayed anyway. Fortunately, I'm pretty obsessive about logging errors (both in my...
2
1703
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 (C:\Inetpub\wwwroot\20App). After restarting the IIS server, the 1.1 application works fine - however, when I first request a page from the 2.0 application (which also works fine, by the way), the 1.1 application stops working. Every time I request a page from the 1.1...
8
4193
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. TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
3
13092
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 postgresql.conf file to set as on 'explain_pretty_print' Now in pgAdmin (1.10.0) when I right-click a database in the 'usual' way, Maintenance, any of the tasks, its starts OK, but I get a dialogue box up every (seeming) operation that the Maintenance is...
0
8427
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8626
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7355
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6178
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2749
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.