nanogui: Thread: how can link my shared library?


[<<] [<] Page 1 of 1 [>] [>>]
Subject: how can link my shared library?
From: Ysuk Chung ####@####.####
Date: 14 Dec 2000 00:42:17 -0000
Message-Id: <3A3817AD.E5B20208@dabonet.com>

hello!

i work redhat7.0 and kernel-2.4.0-test10.
once i made shared library 'libmylib.so.1 and link libmylib.so,
mylib.h'  by using arm-linux-gcc.
tried to build my test program with linking mylib.

]# make
    arm-linux-gcc test1.c -I/path/to/mylib/include
    arm-linux-gcc test2.c -I/path/to/mylib/include
    arm-linux-gcc test3.c -I/path/to/mylib/include

    arm-linux-ld -Bstatic -o test test1.o test2.o test3.o
-L/path/to/mylib/lib -lmylib
    arm-linux-ld : cannot find -lmylib
    building : failed

    why can't find libmylib.so?
    what i missing?

thank you!



Subject: how can link my shared library?
From: Ysuk Chung ####@####.####
Date: 14 Dec 2000 00:50:59 -0000
Message-Id: <3A37ABFE.4AA37C12@dabonet.com>

hello!

i work redhat7.0 and kernel-2.4.0-test10.
once i made shared library 'libmylib.so.1 and link libmylib.so,
mylib.h'  by using arm-linux-gcc.
tried to build my test program with linking mylib.

]# make
    arm-linux-gcc test1.c -I/path/to/mylib/include
    arm-linux-gcc test2.c -I/path/to/mylib/include
    arm-linux-gcc test3.c -I/path/to/mylib/include

    arm-linux-ld -Bstatic -o test test1.o test2.o test3.o
-L/path/to/mylib/lib -lmylib
    arm-linux-ld : cannot find -lmylib
    building : failed

    why can't find libmylib.so?
    what i missing?

thank you!

Subject: Re: how can link my shared library?
From: Alex Holden ####@####.####
Date: 16 Dec 2000 08:53:12 -0000
Message-Id: <Pine.LNX.4.04.10012160846230.748-100000@hyperspace.linuxhacker.org>

On Thu, 14 Dec 2000, Ysuk Chung wrote:
> once i made shared library 'libmylib.so.1 and link libmylib.so,
>     arm-linux-ld -Bstatic -o test test1.o test2.o test3.o
> -L/path/to/mylib/lib -lmylib

You're trying to link a shared library statically. You'll need to make a
static version of your library (generated by using ar to archive the .o 
files together into a .a file) or remove the -Bstatic flag from your ld
invocation. BTW, it's generally bad practise to call ld directly when
building a user space program- let gcc do it for you.

-- 
------- Alex Holden -------
http://www.linuxhacker.org/
 http://www.robogeeks.org/

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.