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?