打印
[PIC®/AVR®/dsPIC®产品]

新人求助!新建项目编译失败,卡了好多天。。。

[复制链接]
4354|20
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
#include <xc.h>
#include <stdio.h>
#include <stdlib.h>
// CONFIG
#pragma config FOSC = EXTRC     // Oscillator Selection bits (RC oscillator)
#pragma config WDTE = ON        // Watchdog Timer Enable bit (WDT enabled)
#pragma config PWRTE = OFF      // Power-up Timer Enable bit (PWRT disabled)
#pragma config BOREN = ON       // Brown-out Reset Enable bit (BOR enabled)
#pragma config LVP = ON         // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled)
#pragma config CPD = OFF        // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off)
#pragma config WRT = OFF        // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control)
#pragma config CP = OFF         // Flash Program Memory Code Protection bit (Code protection off)

void main(void){
return;
}

make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'E:/PICbianyi/test.X'
make  -f nbproject/Makefile-default.mk dist/default/production/test.X.production.hex
make[2]: Entering directory 'E:/PICbianyi/test.X'
"D:\study\PIC-MPLABCcompiler\MPLAB-XC8-C\bin\xc8-cc.exe"  -mcpu=16F876A -c    -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default  -msummary=-psect,-class,+mem,-hex,-file  -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mc90lib   -std=c99 -gdwarf-3 -mstack=compiled:auto:auto     -o build/default/production/xinmain.p1 xinmain.c
make[2]: *** [build/default/production/xinmain.p1] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
terminate called after throwing an instance of 'std::invalid_argument'
  what():  No such file or directory
error: clang frontend command failed with exit code 3 (use -v to see invocation)
(908) exit status = 1
nbproject/Makefile-default.mk:107: recipe for target 'build/default/production/xinmain.p1' failed
make[2]: Leaving directory 'E:/PICbianyi/test.X'
nbproject/Makefile-default.mk:91: recipe for target '.build-conf' failed
make[1]: Leaving directory 'E:/PICbianyi/test.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed

编译已失败 (退出值2, 总时间: 2s)

编译工具:win10系统  MPLABXIDE V5.30     xc8-v2.10
单片机 PIC16F876a

使用特权

评论回复
沙发
lcczg| | 2019-11-5 10:14 | 只看该作者
win10系统  MPLABXIDE V5.25  +   xc8-v2.10 是可以的,等我安装MPLABXIDE V5.30再试试

使用特权

评论回复
板凳
lcczg| | 2019-11-5 10:57 | 只看该作者
我可以的,输出以下信息:

