1

I'm trying to use libpq to connect to my PostgreSQL database and intend to call pre-defined functions once I get this working. Right now I just have the conninfo string entered, and test the connection. After finally figuring out how to include different code directories and library paths (Netbeans 6.9.1 on Windows 7, MinGW compiler) in my project, I find this error:

g++.exe -c -I/C/Program\ Files/PostgreSQL/9.0/include -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp

mkdir -p dist/Debug/MinGW-Windows

g++.exe -o dist/Debug/MinGW-Windows/toolboxconnect build/Debug/MinGW-Windows/main.o -L/C/Program\ Files/PostgreSQL/9.0/lib -lpq

c:/Program Files/PostgreSQL/9.0/lib/libpq.dll: file not recognized: File format not recognized
collect2: ld returned 1 exit status

I have searched many topics for the reason of why this could not be recognized, but people suggest to others that its because theyre running 64-bit, and would need to rebuild the dlls. I don't think my PostgreSQL install came with makefiles to recompile these, and assumed they would be good to use as they were. Is there any other reason why my linker would not like my libpq library/some other sort of fix?

Community
  • 1
  • 1
AlwaysWrong
  • 526
  • 4
  • 9

1 Answers1

2

Someone else just had a similar issue with libpq.

From the discussion that followed that answer, here's a link to download the source code so you can rebuild it to suit your needs. There are different versions available, so make sure you download the one you want.

I really hate to just stick you with the dependency hell of "Your dependency doesn't work? Download the source and recompile it yourself!" -- but sadly, that seems to be the only option for postgres at the moment.

Community
  • 1
  • 1
Tim
  • 8,912
  • 3
  • 39
  • 57