[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
makefile & include problems
Can someone please shed light onto the following problem I am having.
I have software that I'm porting to the Etrax platform.
It compiles fine and without any errors or warnings on Redhat Linux 6.2
If I create an makefile for the etrax platform and "make host", even simple
things fail. e.g.
char * x = strdup("hello");
g++ -Wall -O0 -g -Wno-ctor-dtor-privacy -ansi -pipe -fcheck-new -Dlinux -c
-o Test.o Test.cpp
Test.cpp: In function `void useless()':
Test.cpp:6: warning: implicit declaration of function `int strdup(...)'
Test.cpp:6: warning: initialization to `char *' from `int' lacks a cast
The problem appears to be when using the C functions from C++. I tried
placing extern "C" around
the includes for string and stdlib but that did not help.
I have had the same problems with defines such as CBAUD and FNDELAY.
Has anyone had similar problems with C++ when trying to use "make host"?
Now the weird part. It compiles without any errrors at all when using
"make elinux", which is what I
All this seems to go away when using host based makefiles, i.e. not
It's a bit annoying though to have to create a completely separate makefile
for testing the software
on the Host platform and then another one for the etrax platform.