The following bug has been logged on the website:
Bug reference: 11336
Logged by: soweasley
Email address: soweasley@gmail.com
PostgreSQL version: 9.3.5
Operating system: Windows 7 64-bit
Description:
Hi all,
I get the following error :
C:\user\pgsql\lib/libpq.dll: file not recognized: File format not
recognized
collect2.exe: error: ld returned 1 exit status
With the following C code:
#include <stdio.h>
#include <stdlib.h>
#include <libpq-fe.h>
int main(int argc, char *argv[]){
PGconn *pgConn = PQconnectdb("dbname=xxx user=yyy password=zzz");
if (pgConn != NULL)
{
printf("Connected to database.\n");
}
else
{
printf("Cannot connect to database.\n");
}
return EXIT_SUCCESS;
}
And with the following settings:
GCC C Compiler (-I "C:/user/pgsql/include") and the MinGW C Linker (-L
"C:/user/pgsql/lib" -lpq)
I already red the related topics and HTML documentation, but the error
remains. Do you have any idea how to solve this? Thank you.
Regards,