質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
C

C言語は、1972年にAT&Tベル研究所の、デニス・リッチーが主体となって作成したプログラミング言語です。 B言語の後継言語として開発されたことからC言語と命名。そのため、表記法などはB言語やALGOLに近いとされています。 Cの拡張版であるC++言語とともに、現在世界中でもっとも普及されているプログラミング言語です。

Q&A

解決済

1回答

2302閲覧

PIC16F ビルド失敗

raspypy

総合スコア247

C

C言語は、1972年にAT&Tベル研究所の、デニス・リッチーが主体となって作成したプログラミング言語です。 B言語の後継言語として開発されたことからC言語と命名。そのため、表記法などはB言語やALGOLに近いとされています。 Cの拡張版であるC++言語とともに、現在世界中でもっとも普及されているプログラミング言語です。

0グッド

0クリップ

投稿2019/04/15 03:30

##ビルド失敗の原因を教えてください。

使用しているマイコンは、
PIC16Fシリーズ
開発環境 MPLAB IDE X v5.15
コンパイラ XC8 v2.05

プログラムをコンパイルすると、次のエラーが表示されますが、
原因がわかりません。
どんなプログラムで試しても、↓のエラーが表示されます。

##エラー表示

html

1make[2]: *** No rule to make target 'build/default/production/Test1.o', needed by 'dist/default/production/Test1.X.production.hex'. Stop. 2make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf 3make[1]: Entering directory 'C:/Users/User01/MPLABXProjects/Test1.X' 4make -f nbproject/Makefile-default.mk dist/default/production/Test1.X.production.hex 5make[2]: Entering directory 'C:/Users/User01/MPLABXProjects/Test1.X' 6make[2]: Leaving directory 'C:/Users/User01/MPLABXProjects/Test1.X' 7make[1]: *** [.build-conf] Error 2 8make: *** [.build-impl] Error 2 9nbproject/Makefile-default.mk:90: recipe for target '.build-conf' failed 10make[1]: Leaving directory 'C:/Users/User01/MPLABXProjects/Test1.X' 11nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed 12 13BUILD FAILED (exit value 2, total time: 102ms)

##ビルドしたプログラム

html

1#include <xc.h> 2 3// #pragma config statements should precede project file includes. 4// Use project enums instead of #define for ON and OFF. 5 6// CONFIG1 7#pragma config FOSC = INTOSC // Oscillator Selection (INTOSC oscillator: I/O function on CLKIN pin) 8#pragma config WDTE = OFF // Watchdog Timer Enable (WDT disabled) 9#pragma config PWRTE = ON // Power-up Timer Enable (PWRT enabled) 10#pragma config MCLRE = ON // MCLR Pin Function Select (MCLR/VPP pin function is MCLR) 11#pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled) 12#pragma config CPD = OFF // Data Memory Code Protection (Data memory code protection is disabled) 13#pragma config BOREN = ON // Brown-out Reset Enable (Brown-out Reset enabled) 14#pragma config CLKOUTEN = OFF // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin) 15#pragma config IESO = OFF // Internal/External Switchover (Internal/External Switchover mode is disabled) 16#pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enable (Fail-Safe Clock Monitor is disabled) 17 18// CONFIG2 19#pragma config WRT = OFF // Flash Memory Self-Write Protection (Write protection off) 20#pragma config PLLEN = OFF // PLL Enable (4x PLL disabled) 21#pragma config STVREN = OFF // Stack Overflow/Underflow Reset Enable (Stack Overflow or Underflow will not cause a Reset) 22#pragma config BORV = LO // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (Vbor), low trip point selected.) 23#pragma config LVP = OFF // Low-Voltage Programming Enable (High-voltage on MCLR/VPP must be used for programming) 24 25#define __delay(X) _delay((unsigned long)((X))) //????????__delay????? 26#define _XTAL_FREQ 8000000 //Clock=8MHz 27 28void main(void) { 29 OSCCON=0x72; //PLL Disable/8MHz 30 ANSELC=0x00; //PORTC Digital Setting 31 TRISC=0x10; //0b00010000 32 LATC=0x00; 33 34 while(1){ 35 if(PORTCbits.RC4==0){ //RC4==1??OK 36 LATC=0x00; 37 LATCbits.LATC5=0; //RC5=0??OK 38 __delay(1000000); 39 LATCbits.LATC5=1; 40 __delay(1000000); 41 } 42 else{ 43 LATC=0x00; 44 LATCbits.LATC6=0; //RC5=0??OK 45 __delay(1000000); 46 LATCbits.LATC6=1; 47 __delay(1000000); 48 } 49 } 50 51}

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

peripheral-librariesをインストールする際のフォルダ設定が間違えていたことが原因でした。

投稿2019/04/15 04:45

raspypy

総合スコア247

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問