473,386 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

library- functions

I have compiled the code with lots of libraries (some of which might
not be required in the code at all !) I want to know which function
is in which library . How do I get info about the function (i.e., it
belong to which library ) from the exe of my compiled code ?
Aug 16 '08 #1
6 1303
On 16 Aug, 09:25, onkar <onkar....@gmail.comwrote:
I have compiled the code with lots of libraries (some of which might
not be required *in the code at all !) I want to know which function
is in which library . How do I get info about the function (i.e., it
belong to which library ) from the exe of my compiled code ?
How did you build the executable? You could omit
libraries from the link line (don't specify -lfoo) and
see which functions the linker complains about. You
might use the various tools for examining the contents of
the library (eg objdump).

Your best bet is to ask the question in a more appropriate
newsgroup.

Aug 16 '08 #2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

onkar <on*******@gmail.com>
on Saturday 16 August 2008 04:25
wrote in comp.lang.c:
I have compiled the code with lots of libraries (some of which might
not be required in the code at all !) I want to know which function
is in which library . How do I get info about the function (i.e., it
belong to which library ) from the exe of my compiled code ?
Try ldd(1) to verify which libraries are linked against your
executable or library, then you can remove unused libraries
from the compiling command.

Also, objdump(1) may help on which functions are used in your
project.

Regards,
- --
.O. | Daniel Molina Wegener | C/C++ Developer
..O | dmw [at] coder [dot] cl | FOSS Coding Adict
OOO | http://coder.cl/ | Standards Rocks!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (FreeBSD)

iEYEARECAAYFAkimvu4ACgkQxyPEFPXO3WFjBACgitwYb6o+qh 6RE2ZGZr8QBfGr
BVAAnjP6Y/aWAkusebOaVfCEJia14xar
=+gO3
-----END PGP SIGNATURE-----
Aug 16 '08 #3
Daniel Molina Wegener <dm****************@coder.clwrites:
onkar <on*******@gmail.com>
on Saturday 16 August 2008 04:25
wrote in comp.lang.c:
>I have compiled the code with lots of libraries (some of which might
not be required in the code at all !) I want to know which function
is in which library . How do I get info about the function (i.e., it
belong to which library ) from the exe of my compiled code ?

Try ldd(1) to verify which libraries are linked against your
executable or library, then you can remove unused libraries
from the compiling command.

Also, objdump(1) may help on which functions are used in your
project.
Attempting to answer system-specific questions like this is a bad
idea, as you've just demonstrated. The original poster referred to
"the exe", which probably means a file with a ".exe" suffix, implying
that he's probably using MS Windows (or VMS, but that's unlikely these
days).

ldd and objdump are specific to Unix-like systems.

The OP needs to post his question to a forum that deals with whatever
system he's using, most likely comp.os.ms-windows.programmer.win32.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Aug 16 '08 #4
On 16 Aug 2008 at 17:44, Keith Thompson wrote:
Daniel Molina Wegener <dm****************@coder.clwrites:
>Try ldd(1) to verify which libraries are linked against your
executable or library, then you can remove unused libraries
from the compiling command.

Also, objdump(1) may help on which functions are used in your
project.

Attempting to answer system-specific questions like this is a bad
idea, as you've just demonstrated. The original poster referred to
"the exe", which probably means a file with a ".exe" suffix, implying
that he's probably using MS Windows (or VMS, but that's unlikely these
days).
Of course, this is nonsense. There are certainly Windows equivalents for
ldd and objdump, and there are plenty of Windows experts here to tell us
what they are.

For example, a similar question was discussed a couple months ago, and
Jacob Navia dealt with this in a Windows setting:
<http://groups.google.com/group/comp.lang.c/browse_thread/thread/5d13383861d93fff/00671242bfd70c4a>

Obviously lcc-win32 comes with tools that will do what the OP wants, if
indeed he's using Windows. ("The exe" might just be a shortcut for "the
executable", after all.)

Aug 16 '08 #5

"onkar" <on*******@gmail.comwrote in message news:
>I have compiled the code with lots of libraries (some of which might
not be required in the code at all !) I want to know which function
is in which library . How do I get info about the function (i.e., it
belong to which library ) from the exe of my compiled code ?
Unless you have access to a tool already written for the purpose, it is very
difficult. Compilers typically strip most of the symbols from final
executables. However the functions remain as machine code, so if you know
what they look like you can retrieve them. Also some symbols may remain
either to help debuggers along, or to aid linking with system libraries at
run time.

The first port of call is to dump the executable as hex/ASCII and see if you
can make any sense of it.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Aug 16 '08 #6
"Malcolm McLean" <re*******@btinternet.comwrites:
"onkar" <on*******@gmail.comwrote in message news:
>>I have compiled the code with lots of libraries (some of which might
not be required in the code at all !) I want to know which function
is in which library . How do I get info about the function (i.e., it
belong to which library ) from the exe of my compiled code ?
Unless you have access to a tool already written for the purpose, it
is very difficult. Compilers typically strip most of the symbols from
final executables. However the functions remain as machine code, so if
you know what they look like you can retrieve them. Also some symbols
may remain either to help debuggers along, or to aid linking with
system libraries at run time.

The first port of call is to dump the executable as hex/ASCII and see
if you can make any sense of it.
I'd say that dumping the executable in hex and/or ASCII should be a
last resort. The first resort should be finding a pre-existing tool
on the system you're using that will do the job for you.

Finding such a tool is left as an exercise for another newsgroup.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Aug 17 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: pieter.breed | last post by:
Hi All, The company I work for has traditionally used COM/ActiveX for the solutions that it provides. We are in the process of moving to .NET and a few applications have been written in VB.NET...
3
by: K.S.Liang | last post by:
Hi all, 1> If there are more than one dynamic linking libraries in the file system, how do I know which one is loaded into system? Any C library or system call can tell me which *.so or *.sl is...
1
by: Jim | last post by:
Have fully operational software package developed on VB.NET that worked until Jan 1 2003, with early stage deployments on Oct 10, Oct 23, Nov 11, Dec 12 and Dec 30. When attempted final...
10
by: mwt | last post by:
So in a further attempt to learn some Python, I've taken the little Library program (http://groups.google.com/group/comp.lang.python/browse_thread/thread/f6a9ccf1bc136f84) I wrote and added...
10
by: Julian | last post by:
I get the following error when i try to link a fortran library to a c++ code in .NET 2005. LINK : fatal error LNK1104: cannot open file 'libc.lib' the code was working fine when built using...
21
by: petermichaux | last post by:
Hi, I've been asking questions about library design over the last week and would like to get feedback on my overall idea for a JavaScript GUI library. I need a nice GUI library so there is a...
20
by: Frank-O | last post by:
Hi , Recently I have been commited to the task of "translating" some complex statistical algorithms from Matlab to C++. The goal is to be three times as fast as matlab ( the latest) . I've...
6
by: =?Utf-8?B?WW9naSBXYXRjaGVy?= | last post by:
Hello, I am using Visual Studio-2003. I created a project to build my library. Since I am using third party libraries as well, I have specified those additional library dependencies in project...
0
by: JosAH | last post by:
Greetings, the last two article parts described the design and implementation of the text Processor which spoonfeeds paragraphs of text to the LibraryBuilder. The latter object organizes, cleans...
0
by: JosAH | last post by:
Greetings, welcome back; above we discussed the peripherals of the Library class: loading and saving such an instantiation of it, the BookMark interface and then some. This part of the article...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.