前提
mainというプロジェクト下のsrc下のmain.cとmain2.cの実行
プログラムはEclipse内のテンプレートのHello World ANSI C プロジェクトを使用
実現したいこと
ソースファイルの実行(main.c, main2.cのそれぞれ実行)
発生している問題・エラーメッセージ
mainというプロジェクト下のsrc下のmain.cを単体での実行は出来るのですが、main2.cを作成し、実行すると以下のエラーが出力され、デバッグファイルからmain.exeが消えてしまっていて実行が出来ない状況です。
Info: Internal Builder is used for build gcc -o main.exe "src\\main.o" "src\\main2.o" src\main2.o: In function `main': C:\Users\1821038\Desktop\pleiades-e4.5-ultimate-jre_20160312\pleiades\workspace\main\Debug/../src/main2.c:10: multiple definition of `main' src\main.o:C:\Users\1821038\Desktop\pleiades-e4.5-ultimate-jre_20160312\pleiades\workspace\main\Debug/../src/main.c:14: first defined here collect2.exe: error: ld returned 1 exit status
該当のソースコード
c
1#include <stdio.h> 2#include <stdlib.h> 3 4int main(void) { 5 puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */ 6 return EXIT_SUCCESS; 7}
試したこと
再起動, タスクマネージャーでのexeファイルの終了, プロジェクトファイルの再作成
補足情報(FW/ツールのバージョンなど)
Eclipse 4.5 Mars Ultimate 64bit Full Edition
Cプロジェクト
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/05/13 04:53
2022/05/13 05:10
2022/05/13 06:36
2022/05/19 04:46