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
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
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
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
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 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
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
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
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 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
LEARN ABOUT OSF1
ldaclose
ldclose(3) Library Functions Manual ldclose(3)
NAME
ldclose, ldaclose - close a common object file
SYNOPSIS
#include <stdio.h>
#include <filehdr.h>
#include <syms.h>
#include <ldfcn.h>
int ldclose (ldptr)
LDFILE *ldptr;
int ldaclose (ldptr)
LDFILE *ldptr;
DESCRIPTION
ldopen(3) and ldclose provide uniform access to simple object files and object files that are members of archive files. An archive of com-
mon object files can be processed as if it is a series of simple common object files.
If TYPE(ldptr) does not represent an archive file, ldclose closes the file and frees the memory allocated to the LDFILE structure associ-
ated with ldptr. If TYPE(ldptr) is the magic number for an archive file and if archive has more files, ldclose reinitializes OFFSET(ldptr)
to the file address of the next archive member and returns FAILURE. The LDFILE structure is prepared for a later ldopen(3). In all other
cases, ldclose returns SUCCESS.
ldaclose closes the file and frees the memory allocated to the LDFILE structure associated with ldptr regardless of the value of
TYPE(ldptr). ldaclose always returns SUCCESS. The function is often used with ldaopen.
The program must be loaded with the object file access routine library
libmld.a.
RELATED INFORMATION
fclose(3), ldopen(3), ldfcn(4). delim off
ldclose(3)