This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [CT_NG] crosstool-ng 1.1.0's cpp compile error


Hello leemgs!

(In case you matter, how should we call you: invain or leemgs?)

On Monday 19 May 2008 12:30:08 invain wrote:
> I figure out  reason of " error message: C++ compiler not installed on
> this system",
[--SNIP--]
> This reason is  --enable-language=c,${opt} problem  because sed(stream editor)
> parsing  is dismatch in centos 5.X distribution.

Good to see you found the problem! :-)

Would you please run some sed commands if I send you some, so that
I can take CentOS' sed into account in crosstool-NG?

> So, I edited  cc-gcc.sh script file to solve this problem right now.
> vi /opt/crosstool-ng-1.1.1/scripts/build/cc-gcc.sh (edit
> --enable-languages-c,c++)

That's a quick hack. As another, saner hack, you can set the option
CT_CC_LANG_OTHERS in "C compiler" --> "Other languages" and set it to
"c++,java" (without quotes).

> I can confirm exectuable file
>  in /opt/invaindtoolchain110/bin/targets/arm-invaind-linux-gnueabi/build/gcc-core-shared/bin
> directory.

You don't care about this directory, it's purely for crosstool-NG internal
usage. What you really care about is where your toolchains gets installed.

> [root@centos51 bin]# ls
> arm-invaind-linux-gnueabi-ar         arm-invaind-linux-gnueabi-gcj
> arm-invaind-linux-gnueabi-as         arm-invaind-linux-gnueabi-gcjh
> arm-invaind-linux-gnueabi-c++        arm-invaind-linux-gnueabi-gcov
> arm-invaind-linux-gnueabi-cpp        arm-invaind-linux-gnueabi-gjnih
> arm-invaind-linux-gnueabi-g++        arm-invaind-linux-gnueabi-jcf-dump
> arm-invaind-linux-gnueabi-gcc        arm-invaind-linux-gnueabi-jv-scan
> arm-invaind-linux-gnueabi-gcc-4.2.3  arm-invaind-linux-gnueabi-ld
> arm-invaind-linux-gnueabi-gccbug     arm-invaind-linux-gnueabi-strip

> And , I write cpp  hello source code.

Please, to avoid confusion, use C++ when you speak of C++. cpp refers to
the C preprocessor.

> [root@centos51 bin]# ./arm-invaind-linux-gnueabi-g++ -o cpphello2.o
> /opt/cpphello2.cpp

You must NOT use the g++ in the gcc-core-shared directory, it is not
complete!

Use the one is the install directory of your toolchain.

> [root@centos51 bin]# cat /opt/cpphello2.cpp
> #include <iostream>
> int main( int argc, char **argv )
> {
>     cout << "Hello World" << endl;
>     return 0;
> }

You're missing the following: using namespace std;
So that your code now reads:

---8<--- cut here ---8<---
#include <iostream>
using namespace std;
int main( int argc, char **argv )
{
    cout << "Hello World" << endl;
    return 0;
}
---8<--- cut here ---8<---

(Anyone knows why this is necessary? I thought that using std was default.)

> Anyone have idea or reason about this problem?

Please see above.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |   ^                |
| --==< °_° >==-- °------------.-------:  X  AGAINST      |  /e\  There is no  |
| http://ymorin.is-a-geek.org/ | * _ * | / \ HTML MAIL    |  """  conspiracy.  |
°------------------------------°-------°------------------°--------------------°


--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]