アームグラムで何かが欠けている私はCodeSourcery社グラム++ツールチェーンをインストールし、ハローシンプルな世界プログラムをコンパイルしようとした:++
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World" << endl;
return 0;
}
とリンカから
何ライブラリ午前$ arm-none-eabi-g++ helloworld.cpp -o helloworld.exe
bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000008018
lib/libc.a(lib_a-abort.o): In function `abort':
abort.c:(.text.abort+0x10): undefined reference to `_exit'
lib/libc.a(lib_a-fstatr.o): In function `_fstat_r':
fstatr.c:(.text._fstat_r+0x1c): undefined reference to `_fstat'
lib/libc.a(lib_a-openr.o): In function `_open_r':
openr.c:(.text._open_r+0x20): undefined reference to `_open'
lib/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text._sbrk_r+0x18): undefined reference to `_sbrk'
lib/libc.a(lib_a-signalr.o): In function `_kill_r':
signalr.c:(.text._kill_r+0x1c): undefined reference to `_kill'
lib/libc.a(lib_a-signalr.o): In function `_getpid_r':
signalr.c:(.text._getpid_r+0x4): undefined reference to `_getpid'
lib/libc.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text._write_r+0x20): undefined reference to `_write'
lib/libc.a(lib_a-closer.o): In function `_close_r':
closer.c:(.text._close_r+0x18): undefined reference to `_close'
lib/libc.a(lib_a-isattyr.o): In function `_isatty_r':
isattyr.c:(.text._isatty_r+0x18): undefined reference to `_isatty'
lib/libc.a(lib_a-lseekr.o): In function `_lseek_r':
lseekr.c:(.text._lseek_r+0x20): undefined reference to `_lseek'
lib/libc.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text._read_r+0x20): undefined reference to `_read'
collect2: ld returned 1 exit status
のエラーの多くを得ました私はここで行方不明?
ランタイムが見つからないようです。おそらく 'crt0.o'や' -lc'のようなものでしょうか? –
@Kerrek SB、 '-lc'は役に立ちませんでした。libgccディレクトリには' crt0.o'がありません。 'crtbegin.o'、' crtend.o'、 'crti.o'、' crtn。それは 'crt 'で始まります。 – Dani
'-v'フラグを付けてコンパイラを実行し、出力を見てください。 'collect2'の実際の引数は' -lc'や '.../crt1.o'のようなものを含んでいなければなりません。そうでない場合、コンパイラの設定が間違っている場合は、再インストールしてください。 –