简体   繁体   English

在Yosemite上的Eclipse中调试C程序时出现问题

[英]Trouble debugging C program in Eclipse on Yosemite

I am getting the following persistent errors trying to debug a C program in Eclipse Juno on my mac: 我在Mac上的Eclipse Juno中尝试调试C程序时遇到以下永久错误:

Building target: TimeStamps Invoking: MacOS XC Linker gcc -v -o "TimeStamps" ./graphic/arrow.o ./graphic/axesdraw.o . . . Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.1.0 Thread model: posix "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.10.0 -o Undefined symbols for architecture x86_64: "_main", referenced from: implicit entry/start for main executable ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [TimeStamps] Error 1 Building target: TimeStamps Invoking: MacOS XC Linker gcc -v -o "TimeStamps" ./graphic/arrow.o ./graphic/axesdraw.o . . . Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.1.0 Thread model: posix "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.10.0 -o Undefined symbols for architecture x86_64: "_main", referenced from: implicit entry/start for main executable ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [TimeStamps] Error 1 So, I am confused about how to fix this in Eclipse. Building target: TimeStamps Invoking: MacOS XC Linker gcc -v -o "TimeStamps" ./graphic/arrow.o ./graphic/axesdraw.o . . . Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.1.0 Thread model: posix "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.10.0 -o Undefined symbols for architecture x86_64: "_main", referenced from: implicit entry/start for main executable ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [TimeStamps] Error 1因此,我对如何在Eclipse中解决此问题感到困惑。 The main routing is in timestamp_test.c I have -g -v as compiler flags, and -v as a linker flag. 主要路由位于timestamp_test.c中,我使用-g -v作为编译器标志,使用-v作为链接器标志。 No .o files are made. 没有创建.o文件。

Based on the the error given, you need to add the main function to timestamp_test.c . 根据给出的错误,您需要将main函数添加到timestamp_test.c

Or pass the file that have the main function implemented to the compiler. 或将具有main功能的文件传递给编译器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM