473,508 Members | 4,324 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 10124
JackyMove <mo**********@hotmail.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**********@hotmail.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**********@noos.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**********@hotmail.com (JackyMove) wrote in message news:<b9**************************@posting.google. 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
12269
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...
14
1938
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...
4
2433
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...
10
5480
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...
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...
6
2606
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" {...
2
6640
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)...
6
1745
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...
2
5248
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(...
0
7128
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...
0
7332
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,...
0
7502
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...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4715
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...
0
3206
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...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1565
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 ...

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.