embedded - Microchip 链接器问题

标签 embedded linker pic microchip

当我尝试在 MPLAB 中构建我的项目时,我收到此构建错误消息..

    Clean: Deleting intermediary and output files.
Clean: Deleted file "M:\12 CCP PWM\12 CCP PWM.o".
Clean: Done.
Executing: "C:\MCC18\bin\mcc18.exe" -p=18F46K20 "12 CCP PWM.c" -fo="12 CCP PWM.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
MPLAB C18 v3.20 (feature limited)
Copyright 1999-2005 Microchip Technology Inc.
This version of MPLAB C18 does not support the extended mode
and will not perform all optimizations.  To purchase a full
copy of MPLAB C18, please contact your local distributor or
visit buy.microchip.com.

Executing: "C:\MCC18\bin\mplink.exe" /l"C:\MCC18\lib" "C:\MCC18\lkr\18f46k20i.lkr" "12 CCP PWM.o" /u_CRUNTIME /o"12 CCP PWM.cof" /M"12 CCP PWM.map" /W
MPLINK 4.20, Linker
Copyright (c) 2008 Microchip Technology Inc.
Error - could not find definition of symbol 'main' in file 'C:\MCC18\lib/c018i.o'.
Errors    : 1

Link step failed.
----------------------------------------------------------------------
Release build of project `M:\12 CCP PWM\12 CCP PWM.mcp' failed.
Thu Apr 16 14:34:41 2009
----------------------------------------------------------------------
BUILD FAILED

我已经检查了链接器库的路径是否正确。我怀疑它与我的源代码有关...非常感谢任何帮助。

这是我的源代码.. http://cl1p.net/mplabc18

最佳答案

编译器可能正在寻找 main 的不同定义。我在一些 PIC 代码中看到过这一点:

// Main application entry point.
#ifdef __C30__
int main(void)
#else
void main(void)
#endif
{ ... }

关于embedded - Microchip 链接器问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/761084/

相关文章:

linux - 嵌入式 linux 中的 busybox 显示 "applet not found"

c - s(n)printf 打印比格式说明符指定的字符更多的字符

compiler-construction - 链接在编译器的上下文中意味着什么?

timer - Timer1 RD16 位在 PIC18 微 Controller 上有什么作用?

转换可变位大小的有符号整数

c - const 和 const volatile 之间的区别

c++ - OpenCV 应用程序(不是库)链接错误

c++ - 包含带有全局变量的头文件

c - 在c中做while循环条件

c - C 中的 PIC - 使用 RC0-3 创建自己的键盘扫描例程