Recent

Author Topic: Freebsd CGI Compile Linking Error  (Read 7658 times)

darkaxi0m

  • New member
  • *
  • Posts: 5
Freebsd CGI Compile Linking Error
« on: December 03, 2010, 07:11:09 am »
FPC Version 2.5.1
Laz Version 0.9.29

Im trying to cross compile a FreeBSD CGI program from my windows box.

It works fine, until i add a IdTCPclient to the webModule i get the following linking error


Code: [Select]
Hint: Start of reading config file C:\pp\bin\i386-win32\fpc.cfg
Hint: End of reading config file C:\pp\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.5.1 [2010/12/02] for i386
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: FreeBSD/ELF for i386
Compiling cgiproject1.lpr
Compiling unit1.pas
cgiproject1.lpr(6,8) Hint: Unit "fpWeb" not used in cgiproject1
Compiling resource cgiproject1.or
Linking cgiproject1
C:\pp\bin\i386-win32\i386-freebsd-ld.exe: cannot find -liconv
cgiproject1.lpr(14,1) Error: Error while linking
C:\pp\bin\i386-win32\i386-freebsd-ld.exe: cannot find -liconv
cgiproject1.lpr(14,1) Error: Error while linking
cgiproject1.lpr(14,1) Fatal: There were 1 errors compiling module, stopping

Any ideas? thanks

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7356
Re: Freebsd CGI Compile Linking Error
« Reply #1 on: December 03, 2010, 01:17:30 pm »
This is normal, and a general *nix platforms "feature" (problem). All used dynamic libraries must be present on the system at linking time.

Read the buildfaq for more background information on crosscompiling:

http://www.stack.nl/~marcov/buildfaq/

darkaxi0m

  • New member
  • *
  • Posts: 5
Re: Freebsd CGI Compile Linking Error
« Reply #2 on: December 05, 2010, 09:52:19 am »
thankyou for that,

ive copied libiconv.a from my freebsd box to my windows.
but now ive come across this

Quote
Hint: Start of reading config file C:\pp\bin\i386-win32\fpc.cfg
Hint: End of reading config file C:\pp\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.5.1 [2010/12/04] for i386
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: FreeBSD/ELF for i386
Compiling cgiproject1.lpr
Compiling unit1.pas
cgiproject1.lpr(6,8) Hint: Unit "fpWeb" not used in cgiproject1
Compiling resource cgiproject1.or
Linking cgiproject1
C:\pp\bin\i386-win32\i386-freebsd-ld.exe: cannot find -lc
cgiproject1.lpr(14,1) Error: Error while linking
C:\pp\bin\i386-win32\i386-freebsd-ld.exe: cannot find -lc
cgiproject1.lpr(14,1) Error: Error while linking
cgiproject1.lpr(14,1) Fatal: There were 1 errors compiling module, stopping

and idea what library it is looking for?
« Last Edit: December 05, 2010, 10:53:16 am by darkaxi0m »

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1890
Re: Freebsd CGI Compile Linking Error
« Reply #3 on: December 05, 2010, 12:03:14 pm »
Quote
cannot find -lc
and idea what library it is looking for?

Libc afaics.
http://wiki.freepascal.org/libc_unit

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7356
Re: Freebsd CGI Compile Linking Error
« Reply #4 on: December 13, 2010, 05:48:28 pm »
Quote
cannot find -lc
and idea what library it is looking for?

Libc afaics.
http://wiki.freepascal.org/libc_unit

That URL is mostly unrelated.  Nearly every C program needs libc.so and probably also libgcc.so