TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: ALL
from: JESPER KAAS
date: 2020-03-10 11:24:00
subject: Problem with wiringPi

Hi

I set out with the intention of connecting and communicating with
small gadgets of own design via the GPIO on Raspberry Pi, programming
in C/C++. Did not think it should be a problem. Did some googling, and
ended up looking at wiringPi as a possibility. I tried a few installs
of wiringPi on my Pi3 with Raspbian. The last installation is from
http://wiringpi.com/download-and-install/ so that should be OK, but I
can't make it work, not even the simplest example, blink.c, from the
wiringPi download.
I use Geany for editing code, compiling, building and running.
Compiling blink.c ends with "Compilation ended successfully". But
trying a Build ends with errormessages on all the functions that
should be in the library wiringPi.h. And a line with #include
WiringPi.h is in the blink.c code. Example:
extern          void pinMode             (int pin, int mode)
Here is a clip of some of the errormessages from Geany:
-undefined reference to 'wiringPiSetup
-undefined reference to 'pinMode
-undefined reference to 'digitalWrite

A look at the source code wiringPi.c for the library shows that the
functions are declared and defined, and they can also be found in
wiringPi.h.
So what is wrong?
Writing and running small C programs from Geany works fine, as long as
not using wiringPi. Tried going through the "Learn To Code with C"
from MagPie with Geany, and it went fine.
It has been 16 years since I took a class in C/C++ and haven't used it
since, so it is a bit rusty to say it politely. I have programmed in
other lanuages though.  I have tested installs of different Linux
editions through the years but have always gone back to Windows, so I
only know the most necesssary ways to get round in Linux.

Any way, I will be gratefull for some help with this. Maybe it is best
to avoid using wiringPi for a newbe like me, but what to use then? I
would prefer to keep it in C or C++.

Best regards.
--
Jesper Kaas - jesperk@neindanke.online.no

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.