473,799 Members | 3,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dlls containing functions with same names problems

Hi,

I have created an C based application in linux that uses a number of
dlls. Within the dlls themselves, the code calls sub functions e.g

dll_1 (Main dll function is called Return_Answer. The code within the
Return_Answer function called another function called Timer which is
in dll_1)

dll2 (Main dll function is called Calculate_Best_ Result. The code
within the Calculate_Best_ Result function called another function
called Timer which is in dll_2)

The Timer functions in each dll are completely different. However,
when I debug dll_1 in gdb, and am stepping through the code, I see
that it jumps to the dll_2 Timer function instead of it's own.

Anyone got any ideas. I have the same code working fine in MSVC. Never
had a problem with it. The commands, I use to compile and link to the
main executable are...

gcc -ggdb -c -fPIC dll_1.c
gcc -ggdb -shared -o libdll_1.so dll_1.o

gcc -ggdb -c -fPIC dll_2.c
gcc -ggdb -shared -o libdll_2.so dll_2.o

The main code file is called test.c

gcc -ggdb -c test.c
gcc -o test -lm test.o -L. -ldll_1 -ldll_2 -ldl

Everything compiles and links fine, so I am at a loss. Any help is
much appreciated.

Regards
Bob

Jun 28 '07 #1
3 1394
st*****@yahoo.c om wrote:
I have created an C based application in linux that uses a number of
dlls. Within the dlls themselves, the code calls sub functions e.g
dll's aren't part of C; they're an OS-specific extension.

I'd start in comp.unix.progr ammer.

--
Chris "surely you /expect/ problems with a two-Timer?" Dollin

Hewlett-Packard Limited registered no:
registered office: Cain Road, Bracknell, Berks RG12 1HN 690597 England

Jun 28 '07 #2
Roberto Waltman said:

<snip>
(a) Under windows, (at least Windows-CE, which my employer is now
inflicting upon me,) a C function in a library in not visible to
outside code unless it is explicitly exported.
How strange. I've written quite a few programs under Windows that can
call C functions in libraries just fine, without their being explicitly
exported. Perhaps this is a Wince-only phenomenon, and perhaps you're
simply mistaken, or perhaps I'm misinterpreting your statement, or
perhaps my memory is shot to pieces and I'm wrong, or perhaps there's
some other explanation. How to find out the truth? Ask in a Windows
programming group, that's how.

--
Richard Heathfield <http://www.cpax.org.uk >
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jun 28 '07 #3
st*****@yahoo.c om wrote:
>
I have created an C based application in linux that uses a number of
dlls. Within the dlls themselves, the code calls sub functions e.g

dll_1 (Main dll function is called Return_Answer. The code within the
Return_Answer function called another function called Timer which is
in dll_1)

dll2 (Main dll function is called Calculate_Best_ Result. The code
within the Calculate_Best_ Result function called another function
called Timer which is in dll_2)

The Timer functions in each dll are completely different. However,
when I debug dll_1 in gdb, and am stepping through the code, I see
that it jumps to the dll_2 Timer function instead of it's own.

Anyone got any ideas. I have the same code working fine in MSVC. Never
had a problem with it. The commands, I use to compile and link to the
main executable are...
Make the functions static.

--
<http://www.cs.auckland .ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfoc us.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

Jun 28 '07 #4

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

Similar topics

99
5928
by: David MacQuigg | last post by:
I'm not getting any feedback on the most important benefit in my proposed "Ideas for Python 3" thread - the unification of methods and functions. Perhaps it was buried among too many other less important changes, so in this thread I would like to focus on that issue alone. I have edited the Proposed Syntax example below to take out the changes unecessary to this discussion. I left in the change of "instance variable" syntax (...
1
1325
by: Leslaw Bieniasz | last post by:
Cracow, 15.09.2004 Hi, I am writing a big C++ project using BCB 4.0. The project consists of several dlls and exes. Each of the dll is composed of several units (that is cpp files with corresponding h files) containing: 1) ordinary C++ classes or functions, 2) class templates or function templates. I want the code for templates to reside within the dlls,
14
1838
by: tshad | last post by:
I am trying to set up a reusable library (business component) that I can use in a bunch of my pages. I built the file and it almost compiles, but I am not sure what I am missing. The vbc command and results are: ************************************************************************ C:\Inetpub\wwwroot\Development>vbc /t:library emailClass.vb
3
1106
by: ZaX | last post by:
Good day folks, I'm wondering what is the easiest way to link DLLs to a project with VB.NET. I've been building an app here (framework 1.1). In my project, I added a few references to files I've copied in my bin folder. The Copy Local property for the DLLs is set to true. Here, everything works fine.
7
1940
by: Jeff Lynn | last post by:
Help! I recently upgraded my VS V6 to VS 2005 and was unable to build projects that were perfectly ok under VS V6. Where VS 2005 fails was in the linker resolving external DLLs, which are Open Source DLLs like "log4Cxx" and "Xerces C++" DLL libraries. VS 2005 converted my projects without any problem. Even the proper lib includes and lib path were captured. But its linker just unable to resolve the C++ function references.
1
1531
by: Thomas Klein | last post by:
Hello newsgroup, I am new to C# and need to import a DLLs from a software vendor. I have already successfully tried to import a Win32-DLL in this way: /* * import DLL */
9
1986
by: yevvi | last post by:
Hi, We have a product with bunch of dlls which are now built with Visual Studio 2003. We want to switch the build to use VS2005. I have read that in VS2005 runtime libraries come as side-by-side assemblies and that application has to have a manifest binding it to those assemblies. My question is, can previously built apps use my new dlls build with vs2005? It would be really important to make it work, because otherwise we would...
2
1407
by: Dave | last post by:
Hi everyone. Okay, I'm trying to dynamically link some dlls and I'm having some problems. I originally had a project that seems to work, but for the life of me I can't repeat the results. I used app wizard to create a simple Win32 Dynamic Linked library. the code is as follows: #include "stdafx.h" #include "stdio.h"
0
890
by: Gabriel Genellina | last post by:
En Tue, 26 Aug 2008 07:42:50 -0300, <dudeja.rajat@gmail.comescribi�: Use getattr - same as with any other object. Suppose some_dll is your loaded DLL, then: function = getattr(some_dll, function_name) -- Gabriel Genellina
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10252
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10231
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.