declaration of C functrion conflicts with ....
Posted: Thu Mar 03, 2011 6:36 am
Hello,
I'm developing a pretty big project. The project itself builds flawlessly. But when I add my C++ code to the project, I get tons of errors in my code. Original code is built without problems. I'm pulling my hairs out for several hours and I can't find a solution.
I get many such errors:
This code could be easily compiled on Linux, this is pure ANSI C code, but the file has .cpp extension.
Somebody could explain me, what's the heck? There are two GetIpPkt() functions in the ip.h, but on another code it doesn't lead to an error.
P.S. NNDK-MOD5234-KIT, NBEclipse 2.4 RC2, g++ 4.2.1
I'm developing a pretty big project. The project itself builds flawlessly. But when I add my C++ code to the project, I get tons of errors in my code. Original code is built without problems. I'm pulling my hairs out for several hours and I can't find a solution.
I get many such errors:
Code: Select all
m68k-elf-g++ -O2 -falign-functions=4 -IC:\nburn\include -IC:\nburn\MOD5234\include -IC:\nburn\gcc-m68k\m68k-elf\include -IC:\nburn\MOD5234\include\etpu -IC:\nburn\MOD5234\include\etpu\functions_API -IC:\nburn\MOD5234\include\etpu\cpu -IC:\nburn\MOD5234\include\etpu\sets -IC:\nburn\NBEclipse\workspace\ISaGRAF_Multi\Etcp -IC:\nburn\NBEclipse\workspace\ISaGRAF_Multi\Hsd -IC:\nburn\NBEclipse\workspace\ISaGRAF_Multi\IsaCmg -IC:\nburn\NBEclipse\workspace\ISaGRAF_Multi\IsaIxd -IC:\nburn\NBEclipse\workspace\ISaGRAF_Multi\IsaIxl -IC:\nburn\NBEclipse\workspace\ISaGRAF_Multi\IsaKer -IC:\nburn\NBEclipse\workspace\ISaGRAF_Multi\IsaNwl -IC:\nburn\NBEclipse\workspace\ISaGRAF_Multi\IsaRsi -IC:\nburn\NBEclipse\workspace\ISaGRAF_Multi\IsaSrv -IC:\nburn\NBEclipse\workspace\ISaGRAF_Multi\IsaSys -IC:\nburn\NBEclipse\workspace\ISaGRAF_Multi\IsaVm -IC:\nburn\NBEclipse\workspace\ISaGRAF_Multi\IsaCiA\include -gdwarf-2 -Wall -Wno-write-strings -c -fmessage-length=0 -fno-rtti -fno-exceptions -mcpu=5208 -DMOD5234 -DMCF5234 -oIsaCiA\emcy.o ..\IsaCiA\emcy.cpp
In file included from C:\nburn\include/startnet.h:41,
from C:\nburn\NBEclipse\workspace\ISaGRAF_Multi\IsaSys/dsys0def.h:63,
from C:\nburn\NBEclipse\workspace\ISaGRAF_Multi\IsaCiA\include/applicfg.h:26,
from C:\nburn\NBEclipse\workspace\ISaGRAF_Multi\IsaCiA\include/can_data.h:35,
from ..\IsaCiA\emcy.cpp:35:
C:\nburn\include/ip.h: In function 'IPPKT* GetIpPkt(EFRAME*)':
C:\nburn\include/ip.h:240: error: declaration of C function 'IPPKT* GetIpPkt(EFRAME*)' conflicts with
C:\nburn\include/ip.h:235: error: previous declaration 'IPPKT* GetIpPkt(pool_buffer*)' here
C:\nburn\include/ip.h: In function 'UDPPKT* GetUdpPkt(pool_buffer*)':
C:\nburn\include/ip.h:262: error: declaration of C function 'UDPPKT* GetUdpPkt(pool_buffer*)' conflicts with
C:\nburn\include/ip.h:249: error: previous declaration 'UDPPKT* GetUdpPkt(IPPKT*)' here
C:\nburn\include/ip.h: In function 'UDPPKT* GetUdpPkt(pool_buffer*)':
C:\nburn\include/ip.h:264: error: cannot convert 'pool_buffer*' to 'EFRAME*' for argument '1' to 'IPPKT* GetIpPkt(EFRAME*)'
C:\nburn\include/ip.h: In function 'UDPPKT* GetUdpPkt(EFRAME*)':
C:\nburn\include/ip.h:266: error: declaration of C function 'UDPPKT* GetUdpPkt(EFRAME*)' conflicts with
C:\nburn\include/ip.h:262: error: previous declaration 'UDPPKT* GetUdpPkt(pool_buffer*)' here
C:\nburn\include/ip.h: In function 'UDPPKT* GetUdpPkt(pool_buffer*)':
C:\nburn\include/ip.h:268: error: cannot convert 'IPPKT*' to 'EFRAME*' for argument '1' to 'UDPPKT* GetUdpPkt(EFRAME*)'
C:\nburn\include/ip.h: In function 'UDPPKT* GetInitUdpPkt(pool_buffer*)':
C:\nburn\include/ip.h:280: error: declaration of C function 'UDPPKT* GetInitUdpPkt(pool_buffer*)' conflicts with
C:\nburn\include/ip.h:273: error: previous declaration 'UDPPKT* GetInitUdpPkt(IPPKT*)' here
C:\nburn\include/ip.h: In function 'UDPPKT* GetInitUdpPkt(pool_buffer*)':
C:\nburn\include/ip.h:282: error: cannot convert 'pool_buffer*' to 'EFRAME*' for argument '1' to 'IPPKT* GetIpPkt(EFRAME*)'
Build error occurred, build is stopped
Time consumed: 4357 ms.
Somebody could explain me, what's the heck? There are two GetIpPkt() functions in the ip.h, but on another code it doesn't lead to an error.
P.S. NNDK-MOD5234-KIT, NBEclipse 2.4 RC2, g++ 4.2.1