
eclipseについて質問です.
現在eclipseでcのプログラムを書こうとしています.
そこで,csvファイルを読み込みたいのですが,以下のようなエラーが出てしまいます.
リンクエラーだということはわかるのですが,解決法がよくわからず詰まっています.
わかる方,いらっしゃいましたら回答をお願いいたします.
c:/program files (x86)/eclipse/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-fstatr.o): In function `_fstat_r':
fstatr.c:(.text+0x14): undefined reference to `_fstat'
c:/program files (x86)/eclipse/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-openr.o): In function `_open_r':
openr.c:(.text+0x16): undefined reference to `_open'
c:/program files (x86)/eclipse/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text+0x16): undefined reference to `_write'
c:/program files (x86)/eclipse/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-closer.o): In function `_close_r':
closer.c:(.text+0x12): undefined reference to `_close'
c:/program files (x86)/eclipse/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-isattyr.o): In function `_isatty_r':
isattyr.c:(.text+0x12): undefined reference to `_isatty'
c:/program files (x86)/eclipse/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-lseekr.o): In function `_lseek_r':
lseekr.c:(.text+0x16): undefined reference to `_lseek'
c:/program files (x86)/eclipse/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text+0x16): undefined reference to `_read'
collect2.exe: error: ld returned 1 exit status
A 回答 (2件)
- 最新から表示
- 回答順に表示
No.2
- 回答日時:
クロスコンパイルだよね。
ターゲットの基本ライブラリが構成できてないのではない?
エラーで定義されていないと書いてるのがUNIXシステムコール関数ばかりだし、その呼び出し元はlibc.aの対応関数のリエントラント版だ。
ターゲットOSのシステムコールに合わせてライブラリを事前に構成しておくか、あるいはコンパイル時にターゲットのOSなんかを指定しておかないといけないんじゃない?
No.1
- 回答日時:
> fstatr.c:(.text+0x14): undefined reference to `_fstat'
> openr.c:(.text+0x16): undefined reference to `_open'
> writer.c:(.text+0x16): undefined reference to `_write'
> closer.c:(.text+0x12): undefined reference to `_close'
> isattyr.c:(.text+0x12): undefined reference to `_isatty'
> lseekr.c:(.text+0x16): undefined reference to `_lseek'
> readr.c:(.text+0x16): undefined reference to `_read'
コンパイル時のエラーですね。
上記が全てです。。。
undefined reference to の後に示された関数が定義されていないと言っています。
C言語プログラムの中でファイルI/Oを行いたいのですよね?
必要なヘッダーファイルをincliudeしていますか?
C言語ライブラリのパスは正しく設定できていますか?
参考まで。
回答ありがとうございます.
ヘッダファイルのincludeはしているつもりなのですが,もしincludeし足りないファイルがあるとしたら,それがどれなのかわからない状況です.
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
関連するカテゴリからQ&Aを探す
おすすめ情報
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
C++によるPostgreSQLの接続
-
visual studio community2017 O...
-
fatal error LNK1104: ファイル...
-
C言語のPathFileExistsについて
-
スタティックライブラリ関係の...
-
C++はじめようと思います
-
VC++6.0からVC++.NET2005へ移植
-
「MFCを使用しない」から「MFC...
-
【VS2008 C++】2つのプロジェ...
-
静的/動的リンクライブラリにつ...
-
python エラー
-
エクセルのエラーメッセージ「4...
-
<unistd.h>をVisualStudioでつ...
-
Arduinoに関する質問
-
アプリケーションのDLLファイル...
-
visual studio 2019 についての...
-
コンパイル言語とインタープリ...
-
リリースモードとデバッグモー...
-
実行後にコンパイルに失敗しま...
-
コンパイルエラー:ユーザ定義...
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
スタティックライブラリの使い方
-
スタティックライブラリ関係の...
-
fatal error LNK1104: ファイル...
-
【VS2008 C++】2つのプロジェ...
-
インポートライブラリ(.lib)フ...
-
VS2010にて、依存関係とビルド順
-
VC++でビルド時の、リンク警告 ...
-
'd3dx9.lib' が開けません。
-
C++Builder リンカエラーとは?
-
visual studio community2017 O...
-
静的/動的リンクライブラリにつ...
-
スタティックリンクライブラリ...
-
exeファイルはどのdllを参照す...
-
ターボCのライブラリ追加方法
-
MinGWでOpenMPを使いたいのです...
-
VC++6.0からVC++.NET2005へ移植
-
ライブラリのリンクについて
-
VB6/SPREAD6.0 について
-
「MFCを使用しない」から「MFC...
-
error LNK2019: 未解決の外部シ...
おすすめ情報