🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3617

linking multiple libraries

#3617
From: lotx
Date: Tue, 25 May 1999 00:00
27 lines
1828 bytes
Hi,

   I am writing an application for which I want to link two very
similar libraries.  By similar, I mean that both libraries have a lot
of global variables and functions that have the same name. In fact, the
only difference between both libraries would be the access functions to
be called outside the library.  My problem is that the gcc linker will
not allow multiple instances of function names and global variables
even if these functions and variables are local to the library.

   BTW, in M$-Window$, it is possible to solve my dilemma by using
dynamically linking instead of static linking of libraries.  The WIN32
API provides functions such as LoadLibrary() and GetProcAddress() to
call explicit functions at run time.  This would allow me to use
distinct DLLs that have the same name for a global variable.

   Is there a switch or an option in gcc that gives me this capability?

Thanks.






--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
Technical Details
Message-ID: <7ifcnb$mna$1@nnrp1.deja.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,a54aad8297191818,start
X-Google-Attributes: gid11318c,public
X-Google-Thread: 10c696,a54aad8297191818,start
X-Google-Attributes: gid10c696,public
X-Google-Thread: fc89c,a54aad8297191818,start
X-Google-Attributes: gidfc89c,public
From: lotx@my-dejanews.com
Subject: linking multiple libraries
Date: 1999/05/25
Message-ID: <7ifcnb$mna$1@nnrp1.deja.com>
X-Deja-AN: 482080584
X-Http-Proxy: 1.1 x21.deja.com:80 (Squid/1.1.22) for client 131.241.8.250
Organization: Deja.com - Share what you know. Learn what you don't.
X-Article-Creation-Date: Tue May 25 23:45:47 1999 GMT
Newsgroups: comp.unix.programmer,comp.os.linux.development.apps,gnu.gcc.help
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)