ts-7000
[Top] [All Lists]

Re: FW: [ts-7000] how to include libraries

To:
Subject: Re: FW: [ts-7000] how to include libraries
From: "Don W. Carr" <>
Date: Tue, 18 Jul 2006 11:22:58 -0500
Ok,  so the cross compiler can check you library at link time, you need to copy your library to the following directory under the cross compiler:

opt/crosstool/arm-linux/gcc-3.3.4-glibc-2.3.2/arm-linux/lib/

To compile your own shared library from object files, you need to use the -shared option as shown in the example below. In this example, the library name is rtcommon, but you need to add "lib" to the front, and ".so" to the end. This is the naming convention used by the compiler, so when you put -lrtcommon, it looks for librtcommon.so. 

CC=arm-linux-gcc

librtcommon.so: arg.o common.o safestr.o utimer.o memfail.o
        $(CC) -shared -o librtcommon.so arg.o common.o safestr.o utimer.o memfail.o

After creating the shared library, you need to copy it to the cross tool directory as shown above, and also to /lib, /usr/lib, or /usr/local/lib on your SBC. (I always use /usr/local/lib if available). On some systems, you will then need to run ldconfig as root to add the library to the recognized set. On the 7260, I do not think it is necessary. If you put it in /usr/local/lib, on some systems you need to add the following line to /etc/ld.so.conf before running ldconfig:

/usr/local/lib

To add libraries from the cross tools that are not on your board, you can copy them from the library directory of the cross tool to /lib/ on the board. You should probably strip them first using the strip command from the cross tools. Really, the best would be for TS to supply the full set of libraries pre-compiled on the website so we could download and install them. They were trying to install a minimal set to save space I imagine. Actually, you could probably copy them from the debian distribution since they are the exact same version as TS-Linux. Somebody correct me if I am wrong here please!

If you have any more questions or problems, please let me know!

Don.

On 7/17/06, chathsuom moratuwa <> wrote:

hi,
before the time you reply I came to a some solution and it works. I compile it like this.

arm-linux-g++ dThread.cpp -o dThread -lpthread -static -lstdc++

it works well. but i need to know how to include libraries and creating my own libraries.

chathuranga





--
Dr. Don W. Carr
J. G. Montenegro 2258
Guadalajara, Mexico
+52-333-630-0704
+52-333-836-4500 ext 2930 __._,_.___


SPONSORED LINKS
Linux os Hardware Arms
Computer internet Computer security Computer hardware security


YAHOO! GROUPS LINKS

  •  Visit your group "ts-7000" on the web.
     
  •  To unsubscribe from this group, send an email to:
     =Unsubscribe
     
  •  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU