Z
Zbigniew
Hi,
Compiler: GCC 3.3.5
OS: SuSE Linux (Kernel: 2.6.11)
I reorganized my source code and now almost all my header files went
to "Include" folder.
Now when compiling with -I option I have plenty of problems with
system include files:
"conflict with previous declaration"
c++ -c -I../Include AmaSocket.cpp
C++ Libs source compilation AmaSocket.cpp ...
In file included from /usr/include/stdlib.h:43,
from /usr/include/c++/3.3.5/cstdlib:52,
from /usr/include/c++/3.3.5/bits/stl_algobase.h:67,
from /usr/include/c++/3.3.5/memory:54,
from /usr/include/c++/3.3.5/string:48,
from ../Include/AmaStr.h:12,
from ../Include/AmaSocket.h:5,
from AmaSocket.cpp:4:
/usr/include/bits/waitstatus.h:80: error: declaration of `unsigned
int
wait::<anonymous struct>::__w_retcode'
/usr/include/bits/waitstatus.h:75: error: conflicts with previous
declaration `
unsigned int wait::<anonymous struct>::__w_retcode'
When I change
-I"../Include"
option to
-idirafter"../Include"
compilation goes without earlier problems, but up to moment where I
have my own header files named the same as system (i.e. list.h with my
classes working on lists). In this case #include "list.h" acts as I
would include system file, not my own from "../Include"
list.cpp:
#include "list.h" // my own file inside ../Include folder
....
When I specify exactly #include "../Include/AmaSocket.h" without using
"-I../Include" then I do not have any problems with conflicting
declarations.
Any comments?
Thanks in advance
zmk
Compiler: GCC 3.3.5
OS: SuSE Linux (Kernel: 2.6.11)
I reorganized my source code and now almost all my header files went
to "Include" folder.
Now when compiling with -I option I have plenty of problems with
system include files:
"conflict with previous declaration"
c++ -c -I../Include AmaSocket.cpp
C++ Libs source compilation AmaSocket.cpp ...
In file included from /usr/include/stdlib.h:43,
from /usr/include/c++/3.3.5/cstdlib:52,
from /usr/include/c++/3.3.5/bits/stl_algobase.h:67,
from /usr/include/c++/3.3.5/memory:54,
from /usr/include/c++/3.3.5/string:48,
from ../Include/AmaStr.h:12,
from ../Include/AmaSocket.h:5,
from AmaSocket.cpp:4:
/usr/include/bits/waitstatus.h:80: error: declaration of `unsigned
int
wait::<anonymous struct>::__w_retcode'
/usr/include/bits/waitstatus.h:75: error: conflicts with previous
declaration `
unsigned int wait::<anonymous struct>::__w_retcode'
When I change
-I"../Include"
option to
-idirafter"../Include"
compilation goes without earlier problems, but up to moment where I
have my own header files named the same as system (i.e. list.h with my
classes working on lists). In this case #include "list.h" acts as I
would include system file, not my own from "../Include"
list.cpp:
#include "list.h" // my own file inside ../Include folder
....
When I specify exactly #include "../Include/AmaSocket.h" without using
"-I../Include" then I do not have any problems with conflicting
declarations.
Any comments?
Thanks in advance
zmk