Re: Compiling extension C with MingW in windows, Error...

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: Compiling extension C with MingW in windows, Error...
Дата
Msg-id AANLkTi=xYzG5A-33AkiDn3jJcX4eupa3Xiy3b_ektbUJ@mail.gmail.com
обсуждение исходный текст
Ответ на Compiling extension C with MingW in windows, Error...  (Edwin Quijada <listas_quijada@hotmail.com>)
Ответы Re: Compiling extension C with MingW in windows, Error...  (Edwin Quijada <listas_quijada@hotmail.com>)
Список pgsql-general
On Fri, Sep 3, 2010 at 5:31 AM, Edwin Quijada
<listas_quijada@hotmail.com> wrote:
> Hi, I am tryng to compile a C extension in windows using Minigw but always I
> get the same error
>
> C:\Program Files\PostgreSQL\8.3\share\exte_c>C:\mingw\bin\gcc -shared -o
> pg2.dll
>  pg2.o
> pg2.o:pg2.c:(.text+0x86): undefined reference to
> `_imp__CurrentMemoryContext'
> pg2.o:pg2.c:(.text+0x92): undefined reference to `MemoryContextAlloc'
> collect2: ld returned 1 exit status
>
> This error is just when it links.

You need to link against postgres.exe to get access to these symbols.
I don't recall if the mingw linker allows you to just specify the EXE
file these days, but I think it does. If not, you'll need to create an
import library from the EXE and link to that (the binary distribution
only ships with import libraries for MSVC, but mingw can't use
standard windows import libraries, so you need to create your own
there)


--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

В списке pgsql-general по дате отправления:

Предыдущее
От: Yeb Havinga
Дата:
Сообщение: Re: Forcing the right queryplan
Следующее
От: Grzegorz Jaśkiewicz
Дата:
Сообщение: Re: select now() problem?