Problem getting wiringPi to work

Post Reply
Wolferl
Posts: 11
Joined: Wed Dec 19, 2018 1:52 am
languages_spoken: english, german
ODROIDs: ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Problem getting wiringPi to work

Unread post by Wolferl » Wed Dec 19, 2018 2:03 am

Hi folks,

I just got myself an ODROID-C2 board to play with. It works nicely.
Now I wanted to use the wiringPi library to create a program that needs some pin action to go on.

After downloading and installing the wiringPi stuff from github, I have problems to compile even the example c files like "blink.c"
I'm getting messages like:

Code: Select all

$ make blink
[CC] blink.c
blink.c: In function 'main':
blink.c:37:3: warning: implicit declaration of function 'wiringPiSetup'; did you mean 'wiringPiFailure'? [-wimplicit-function-declaration]
    wiringPiSetup () ;
    ^~~~~~~~~~~
It does generate a blink.o file though.

What am I doing wrong here?

Thanks for your help!
Wolferl

User avatar
tobetter
Posts: 3662
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 26 times
Been thanked: 114 times
Contact:

Re: Problem getting wiringPi to work

Unread post by tobetter » Wed Dec 19, 2018 5:34 am

@Wolfrel,

Actually, that's because of the header 'wiringPi/wiringPi.h' that does not define the prototype of such functions.
Temporary you can do this in your WiringPi source tree that downloaded from Hardkernel's GitHub and would be able to compile.

Code: Select all

$ git checkout --track origin/dev
$ git cherry-pick 175d1f6af053801b5f76d3af034cf4d9caa4c6cb

Wolferl
Posts: 11
Joined: Wed Dec 19, 2018 1:52 am
languages_spoken: english, german
ODROIDs: ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Problem getting wiringPi to work

Unread post by Wolferl » Wed Dec 19, 2018 11:40 pm

Hi tobetter,

Thanks for your reply. Unfortunately, it didn't help.
I'm a bit fed up about tinkering around with crap like that and will now create my own wiringPi prototypes header file.

Cheers,
Wolferl

joerg
Posts: 889
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Has thanked: 5 times
Been thanked: 13 times
Contact:

Re: Problem getting wiringPi to work

Unread post by joerg » Thu Dec 20, 2018 2:30 am

Hello,

I tried with the last commit and came to the same result as @Wolferl. But I know that the former version worked, so I tried with this:

Code: Select all

git checkout 175d1f6af053801b5f76d3af034cf4d9caa4c6cb
...
HEAD is now at 175d1f6 ODROID C1/C2: Optimize I2C check code

./build
...

cd examples
make blink
[CC] blink.c
[link]
This is compiling without errors.

So, please HK developers, take a look why last commit is not compiling well on C1/C2.

Wolferl
Posts: 11
Joined: Wed Dec 19, 2018 1:52 am
languages_spoken: english, german
ODROIDs: ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Problem getting wiringPi to work

Unread post by Wolferl » Thu Dec 20, 2018 5:22 am

Hi Joerg,

You, sir, are a genius!
Works a treat now!

Cheers,
Wolferl

User avatar
tobetter
Posts: 3662
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 26 times
Been thanked: 114 times
Contact:

Re: Problem getting wiringPi to work

Unread post by tobetter » Thu Dec 20, 2018 8:42 am

@joerg, thanks...
For some reason, the git build is broken due to the head commit. I will let the person who made the commit to fix it, unfortunately it would be done in the middle of next week since the person is on leave.

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 0 guests