链接错误乘以定义

时间:2011-10-17 09:54:23

标签: linker

我有两种类型的链接错误。

一个是关于“多重定义的符号”

另一个是关于“符号统计数据具有不同大小的”

我无法理解如何解决它们。 你能帮我吗?

[elxr] (error) symbol isalnum multiply defined in:
[elxr] (error) symbol isalpha multiply defined in:    
[elxr] (error) symbol isblank multiply defined in:
[elxr] (error) symbol iscntrl multiply defined in:
[elxr] (error) symbol isdigit multiply defined in:
[elxr] (error) symbol isgraph multiply defined in:
[elxr] (error) symbol islower multiply defined in:
[elxr] (error) symbol isprint multiply defined in:
[elxr] (error) symbol ispunct multiply defined in:    
[elxr] (error) symbol isspace multiply defined in:
[elxr] (error) symbol isupper multiply defined in:
[elxr] (error) symbol isxdigit multiply defined in:
[elxr] (error) symbol tolower multiply defined in:
[elxr] (error) symbol toupper multiply defined in:
[elxr] (error) symbol isascii multiply defined in:
[elxr] (error) symbol toascii multiply defined in:
[elxr] (error) symbol isalnum multiply defined in:    
[elxr] (error) symbol isalpha multiply defined in:
[elxr] (error) symbol isblank multiply defined in:    
[elxr] (error) symbol iscntrl multiply defined in:    
[elxr] (error) symbol isdigit multiply defined in:    
[elxr] (error) symbol isgraph multiply defined in:    
[elxr] (error) symbol islower multiply defined in:    
[elxr] (error) symbol isprint multiply defined in:
[elxr] (error) symbol ispunct multiply defined in:    
[elxr] (error) symbol isspace multiply defined in:    
[elxr] (error) symbol isupper multiply defined in:    
[elxr] (error) symbol isxdigit multiply defined in:
[elxr] (error) symbol tolower multiply defined in:    
[elxr] (error) symbol toupper multiply defined in:
[elxr] (error) symbol isascii multiply defined in:
[elxr] (error) symbol toascii multiply defined in:

objs\kernel\syslog.o
objs\kernel\cfdp_server.o

[elxr] (error) symbol isalnum multiply defined in:
[elxr] (error) symbol isalpha multiply defined in:
[elxr] (error) symbol isblank multiply defined in:
[elxr] (error) symbol iscntrl multiply defined in: 
[elxr] (error) symbol isdigit multiply defined in:

objs\kernel\syslog.o
objs\kernel\syslog_server.o

[elxr] (error) symbol isgraph multiply defined in:        
[elxr] (error) symbol islower multiply defined in:    
[elxr] (error) symbol isprint multiply defined in:    
[elxr] (error) symbol ispunct multiply defined in:    
[elxr] (error) symbol isspace multiply defined in:    
[elxr] (error) symbol isupper multiply defined in:    
[elxr] (error) symbol isxdigit multiply defined in:    
[elxr] (error) symbol tolower multiply defined in:
[elxr] (error) symbol toupper multiply defined in:    
[elxr] (error) symbol isascii multiply defined in:
[elxr] (error) symbol toascii multiply defined in:

objs\kernel\syslog.o
objs\kernel\syslog_server.o

[elxr] (warning) symbol stats has different sizes in:

objs\kernel\syslog.o
..\GHS\int507\bilge8260\libitcpip.a(v3main.o)

[elxr] (error) symbol isalnum multiply defined in:    
[elxr] (error) symbol isalpha multiply defined in:
[elxr] (error) symbol isblank multiply defined in:
[elxr] (error) symbol iscntrl multiply defined in:
[elxr] (error) symbol isdigit multiply defined in:    
[elxr] (error) symbol isgraph multiply defined in:
[elxr] (error) symbol islower multiply defined in:    
[elxr] (error) symbol isprint multiply defined in:    
[elxr] (error) symbol ispunct multiply defined in:    
[elxr] (error) symbol isspace multiply defined in:
[elxr] (error) symbol isupper multiply defined in:    
[elxr] (error) symbol isxdigit multiply defined in:    
[elxr] (error) symbol tolower multiply defined in:
[elxr] (error) symbol toupper multiply defined in:
[elxr] (error) symbol isascii multiply defined in:
[elxr] (error) symbol toascii multiply defined in:


objs\kernel\syslog.o
lib\pus\libpus.a(os_abstract.o)

[elxr] (warning) symbol stats has different sizes in:

..\GHS\int507\myBSP\libitcpip.a(v3main.o)
lib\pus\libpus.a(os_abstract.o)

[elxr] (warning) symbol stats has different sizes in:

..\GHS\int507\myBSP\libitcpip.a(v3main.o)
lib\pus\libpus.a(pus.o)
[elxr] (error) errors during processing
Error: build failed
Build failed (Fri Oct 14 17:27:31 2011)

1 个答案:

答案 0 :(得分:2)

我猜你使用两个不同的头文件,其中定义了以下符号。 关于符号统计的冲突有不同的大小,也必然是由于同样的问题。

EG。如果模块1是基于cplusplus并且包含iostream.h并且模块2是基于C的并且包含stdio.h,并且如果我将模块1和模块2组合以创建单个模块,则__STDOUT,__ STDIN,__ STDERR等问题会成倍增加定义将出现。我认为报道的问题类似。