compiling C library under mingw

From: Marios Vodas <mvodas(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: compiling C library under mingw
Date: 2010-10-08 09:27:05
Message-ID: AANLkTi=t_xx2OSH_62iHFH5EJaTvXH4cZ=FSq3BgVvH_@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have a library that compiles fine under linux.
But when I try to compile it under mingw on windows 7 I get the following
errors.

gcc.exe -c -O2 -I/C/PostgreSQL/9.0/include/server
> -I/C/PostgreSQL/9.0/include/server/utils
> -I/C/PostgreSQL/9.0/include/server/access
> -I/C/PostgreSQL/9.0/include/server/port/win32 -I/C/PostgreSQL/9.0/include
> -MMD -MP -MF build/Release/MinGW-Windows/mylib.o.d -o
> build/Release/MinGW-Windows/mylib.o mylib.c
>

The previous command is successful and produces .o files (only some warnings
here like: warning: 'pg_finfo_mytype_in' redeclared without dllimport
attribute: previous dllimport ignored).
The following though gives errors.

gcc.exe -shared -o dist/Release/MinGW-Windows/libMyLib.dll
> build/Release/MinGW-Windows/mylib.o
>

Here is the log:

build/Release/MinGW-Windows/mylib.o:mylib.c:(.text+0x128): undefined
> reference to `errstart'
> build/Release/MinGW-Windows/mylib.o:mylib.c:(.text+0x13d): undefined
> reference to `_imp__CurrentMemoryContext'
> build/Release/MinGW-Windows/mylib.o:mylib.c:(.text+0x147): undefined
> reference to `MemoryContextAlloc'
> build/Release/MinGW-Windows/mylib.o:mylib.c:(.text+0x17b): undefined
> reference to `timestamp_in'
> build/Release/MinGW-Windows/mylib.o:mylib.c:(.text+0x180): undefined
> reference to `DirectFunctionCall3'
> build/Release/MinGW-Windows/mylib.o:mylib.c:(.text+0x1be): undefined
> reference to `timestamp_in'
> build/Release/MinGW-Windows/mylib.o:mylib.c:(.text+0x1c3): undefined
> reference to `DirectFunctionCall3'
> build/Release/MinGW-Windows/mylib.o:mylib.c:(.text+0x1f4): undefined
> reference to `errmsg'
> build/Release/MinGW-Windows/mylib.o:mylib.c:(.text+0x202): undefined
> reference to `errcode'
> build/Release/MinGW-Windows/mylib.o:mylib.c:(.text+0x20e): undefined
> reference to `errfinish'
> build/Release/MinGW-Windows/mylib.o:mylib.c:(.text+0x230): undefined
> reference to `_imp__CurrentMemoryContext'
> build/Release/MinGW-Windows/mylib.o:mylib.c:(.text+0x23a): undefined
> reference to `MemoryContextAlloc'
> build/Release/MinGW-Windows/mylib.o:mylib.c:(.text+0x251): undefined
> reference to `Int64GetDatum'
> build/Release/MinGW-Windows/mylib.o:mylib.c:(.text+0x25c): undefined
> reference to `timestamp_out'
> build/Release/MinGW-Windows/mylib.o:mylib.c:(.text+0x261): undefined
> reference to `DirectFunctionCall1'
> build/Release/MinGW-Windows/mylib.o:mylib.c:(.text+0x284): undefined
> reference to `Int64GetDatum'
>

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2010-10-08 09:41:00 Re: Issues with Quorum Commit
Previous Message Markus Wanner 2010-10-08 09:07:36 Re: Issues with Quorum Commit