Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-05

undefined reference to `fpc_geteipasebx'

8 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Coco Pascal

When compiling a test program statically linking a shared module on fc10 i386 I get the following messages:

testlibyfbudfunit.pas:60: undefined reference to `Y_Odd' ./libyfbudf.so: undefined reference to `fpc_geteipasebx' testlibyfbudf.lpr(20,1) Error: Error while linking testlibyfbudf.lpr(20,1) Fatal: There were 1 errors compiling module, stopping

What does this mean?

The function in the shared module:

function Y_Odd(const AValue: Int64): LongInt; cdecl; export;
begin
 if Odd(AValue) then
   Result := -1
 else
   Result := 0;
end;

The declaration in the test program:

function Y_Odd(const AValue: Int64): LongInt; cdecl; external 'yfbudf';

libyfbudf.so is located in /usr/lib

Reply by email

Jonas Maebe
to Coco Pascal
Coco Pascal wrote 10 lines
When compiling a test program statically linking a shared module on fc10 i386 I get the following messages: testlibyfbudfunit.pas:60: undefined reference to `Y_Odd' ./libyfbudf.so: undefined reference to `fpc_geteipasebx' testlibyfbudf.lpr(20,1) Error: Error while linking testlibyfbudf.lpr(20,1) Fatal: There were 1 errors compiling module, stopping What does this mean?

Don't use -Cg, it doesn't work yet for Linux/i386.

Jonas

Reply by email

Marco van de Voort
to Coco Pascal

In our previous episode, Coco Pascal said:

Show quoted text 7 lines
Jonas Maebe wrote: > > Don't use -Cg, it doesn't work yet for Linux/i386. > > I searched the Lazarus Compiler Options dialog but didn't find this parameter. What should I do?

It enabled PIC.

Reply by email

Coco Pascal
to Marco van de Voort
Marco van de Voort wrote 14 lines
In our previous episode, Coco Pascal said: > Jonas Maebe wrote: > >> Don't use -Cg, it doesn't work yet for Linux/i386. >> >> >> > I searched the Lazarus Compiler Options dialog but didn't find this > parameter. What should I do? > It enabled PIC.

Sorry, but how can I solve the problem? -Cg is apparently a default setting; how can I undo this?

Reply by email

Jonas Maebe
to Coco Pascal
Coco Pascal wrote
Sorry, but how can I solve the problem? -Cg is apparently a default setting; how can I undo this?

It is not the default in the compiler for Linux/i386, but maybe Lazarus turns it on by default when compiling a library? Disabling it is done using -Cg-

Jonas

Reply by email

Jonas Maebe
to Jonas Maebe
Jonas Maebe wrote 7 lines
On 29 May 2009, at 11:01, Coco Pascal wrote: > Sorry, but how can I solve the problem? -Cg is apparently a default > setting; how can I undo this? It is not the default in the compiler for Linux/i386, but maybe Lazarus turns it on by default when compiling a library?

Or maybe one of your source files contains {$pic+}.

Jonas

Reply by email

Coco Pascal
to Jonas Maebe
Jonas Maebe wrote
Or maybe one of your source files contains {$pic+}.

Indeed, the library project contained -fPIC as custom option. I didn't put it there. Removing it resulted in 'symbols not found: memory hausted'. The message when -Cg- was set.
I took a fresh clean library project and build it routine by routine. No problems at all now. I suspect that the fact that I originally just copied project files from the win32 platform caused the problems described.

Reply by email