2016-09-03 3 views
1

Netbeans의 SSH를 통해 WiringPi 라이브러리를 어떻게 사용할 수 있습니까? 간단한 HelloWorld 프로그램을 실행하면 작동합니다.Netbeans의 SSH를 통해 WiringPi C 라이브러리 사용

Copying project files to /root/.netbeans/remote/RASPBERRYPI/win-7pjgqkgjsj4-Windows-x86_64 at [email protected] 
Building project files list... 
Checking directory structure... 
Checking previously uploaded files... 
Checking links... 
Uploading changed files: 
    Zipping 10 changed files... 
    Uploading zip to [email protected] 
    Unzipping changed files... 
Checking exec permissions... 
Uploading changed files finished successfully. 

cd '/root/.netbeans/remote/RASPBERRYPI/win-7pjgqkgjsj4-Windows-x86_64/C/Users/Public/Remote Projects/BlinkingLED' 
/usr/bin/make -f Makefile CONF=Debug 
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf 
make[1]: Entering directory '/root/.netbeans/remote/RASPBERRYPI/win-7pjgqkgjsj4-Windows-x86_64/C/Users/Public/Remote Projects/BlinkingLED' 
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux/blinkingled 
make[2]: Entering directory '/root/.netbeans/remote/RASPBERRYPI/win-7pjgqkgjsj4-Windows-x86_64/C/Users/Public/Remote Projects/BlinkingLED' 
mkdir -p build/Debug/GNU-Linux 
rm -f "build/Debug/GNU-Linux/main.o.d" 
gcc -c -g -std=c11 -MMD -MP -MF "build/Debug/GNU-Linux/main.o.d" -o build/Debug/GNU-Linux/main.o main.c 
mkdir -p dist/Debug/GNU-Linux 
gcc  -o dist/Debug/GNU-Linux/blinkingled build/Debug/GNU-Linux/main.o 
build/Debug/GNU-Linux/main.o: In function `main': 
/root/.netbeans/remote/RASPBERRYPI/win-7pjgqkgjsj4-Windows-x86_64/C/Users/Public/Remote Projects/BlinkingLED/main.c:24: undefined reference to `wiringPiSetup' 
/root/.netbeans/remote/RASPBERRYPI/win-7pjgqkgjsj4-Windows-x86_64/C/Users/Public/Remote Projects/BlinkingLED/main.c:29: undefined reference to `pinMode' 
/root/.netbeans/remote/RASPBERRYPI/win-7pjgqkgjsj4-Windows-x86_64/C/Users/Public/Remote Projects/BlinkingLED/main.c:32: undefined reference to `digitalWrite' 
/root/.netbeans/remote/RASPBERRYPI/win-7pjgqkgjsj4-Windows-x86_64/C/Users/Public/Remote Projects/BlinkingLED/main.c:34: undefined reference to `delay' 
/root/.netbeans/remote/RASPBERRYPI/win-7pjgqkgjsj4-Windows-x86_64/C/Users/Public/Remote Projects/BlinkingLED/main.c:35: undefined reference to `digitalWrite' 
/root/.netbeans/remote/RASPBERRYPI/win-7pjgqkgjsj4-Windows-x86_64/C/Users/Public/Remote Projects/BlinkingLED/main.c:37: undefined reference to `delay' 
collect2: error: ld returned 1 exit status 
nbproject/Makefile-Debug.mk:62: recipe for target 'dist/Debug/GNU-Linux/blinkingled' failed 
make[2]: *** [dist/Debug/GNU-Linux/blinkingled] Error 1 
make[2]: Leaving directory '/root/.netbeans/remote/RASPBERRYPI/win-7pjgqkgjsj4-Windows-x86_64/C/Users/Public/Remote Projects/BlinkingLED' 
nbproject/Makefile-Debug.mk:59: recipe for target '.build-conf' failed 
make[1]: *** [.build-conf] Error 2 
make[1]: Leaving directory '/root/.netbeans/remote/RASPBERRYPI/win-7pjgqkgjsj4-Windows-x86_64/C/Users/Public/Remote Projects/BlinkingLED' 
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed 
make: *** [.build-impl] Error 2 

답변

2

이 꽤 오래된 게시물입니다,하지만 난 같은 문제를 했어 내가 그것을 해결 한 이후 지금 그래서 만약,이 솔루션을 쓰고 있어요 :

는 출력 메시지입니다 어떤 사람은 그것을 필요로한다, 준비가되어있다;)

오직해야 할 일은 컴파일 명령, 특히 바이너리의 경로에 -lwiringpi 옵션을 더한 파라미터를 추가하는 것이다.

NetBeans에서 그렇게하려면 프로젝트를 마우스 오른쪽 버튼으로 클릭 한 다음 속성을 클릭하십시오. 거기에서 Build-> C 컴파일러.

이제

은 그것을 열, 음성 추가 옵션을 찾아 붙여 복사 다음

-I/usr/지방/포함 -L는/usr/-lwiringPi lib 디렉토리/지역

(이다 그 경로의 표준 설치에 경로, 라이브러리의 위치를 ​​변경 한 경우 그에 따라 경로를 변경하십시오)

이제는 적어도 저에게는 효과적 일 것입니다.

난 당신이 루트 사용자로 ssh를해야한다는 것을 추가하는 것을 잊었다

, 그렇지 않으면 wiringPi이 작동하지 않습니다

는 사람,

편집 안녕 도움 바랍니다.

이를 위해 당신은 수행해야합니다

의 passwd 루트

루트 암호를 설정하는

sudo는 나노의/etc/SSH/sshd_config를

변경에서 PermitRootLogin 재부팅

예에