473,734 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multiple symbol defined

Dear all,

I have encount the following problem. I have compiled a library
"lib.lib" successfully using a simulator compatable to VC++ on Windows
platform. Then I try to build an executatble in another project with
including "lib.lib". However, it gives me the errors: symbol xxx is
defined multiple times in a.obj and b.obj in "lib.lib". It seems that
there exists conflicts as I include some common ".h" file in both
source codes of the executable and the library. I would like to ask if
anyone know how to solve the problem.

Thank you very much.

Regards,
Jacky
Nov 13 '05 #1
4 10134
JackyMove <mo**********@h otmail.com> wrote:
Dear all,

I have encount the following problem. I have compiled a library
"lib.lib" successfully using a simulator compatable to VC++ on Windows
platform. Then I try to build an executatble in another project with
including "lib.lib". However, it gives me the errors: symbol xxx is
defined multiple times in a.obj and b.obj in "lib.lib". It seems that
there exists conflicts as I include some common ".h" file in both
source codes of the executable and the library. I would like to ask if
anyone know how to solve the problem.


Unfortunately, I do not. However, I could recomend that you try asking
your question in a programming newsgroup related to your compiler or
platform - you would be far more likely to find someone there familar
with your specific setup then in here.

--
== Eric Gorr ========= http://www.ericgorr.net ========= ICQ:9293199 ===
"Therefore the considerations of the intelligent always include both
benefit and harm." - Sun Tzu
== Insults, like violence, are the last refuge of the incompetent... ===
Nov 13 '05 #2
In 'comp.lang.c', mo**********@ho tmail.com (JackyMove) wrote:
<...> I have compiled a library
"lib.lib" successfully using a simulator compatable to VC++ on Windows
platform.
I trust you, but I'm curious. What kind of 'simulator' is able to compile a
library?
Then I try to build an executatble in another project with
including "lib.lib".
Ok.
However, it gives me the errors: symbol xxx is
defined multiple times in a.obj and b.obj in "lib.lib".
Is it true? If yes, it means that your project is using source files that was
are already used to build the library, or that you define public names
already used by the library.
It seems that
there exists conflicts as I include some common ".h" file in both
source codes of the executable and the library. I would like to ask if
anyone know how to solve the problem.


It's hard to say without a reduced-to-minimum example of your problem. Of
course your design must follow the usual rules :

- Public names are unique.
- Public functions calls are prototyped.
- The public prototypes are declared once and only once in a header.
- This header is include both in the implementation files and in the user
files.
- This header is guarded again multiple inclusions:

#ifndef H_XXX
#define H_XXX
/* xxx.h */
<...>
#endif /* guard */

Just a reminder: headers only contain:

- include of other headers
- public macros definitions
- public constant definitions
- public types definitions
- public functions prototypes
- public objects declarations
[C99]
- public inline function definitions

No object or function definition. Never.
(well, except inline in C99).

--
-ed- em**********@no os.fr [remove YOURBRA before answering me]
The C-language FAQ: http://www.eskimo.com/~scs/C-faq/top.html
<blank line>
FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/
Nov 13 '05 #3
bd
On Thu, 07 Aug 2003 20:08:39 -0700, JackyMove wrote:
Dear all,

I have encount the following problem. I have compiled a library
"lib.lib" successfully using a simulator compatable to VC++ on Windows
platform. Then I try to build an executatble in another project with
including "lib.lib". However, it gives me the errors: symbol xxx is
defined multiple times in a.obj and b.obj in "lib.lib". It seems that
there exists conflicts as I include some common ".h" file in both
source codes of the executable and the library. I would like to ask if
anyone know how to solve the problem.


Did you declare a variable without the extern keyword in one of those
headers? If so, add the extern, and put the old declaration in one of the
..c files.
--
Freenet distribution not available
But they went to MARS around 1953!!

Nov 13 '05 #4
Thanks for the help. In fact, I have carelessly included a ".c" file
instead of ".h" and, so to raise such problem.

Thank you.

Regards,
Jacky

mo**********@ho tmail.com (JackyMove) wrote in message news:<b9******* *************** ****@posting.go ogle.com>...
Dear all,

I have encount the following problem. I have compiled a library
"lib.lib" successfully using a simulator compatable to VC++ on Windows
platform. Then I try to build an executatble in another project with
including "lib.lib". However, it gives me the errors: symbol xxx is
defined multiple times in a.obj and b.obj in "lib.lib". It seems that
there exists conflicts as I include some common ".h" file in both
source codes of the executable and the library. I would like to ask if
anyone know how to solve the problem.

Thank you very much.

Regards,
Jacky

Nov 13 '05 #5

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

Similar topics

3
12286
by: Herman | last post by:
Hi everyone, I have a multiple file project for a class assignment. It consists of a class Point, then a class Polygon which uses the Point object, then a class Picture that uses the Polygon object. Unfortunately, I cannot compile Polygon.java, because it cannot recgonise the Point object. Any ideas? (I'm using the Sun SDK 1.4.2) Thanks! (By the way, the drawing package and Canvas class were created by my instructor to make drawing to...
14
1961
by: vishal | last post by:
Is it possible using any tool to get a single C file containing a combined code of multiple C files. The single file should include the contents of the header file. Example if I have following files: first.c second.c second.h(included in first.c) I want a tool that would combine all the contents of these files in
4
2446
by: ±èµ¿±Õ | last post by:
Tell me why the symbol "_" use in the Library? For example, char *_itoa( int value, char *string, int radix ); But We use function "itoa(value,string,radix) "only. I want to know the specific reason .
10
5498
by: PCHOME | last post by:
Hi! Would someone please help me thess C error(in gcc on Linux)? The compiler continues to give me: readLP.o: In function `Input_Problem': readLP.o(.text+0x0): multiple definition of `Input_Problem' main.o(.text+0x2f2): first defined here /usr/bin/ld: Warning: size of symbol `Input_Problem' changed from 172 to 185 in
3
472
by: Little | last post by:
Could someone tell me what I am doing wrong here about declaring mutiple double linked lists. This is what the information is for the project and the code wil be below that. Thank your soo much for your assitance in helping me solve this problem. Information: Create 4 double linked lists as follows: (a) A double linked list called NAMES which will contain all C like
6
2618
by: Richard | last post by:
1. Are there any problems with having, for instance, POSIX's "open" function #defined more than once. In my case, these would be in different static libraries: #ifdef __cplusplus extern "C" { #endif #define open myOpenFunction1
2
6658
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double) Location: class Week5MortgageGUI Week5MortgageLogic allint = logic.allInterest(amount, term, rate); Week5MortgageGUI.java:152:cannot find symbol symbol: method allInterest(double,double,double) Location: class Week5MortgageGUI
6
1759
by: The Architect | last post by:
Hi, If I have the same symbol in the .data section of 2 obj files, LD gives a multiple declaration error on linking? Would like to know the reason for this (diab only issues a warning) Also what if the symbols were in any other section (.rdata or .text)? Or which sections of obj files can be merged even if they have overlapping symbol names?
2
5267
by: whitechan | last post by:
Hi, I have been experiencing problems compiling my latest gnu compile code nested in c program, which runs on ARM7. the code : #if defined ARM_V6 __asm void RV_FASTCALL C_EdgeFilter4x4_RV8( PU8 pRec, const U32 uPitch, const U32 uWidth, const U32 uHeight, PU8 pStrengthV, PU8 pStrengthH) {
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
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
9236
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
9182
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
6031
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
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3261
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
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.