2016-09-03 1 views
1

Comment utiliser la bibliothèque WiringPi via SSH sur NetBeans? Quand je lance un simple programme HelloWorld, cela fonctionne.Utilisation de la bibliothèque WiringPi C via SSH sur NetBeans

Tel est le message de sortie:

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 

Répondre

2

C'est un poste assez vieux, mais comme je l'ai eu le même problème et je l'ai résolu, je suis en train d'écrire sur la solution, donc si la seule chose à faire est d'ajouter quelques paramètres à la commande de compilation, en particulier le chemin vers les binaires et les includes plus l'option -lwiringpi.

Pour cela dans NetBeans, faites un clic droit sur le projet, puis sur les propriétés. De là, Build-> C Compiler.

Maintenant, trouver la voix Options supplémentaires, ouvrir et copier coller les éléments suivants:

-I/usr/local/include -L/usr/-lwiringPi local/lib

(ce sont les chemins à l'installation standard de wiringPi, si vous avez changé l'emplacement de la bibliothèque changer les chemins en conséquence)

Maintenant, cela devrait fonctionner, au moins cela a fonctionné pour moi.

L'espoir a aidé quelqu'un, Bye

EDIT:

J'ai oublié d'ajouter que vous devez ssh en tant qu'utilisateur root, sinon wiringPi ne fonctionne pas.

Pour cela, vous devez faire:

passwd racine

pour définir le mot de passe root

sudo nano/etc/ssh/sshd_config

Et changer PermitRootLogin oui

reboot