Re: ELDK 3.0 C++ Problem
From: Carlo Parravicini <hidden>
Date: 2004-05-20 14:02:44
Alle 19:56, mercoledì 19 maggio 2004, Wolfgang Denk ha scritto:
In message [ref] you wrote:quoted
have anybody problems using ELDK3.0 ppc_8xx-g++ cross-compiler(x86) on 'new' function?What makes you think this is a problem with ELDK's C++ compiler? Did you for example try to compile the same program with a native GCC 3.x C++ compiler on your PC?
Yes, I arrive to this point only because we have a problem in wxWindows: We have a project where we build: -- X (tiny) (cross compiled) -- glib (compiled native) -- gtk (compiled native) -- wxGTK (cross compiled) -- minimal sample (wx-based) for ppc system (ELDK 2.1) & x86 all works fine On ELDK 3.0 (recompiling all as above) all works (X and gtk tests) but not wxGTK (also with wx samples) and because this is the only package build in cpp this is why I was think to the cpp compiling. In effect the test below is broken, written whit the [] runs. So the question change: does anybody try to compile and use wxGTK with ELDK3.0 ??
quoted
I try to run a stupid program like that on a linux 2.4.4 (previus ELDK 2.1) & linux 2.4.24 (ELDK 3.0)I agree with your rating ;-)
Also me
quoted
//================================================= #include <iostream> #include <string.h> int main (int argc, char **argv) { int *p = new int (10000); memset ( p, 0, 10000); if (p == NULL) std::cout << "Allocation error\n"; else std::cout << "OK.\n"; return 0; //=================================================This program cannot be compiled, there is a '}' missing.quoted
ppc_8xx-g++ =Wall cpp.cpp -o cppThis was most definitely NOT the command line you used.quoted
Both give me a segmentation fault on 'new' executionWhat makes you think so? I bet a case of beer that the 'new" returned just fine, and that your program segfaulted in memset() instead.
Lost the beer, the code is wrong but the segfaulted is in the "new" (checked with a printf before the memset & also with gdb eh eh)
Of course you didn't see this, as your test if p is NULL is much too late, and obviously you didn't bother to run the program under a debugger.quoted
Any other have c++ compiling problems or have compiled c++ code successfuly?There are no known C++ problems specific to the ELDK (i. e. except those that apply to the native version of the same GCC as well). The problem is not with the ELDK. Best regards, Wolfgang Denk
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/