CLEAN SUCCESSFUL (total time: 1ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'C:/D disk/temp/pic16f876a test/test pic16f876a.X'
make  -f nbproject/Makefile-default.mk dist/default/production/test_pic16f876a.X.production.hex
make[2]: Entering directory 'C:/D disk/temp/pic16f876a test/test pic16f876a.X'
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe"  -mcpu=16F876A -c    -fno-short-double -fno-short-float -O0 -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default  -msummary=-psect,-class,+mem,-hex,-file  -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall   -std=c99 -gdwarf-3 -mstack=compiled:auto:auto     -o build/default/production/main.p1 main.c
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe"  -mcpu=16F876A -Wl,-Map=dist/default/production/test_pic16f876a.X.production.map  -DXPRJ_default=default  -Wl,--defsym=__MPLAB_BUILD=1    -fno-short-double -fno-short-float -O0 -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -msummary=-psect,-class,+mem,-hex,-file  -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto      -Wl,--memorysummary,dist/default/production/memoryfile.xml -o dist/default/production/test_pic16f876a.X.production.elf  build/default/production/main.p1     
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries

Memory Summary:
    Program space        used     Ah (    10) of  2000h words   (  0.1%)
    Data space           used     2h (     2) of   170h bytes   (  0.5%)
    EEPROM space         used     0h (     0) of   100h bytes   (  0.0%)
    Data stack space     used     0h (     0) of    60h bytes   (  0.0%)
    Configuration bits   used     1h (     1) of     1h word    (100.0%)
    ID Location space    used     0h (     0) of     4h bytes   (  0.0%)

make[2]: Leaving directory 'C:/D disk/temp/pic16f876a test/test pic16f876a.X'
make[1]: Leaving directory 'C:/D disk/temp/pic16f876a test/test pic16f876a.X'

BUILD SUCCESSFUL (total time: 10s)
Loading code from C:/D disk/temp/pic16f876a test/test pic16f876a.X/dist/default/production/test_pic16f876a.X.production.hex...
Loading completed
注意下图DFP的版本



我的工程在附件里

test pic16f876a.X.zip (49.81 KB)

使用特权

评论回复
评论
风起红尘 2019-11-5 21:49 回复TA
下下来运行报一样的错误。。。不知道电脑哪里有问题 
地板
CoolSilicon| | 2019-11-5 11:06 | 只看该作者
你安装的修改过路径, 可能导致编译器识别不到.

使用特权

评论回复
5
lcczg| | 2019-11-5 11:24 | 只看该作者
楼上说的对,XC8的安装路径被你改了 D:\study\PIC-MPLABCcompiler\MPLAB-XC8-C\

使用特权

评论回复
6
风起红尘|  楼主 | 2019-11-5 11:29 | 只看该作者
lcczg 发表于 2019-11-5 11:24
楼上说的对,XC8的安装路径被你改了 D:\study\PIC-MPLABCcompiler\MPLAB-XC8-C\

XC8的安装路径不能改吗。。我重装试试。一直不喜欢把东西装c盘。。谢谢

使用特权

评论回复
7
dongnanxibei| | 2019-11-5 13:24 | 只看该作者
默认路径安装。

使用特权

评论回复
8
dongnanxibei| | 2019-11-5 13:24 | 只看该作者
然后推荐5.25,MCC 配置完成后,要重启一次才能打开代码,这个BUG。。

使用特权

评论回复
9
风起红尘|  楼主 | 2019-11-5 20:22 | 只看该作者
本帖最后由 风起红尘 于 2019-11-6 08:56 编辑
lcczg 发表于 2019-11-5 11:24
楼上说的对,XC8的安装路径被你改了 D:\study\PIC-MPLABCcompiler\MPLAB-XC8-C\

make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'E:/PICbianyi/dstest.X'
make  -f nbproject/Makefile-default.mk dist/default/production/dstest.X.production.hex
make[2]: Entering directory 'E:/PICbianyi/dstest.X'
"C:\Program Files (x86)\Microchip\xc8\v2.10\bin\xc8-cc.exe"  -mcpu=16F876A -c    -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default  -msummary=-psect,-class,+mem,-hex,-file  -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -mc90lib   -std=c99 -gdwarf-3 -mstack=compiled:auto:auto     -o build/default/production/main.p1 main.c
make[2]: *** [build/default/production/main.p1] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
terminate called after throwing an instance of 'std::invalid_argument'
  what():  No such file or directory
error: clang frontend command failed with exit code 3 (use -v to see invocation)
(908) exit status = 1
nbproject/Makefile-default.mk:107: recipe for target 'build/default/production/main.p1' failed
make[2]: Leaving directory 'E:/PICbianyi/dstest.X'
nbproject/Makefile-default.mk:91: recipe for target '.build-conf' failed
make[1]: Leaving directory 'E:/PICbianyi/dstest.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed

编译已失败 (退出值2, 总时间: 4s)

按默认路径还是这样子
记得之前装5.25的时候也是这样子,会不会是Java包的问题啊?
一样的操作,在笔记本上编译成功了,在台式机上就是出错。。
求大佬们指点一下

使用特权

评论回复
10
CoolSilicon| | 2019-11-6 09:49 | 只看该作者
风起红尘 发表于 2019-11-5 20:22
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'E:/PICb ...

terminate called after throwing an instance of 'std::invalid_argument'
  what():  No such file or directory
error: clang frontend command failed with exit code 3 (use -v to see invocation)
(908) exit status = 1
你看这里的报错, 说是有一个dd的路径找不到..
你把下面2个头包含去掉的看看?
#include <stdio.h>
#include <stdlib.h>

使用特权

评论回复
11
风起红尘|  楼主 | 2019-11-6 09:58 | 只看该作者
CoolSilicon 发表于 2019-11-6 09:49
terminate called after throwing an instance of 'std::invalid_argument'
  what():  No such file or  ...

好了,对比了一下和笔记本电脑的差别
原来又是用户文件夹名字的问题,c盘中不能用中文用户文件夹名。。
谢谢大家了

使用特权

评论回复
12
风起红尘|  楼主 | 2019-11-6 10:00 | 只看该作者
解决了,原来是C盘用户文件夹名不能用中文名。终于可以用了,谢谢大家

使用特权

评论回复
13
lcczg| | 2019-11-6 10:16 | 只看该作者
风起红尘 发表于 2019-11-6 10:00
解决了,原来是C盘用户文件夹名不能用中文名。终于可以用了,谢谢大家 ...

C盘用户文件夹下哪个文件受影响会导致这个现象?

使用特权

评论回复
14
风起红尘|  楼主 | 2019-11-6 10:20 | 只看该作者
本帖最后由 风起红尘 于 2019-11-6 10:22 编辑
lcczg 发表于 2019-11-6 10:16
C盘用户文件夹下哪个文件受影响会导致这个现象?

当前用户的用户文件夹名,就是win10的登录账户对应的用户文件夹

使用特权

评论回复
15
奔波儿熊| | 2019-11-6 15:42 | 只看该作者
中文路径不知道惹了多少祸

使用特权

评论回复
16
小卡| | 2019-11-7 12:37 | 只看该作者
谢谢支持~ 希望你的问题已顺利解决

使用特权

评论回复
17
kxsi| | 2019-12-4 08:59 | 只看该作者
系统兼容性的问题吧

使用特权

评论回复
18
nawu| | 2019-12-4 09:07 | 只看该作者
我也长知识了

使用特权

评论回复
19
qcliu| | 2019-12-4 09:17 | 只看该作者
感谢楼主分享

使用特权

评论回复
20
tfqi| | 2019-12-4 09:31 | 只看该作者
感谢楼主分享

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

7

帖子

0

粉丝