Recent

Author Topic: again problems with link  (Read 6868 times)

angman

  • Jr. Member
  • **
  • Posts: 58
again problems with link
« on: October 24, 2006, 11:57:52 am »
Hi, I have an fpc console program that use a static library, I translated the .h  c header in a .pas unit file and added in the uses of my main program.

the .pas header file is i the same directiry of tha main and there are also the .ppu and .o files.  when I try to buid the project I get the link error /usr/bin/ld: cannot find -ldscud

How can happen this?

Thanks,  angman

 :roll:

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2671
RE: again problems with link
« Reply #1 on: October 24, 2006, 12:47:03 pm »
have you solething like /usr/lib/libdscud.so ?
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

angman

  • Jr. Member
  • **
  • Posts: 58
again problems with link
« Reply #2 on: October 24, 2006, 12:51:03 pm »
No I have a dscud.o in same directory of the main program.

The dscud.pas is a pascal header file for dscud6.lib, that I translated from the c .h, and is compiled within the same buid project of the main program.

angman

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2671
again problems with link
« Reply #3 on: October 24, 2006, 12:53:47 pm »
make sure your LD path (or how is it called) is pointing to the current dir also. For security reasons . is normally not included in the library search path.

Try compileing with -sh. This will skip the link step, but will generate ppas.sh and a link.res. In the link.res you can see where libraries are searched etc.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

angman

  • Jr. Member
  • **
  • Posts: 58
again problems with link
« Reply #4 on: October 24, 2006, 02:38:10 pm »
I compiled with -sh option, and this is the context of li.res file:

SEARCH_DIR(/lib/)
SEARCH_DIR(/usr/lib/)
SEARCH_DIR(/usr/X11R6/lib/)
SEARCH_DIR(./lib/gcc3/dscud5/)
SEARCH_DIR(/usr/lib/gcc-lib/i486-linux/3.3.5/)
SEARCH_DIR(./)
SEARCH_DIR(/usr/share/lazarus/units/i386-linux/indy/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/rtl/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/libasync/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/paszlib/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/pasjpeg/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/syslog/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/sqlite/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/oracle/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/opengl/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/libpng/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/gdbint/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/ncurses/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/svgalib/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/postgres/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/lexyacc/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/unzip/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/mysql/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/netdb/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/libgd/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/imlib/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/ibase/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/graph/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/gnome/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/fpgtk/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/forms/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/gconf/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/unixutil/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/cdrom/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/regexpr/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/zlib/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/uuid/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/utmp/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/odbc/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/newt/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/libc/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/gtk2/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/hash/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/gdbm/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/fftw/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/pthreads/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/zvt/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/tcl/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/x11/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/gtk/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/ggi/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/fcl/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/bfd/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/fv/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/units/i386-linux/)
SEARCH_DIR(/usr/lib/fpc/2.0.4/)
INPUT(
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/prt0.o
Prconslaz.o
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/system.o
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/lineinfo.o
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/strings.o
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/objpas.o
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/classes.o
dscud.o
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/sysutils.o
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/types.o
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/typinfo.o
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/rtlconsts.o
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/unix.o
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/errors.o
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/sysconst.o
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/unixtype.o
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/baseunix.o
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/unixutil.o
/usr/lib/fpc/2.0.4/units/i386-linux/rtl/syscall.o
)
INPUT(
-ldscud5
-lgcc
-lstdc++
-lrt
-ldscud
)

There is the SEARCH_DIR(./) in searchPath, so wath happen here?

angman

angman

  • Jr. Member
  • **
  • Posts: 58
again problems with link
« Reply #5 on: October 25, 2006, 12:23:59 pm »
Is very strange, I tried the same in a windows version, and compile and link without any problem.

angman

angman

  • Jr. Member
  • **
  • Posts: 58
again problems with link
« Reply #6 on: October 25, 2006, 05:56:55 pm »
I found it.  Sorry, was a my error, a wrong name in the external of one only function of the header translation, and only in linux version.

However, I thanks very much all that helped me.

Thanks, angman

 

TinyPortal © 2005-2018