BUG #11336: libpq.dll: file not recognized - Mailing list pgsql-bugs

From soweasley@gmail.com
Subject BUG #11336: libpq.dll: file not recognized
Date
Msg-id 20140902151259.2926.83795@wrigleys.postgresql.org
Whole thread Raw
List pgsql-bugs
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,

pgsql-bugs by date:

Previous
From: Amit Kapila
Date:
Subject: Re: build with vs2008
Next
From: Joe Van Dyk
Date:
Subject: Re: create database ... template = ... does not copy configuration parameters values