lists.zerezo.com
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
***BOGO*** [Mingw-users] Trying to port a C Linux library to windows
- Date: Mon, 23 Jun 2008 00:28:29 -0300
- From: "Mariano Martinez Peck" <marianopeck@xxxxxxxxx>
- Subject: ***BOGO*** [Mingw-users] Trying to port a C Linux library to windows
Hi everybody!
I am really newbie and this is the first time I use MinGW. I need help.
I am trying to compile OpenDBX version 1.3.10 with MinGW and I have
some problems. OpenDBX is an API written in C that enables you to talk
to several relational database engines. His author, Norbert, tell me
that with this release (1.3.10) OpenDBX could be compiled for Windows
using Cygwin or MinGW.
The thing is that I am doing a plugin for Squeak Smalltalk and because
of this I need the native dll compiled. I mean, I need to have the
openDBX dlls as any other windows dll. Because of this, I undersand I
cannot use cygwin but MinGW.
If I compile OpenDBX with cygwin I don't have problem at all. I compile and works perfectly. The problem I have is with MinGW.
I have installed MinGW (c:/MinGW), MSYS (c:/msys) and msysDTK. In PATH
variable I have: ....c:\msys\1.0\bin\;c:\cygwin\bin\ (yes, I have also
cygwin installed). The openDBX directory is in:
c:\mariano\opendbx-1.3.10\
They all seem to work well.
I have already installed MySQL (c:/MySQL/) and PostgreSQL (c:/PostgreSQl)
When I compile openDBX in linux I do:
CPPFLAGS="-I/usr/include/postgresql" LDFLAGS="-L/usr/lib/postgresql" ./configure --with-backends="pgsql"
The --with-backends="pgsql" is just to tell openDBX which engines to
compile. And then, with LDFLAGS and CPPFLAGS I have to tell it where
the libs and the include are.
Then I do a make and finally a make install.
With MSYS I try to do:
CPPFLAGS=-I"c:/PostgreSQL/8.3/include/" LDFLAGS=-L"c:/PostgreSQL/8.3/lib/" ./configure --with-backends="pgsql"
CPPFLAGS="-Ic:/PostgreSQL/8.3/include/" LDFLAGS="-Lc:/PostgreSQL/8.3/lib/" ./configure --with-backends="pgsql"
CPPFLAGS="-I/c/PostgreSQL/8.3/include/" LDFLAGS="-L/c/PostgreSQL/8.3/lib/" ./configure --with-backends="pgsql"
CPPFLAGS=-I"/c/PostgreSQL/8.3/include/" LDFLAGS=-L"/c/PostgreSQL/8.3/lib/" ./configure --with-backends="pgsql"
CPPFLAGS=-I"\c\PostgreSQL\8.3\include\" LDFLAGS=-L"\c\PostgreSQL\8.3\lib\" ./configure --with-backends="pgsql"
export CPPFLAGS=-I"/c/PostgreSQL/8.3/include/"
export LDFLAGS=-L"/c/PostgreSQL/8.3/lib/"
./configure --with-backends="pgsql"
But, in all cases, in the console I see this error:
checking libpq-fe.h usability... yes
checking libpq-fe.h presence... yes
checking for libpq-fe.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for PQconnectdb in -lpq... no
configure: error: postgresql library (libpq) not found
And in config.log I can see:
configure:28655: checking for PQconnectdb in -lpq
configure:28690: gcc -std=gnu99 -o
conftest.exe -g -O2 -I/c/PostgreSQL/8.3/include -L/c/PostgreSQL/8.3/lib
conftest.c -lpq >&5
c:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot
find -lpq
collect2: ld returned 1 exit status
I don't know exactly how the PostgreSQL library must be named, but "ld"
doesn't find what it's looking for.
The strange thing is that if I look in c:\PostgreSQL\8.3\lib\ I do have libpq.lib
Moreover it do find .h files
In addition, I could compile openDBX with postgres with cygwin without a problem.
At first I thought that perhaps there was a problem with Postgres and I
tried with MySQL, but I have the same problem (It doesn't find mysql
libs).
So, can anyone help me? I really need to fix this problem.
Very thanks in advance,
Mariano
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users