Zivjo Metod!
On Sun, 14 Nov 1999, Metod Kozelj wrote:
> > Zakaj mi gcc -L../path/to/lib -lmoj ne zlinka liba ../path/to/lib/libmoj.a ???
>
> Hmmm ... in kaj ti gcc izpise?
-------------------------------------------------
gcc -lpthread -L../iflib -L../httplib -lif -lhttp httpdial.o -o httpdial
httpdial.o: In function `threadConnection':
httpdial.o(.text+0x835): undefined reference to `hl_ReceiveRequest'
httpdial.o(.text+0x88a): undefined reference to `hl_OK'
httpdial.o(.text+0x890): undefined reference to `hl_ContentsHtml'
httpdial.o(.text+0x8ad): undefined reference to `iflibStatIf'
httpdial.o(.text+0x8f6): undefined reference to `hl_html_Putc'
httpdial.o(.text+0x91c): undefined reference to `iflibIsUp'
httpdial.o(.text+0x932): undefined reference to `hl_html_Dump'
httpdial.o(.text+0x94e): undefined reference to `hl_html_Dump'
httpdial.o(.text+0x96a): undefined reference to `hl_html_Dump'
httpdial.o(.text+0x97c): undefined reference to `iflibIsUp'
httpdial.o(.text+0x992): undefined reference to `iflibGetIp'
httpdial.o(.text+0x99b): undefined reference to `iflibIp2String'
httpdial.o(.text+0x9a5): undefined reference to `hl_html_Dump'
httpdial.o(.text+0x9bb): undefined reference to `hl_html_Dump'
httpdial.o(.text+0x9cc): undefined reference to `hl_html_ntoa'
httpdial.o(.text+0x9dd): undefined reference to `hl_html_ntoa'
httpdial.o(.text+0x9ee): undefined reference to `hl_html_ntoa'
httpdial.o(.text+0x9ff): undefined reference to `hl_html_ntoa'
httpdial.o(.text+0xa12): undefined reference to `hl_html_Dump'
httpdial.o(.text+0xa1e): undefined reference to `hl_html_Dump'
httpdial.o(.text+0xa29): undefined reference to `hl_html_Dump'
httpdial.o(.text+0xaf9): undefined reference to `hl_html_Dump'
httpdial.o(.text+0xb55): undefined reference to `hl_html_Dump'
httpdial.o(.text+0xbb9): more undefined references to `hl_html_Dump' follow
httpdial.o: In function `threadConnection':
httpdial.o(.text+0xc25): undefined reference to `hl_DenyAccess'
httpdial.o: In function `displayStatus':
httpdial.o(.text+0x1036): undefined reference to `iflibStatIf'
httpdial.o(.text+0x1081): undefined reference to `hl_html_Putc'
httpdial.o(.text+0x10ad): undefined reference to `iflibIsUp'
httpdial.o(.text+0x10c0): undefined reference to `hl_html_Dump'
httpdial.o(.text+0x10db): undefined reference to `hl_html_Dump'
httpdial.o(.text+0x10ee): undefined reference to `hl_html_Dump'
httpdial.o(.text+0x1106): undefined reference to `iflibIsUp'
httpdial.o(.text+0x111c): undefined reference to `iflibGetIp'
httpdial.o(.text+0x1125): undefined reference to `iflibIp2String'
httpdial.o(.text+0x112c): undefined reference to `hl_html_Dump'
httpdial.o(.text+0x113c): undefined reference to `hl_html_Dump'
httpdial.o(.text+0x114a): undefined reference to `hl_html_ntoa'
httpdial.o(.text+0x1158): undefined reference to `hl_html_ntoa'
httpdial.o(.text+0x1166): undefined reference to `hl_html_ntoa'
httpdial.o(.text+0x1175): undefined reference to `hl_html_ntoa'
httpdial.o(.text+0x1187): undefined reference to `hl_html_Dump'
httpdial.o(.text+0x1193): undefined reference to `hl_html_Dump'
httpdial.o(.text+0x119e): undefined reference to `hl_html_Dump'
collect2: ld returned 1 exit status
make: *** [httpdial] Error 1
-----------------------------------------------
Cisto tako kot ce nebi dodal knjiznic :(.
Imam knjiznici ../iflib/libif.a in ../httplib/libhttp.a
hl_ * so funkcije v libhttp.a
iflib* so funkcije v libif.a
> Ali imas se kje drugje kaksen libmoj?
Ne.
[httpdial]# find / -name "libif*"
/home/rok/work/iflib/libif.a
[httpdial]# find / -name "libhttp*"
/home/rok/work/httplib/libhttp.a
> Ne vem, ce je zaporedje
> direktorijev, kjer isce knjiznice, res definirano z zaporedjem -L ...
"man gcc" izjavi:
-Ldir Add directory dir to the list of directories to be searched for `-l'.
-llibrary
Use the library named library when linking.
The linker searches a standard list of directories for the library,
which is actually a file named `liblibrary.a'. The linker then
uses this file as if it had been specified precisely by name.
The directories searched include several standard system directories
plus any that you specify with `-L'.
> gcc ... ../path/to/lib/libmoj.a
tako sedaj tudi delam, vendar bi rad -L in -l uporabil, ali pa vsaj vedel
zakaj ne deluje :( ceprav naj bi kakor sem razumel man pages to delovalo.
> Torej brez -L in -l ...
Ampak s parimi dodatnimi vrsticami v Makefile-u :(. Ne gre toliko da zadevo
zbuildam ampak zato, da ugotovim zakaj ne deluje.
-------------------------------------------------------
Mimogrede sorsi za zadevo se dobijo na:
www.kiss.uni-lj.si/~k4fe0058/httpdial.html
Tam sem seveda naredil, da includa library na "delujoc" nacin ;),
pa tudi liba sta v poddirektorijih.
--
best regards,
Rok Papez.