Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Use variable in object library (ar) Post 302346118 by justinpark01 on Friday 21st of August 2009 04:56:40 AM
Old 08-21-2009
Use variable in object library (ar)

I am trying to use a library, lets say libexample.a, and I want to use a variable within the object files that were archived. For example, my new code (which is linked to the library, don't worry about that) wants to access an integer from the original source.

When I use the nm command on libexample.a I see a bunch of stuff, including:
000006ec b var$39.0

I want use that variable. I know its original name and try to call it with my new code but it fails. I have no problem accessing the functions within libexample.a, I just want to use that integer. Or maybe it just isn't possible?

Thanks in advance for any help.

Last edited by justinpark01; 08-21-2009 at 09:00 AM..
 

9 More Discussions You Might Find Interesting

1. AIX

Shared Object library problem

Hi, When using shared objects on AIX 4.3 i am getting runtime problems. I have a small sample program which links to a shared object libray, oracle and system related libraries. At runtime it fails (gives segmentation fault and coredump ) in one proc file when executing login statement. But... (0 Replies)
Discussion started by: suman_jakkula
0 Replies

2. Programming

getting "mi_cmd_var_create: unable to create variable object" error msg

Hi, i am working in C in Fedora Eclipse 3.3.0 with gdb debugger. I am geting segmentation fault with an error message "mi_cmd_var_create: unable to create variable object" on debugging the program. What should I do to solve this problem? rgds, Dona_m (14 Replies)
Discussion started by: dona_m
14 Replies

3. UNIX for Dummies Questions & Answers

Object reference not set to an instance of an object

I am new to PHP and UNIX. I am using Apache to do my testing on a Windows Vista machine. I am getting this error when I am trying to connect to a web service. I did a search and did not see any posts that pertain to this. Here is my function: <?php function TRECSend($a, $b, $c, $d,... (0 Replies)
Discussion started by: EddiRae
0 Replies

4. Shell Programming and Scripting

How to change a Makefile from building static library to shared library?

Hi: I have a library that it only offers Makefile for building static library. It built libxxx.a file. How do I in any way build a shared library? (either changin the Makefile or direct script or command to build shared library) Thanks. (1 Reply)
Discussion started by: cpthk
1 Replies

5. UNIX for Dummies Questions & Answers

How to obtain list of object files in a shared (dynamic) library?

How can I simply obtain a list of the object files in a shared (dynamic) library. I am looking for the equivalent of "ar -t <lib>" for archived (static) libraries. Thanks in advance. :rolleyes: ---------- Post updated at 01:47 PM ---------- Previous update was at 12:16 PM ---------- The... (1 Reply)
Discussion started by: chatieremerrill
1 Replies

6. Programming

Symbol differences in STLport library and application object file

Hello, I compiled the object file of a binary and i could see the symbol , "void*std::__node_alloc<1,0>::_M_allocate(unsigned)", this is actually present as "void*std::__node_alloc<true,0>::_M_allocate(unsigned)" in the libstlport4.so.1 . This has been verified with "nm -C " command Please... (4 Replies)
Discussion started by: shafi2all
4 Replies

7. Linux

./configure problem for libsf library due to apparently missing libdb library.

Hello, ./configure script fails to configure libsf. Please check the following last few lines of configure script error. checking for db1/db.h... no checking for db.h... yes checking for dbopen in -ldb1... no configure: error: No libdb? No libsf. But find command shows the following; ... (4 Replies)
Discussion started by: vectrum
4 Replies

8. AIX

Add shared members from library to same library in a different directory

I'm trying to install libiconv to AIX 7.1 from an rpm off of the perzl site. The rpm appears to install but I get this error message. add shr4.o shared members from /usr/lib/libiconv.a to /opt/freeware/lib/libiconv.a add shr.o shared members from /usr/lib/libiconv.a to ... (5 Replies)
Discussion started by: kneemoe
5 Replies

9. Programming

How to initialize an object with another object of different class?

How to initialize an object of class say "A", with an object of type say "B". The following code give the error message "error: conversion from âAâ to non-scalar type âBâ requested" #include <iostream> using namespace std; class B; class A{ public: A() { cout <<"\nA()" << endl; } ... (1 Reply)
Discussion started by: techmonk
1 Replies
lorder(1)						      General Commands Manual							 lorder(1)

NAME
lorder - find ordering relation for an object library SYNOPSIS
[files] DESCRIPTION
The input consists of one or more object or archive library files (see ar(1)) placed on the command line or read from standard input. The standard output is a list of pairs of object file names, meaning that the first file of the pair refers to external identifiers defined in the second. Output can be processed by to find an ordering of a library suitable for one-pass access by (see tsort(1) and ld(1)). Note that the link editor is capable of multiple passes over an archive in the archive format and does not require that be used when building an archive. Using the command may, however, allow for a slightly more efficient access of the archive during the link edit process. The symbol table maintained by allows to randomly access symbols and files in the archive, making the use of unnecessary when building ar- chive libraries (see ar(1)). EXTERNAL INFLUENCES
Environment Variables The following internationalization variables affect the execution of Determines the locale category for native language, local customs and coded character set in the absence of and other environment variables. If is not specified or is set to the empty string, a default of (see lang(5)) is used instead of Determines the values for all locale categories and has precedence over and other environment variables. Determines the locale category for character collation. Determines the locale category for character handling functions. Determines the locale that should be used to affect the format and contents of diagnostic messages written to standard error. Determines the locale category for numeric formatting. Determines the location of message catalogues for the processing of If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to See envi- ron(5). International Code Set Support Single- and multi-byte character code sets are supported. EXAMPLES
Build a new library from existing files: When creating libraries with so many objects that the shell cannot properly handle the expansion, the following technique may prove useful: WARNINGS
Object files whose names do not end with are overlooked, even when contained in library archives. Their global symbols and references are attributed to some other file. FILES
temporary files SEE ALSO System Tools: ar(1) create archived libraries ld(1) invoke the link editor Miscellaneous: tsort(1) produce an ordered list of items (topological sort) STANDARDS CONFORMANCE
lorder(1)
All times are GMT -4. The time now is 08:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy