The problem with wiringPi library on ODROID-C2 - function not declared in this scope












2















I work with ODROID-C2. I have installed the wiringPi library followed the instructions (from page https://wiki.odroid.com/odroid-c2/application_note/gpio/wiringpi):



$ sudo apt install git



$ git clone https://github.com/hardkernel/wiringPi



$ cd wiringPi



$ sudo ./build



and finaly I get the information "All Done".
However during the instalation among different common warnings (e.g. "ignoring return value of ...") I get the following warning (e.g.):
"implicit declatration of function 'pinMode' [-Wimplicit-function-declaration]".
Similar warnings related to the diffrent functions appear many times during library instalation.
After instalation the usage of the command gpio readall allows to get the whole map of pins. Moreover, if I add the library to my program in C(#include <wiringPi.h>), the program is compiled successfully. However, when I use the command from library (e.g. wiringPiSetup();), the compilation fails and the following error appears:
16: error: 'wiringPiSetup' was not declared in this scope.
My simple code bellow:



#include <unistd.h>
#include <wiringPi.h>
#include <cstdio>
using namespace std;

int main (void)
{
wiringPiSetup();
while (1)
{
printf("*** T E S T ***n");
usleep(100000);
}

}


How can I fix the problem with wiringPi library?










share|improve this question























  • Did you provide your compiler collection an argument to link wiringPi? There is a snippet on the page you linked that does exactly that. It's the first snipper in Odroid-C2 section (look at -lwiringPi argument). Also take a look at gcc's -l option

    – pbn
    Jan 2 at 10:44













  • I use the following command to compile the file in Geany: gcc -Wall -c "%f" -lwiringPi

    – Bob SO
    Jan 2 at 10:53













  • What happens when you add extern void wiringPiSetup (void); before int main?

    – pbn
    Jan 2 at 11:10











  • After adding above line a new error appears: undefined reference to wiringPiSetup

    – Bob SO
    Jan 2 at 11:16













  • Well it means that wiringPi library is not available under default path.

    – pbn
    Jan 2 at 11:21


















2















I work with ODROID-C2. I have installed the wiringPi library followed the instructions (from page https://wiki.odroid.com/odroid-c2/application_note/gpio/wiringpi):



$ sudo apt install git



$ git clone https://github.com/hardkernel/wiringPi



$ cd wiringPi



$ sudo ./build



and finaly I get the information "All Done".
However during the instalation among different common warnings (e.g. "ignoring return value of ...") I get the following warning (e.g.):
"implicit declatration of function 'pinMode' [-Wimplicit-function-declaration]".
Similar warnings related to the diffrent functions appear many times during library instalation.
After instalation the usage of the command gpio readall allows to get the whole map of pins. Moreover, if I add the library to my program in C(#include <wiringPi.h>), the program is compiled successfully. However, when I use the command from library (e.g. wiringPiSetup();), the compilation fails and the following error appears:
16: error: 'wiringPiSetup' was not declared in this scope.
My simple code bellow:



#include <unistd.h>
#include <wiringPi.h>
#include <cstdio>
using namespace std;

int main (void)
{
wiringPiSetup();
while (1)
{
printf("*** T E S T ***n");
usleep(100000);
}

}


How can I fix the problem with wiringPi library?










share|improve this question























  • Did you provide your compiler collection an argument to link wiringPi? There is a snippet on the page you linked that does exactly that. It's the first snipper in Odroid-C2 section (look at -lwiringPi argument). Also take a look at gcc's -l option

    – pbn
    Jan 2 at 10:44













  • I use the following command to compile the file in Geany: gcc -Wall -c "%f" -lwiringPi

    – Bob SO
    Jan 2 at 10:53













  • What happens when you add extern void wiringPiSetup (void); before int main?

    – pbn
    Jan 2 at 11:10











  • After adding above line a new error appears: undefined reference to wiringPiSetup

    – Bob SO
    Jan 2 at 11:16













  • Well it means that wiringPi library is not available under default path.

    – pbn
    Jan 2 at 11:21
















2












2








2








I work with ODROID-C2. I have installed the wiringPi library followed the instructions (from page https://wiki.odroid.com/odroid-c2/application_note/gpio/wiringpi):



$ sudo apt install git



$ git clone https://github.com/hardkernel/wiringPi



$ cd wiringPi



$ sudo ./build



and finaly I get the information "All Done".
However during the instalation among different common warnings (e.g. "ignoring return value of ...") I get the following warning (e.g.):
"implicit declatration of function 'pinMode' [-Wimplicit-function-declaration]".
Similar warnings related to the diffrent functions appear many times during library instalation.
After instalation the usage of the command gpio readall allows to get the whole map of pins. Moreover, if I add the library to my program in C(#include <wiringPi.h>), the program is compiled successfully. However, when I use the command from library (e.g. wiringPiSetup();), the compilation fails and the following error appears:
16: error: 'wiringPiSetup' was not declared in this scope.
My simple code bellow:



#include <unistd.h>
#include <wiringPi.h>
#include <cstdio>
using namespace std;

int main (void)
{
wiringPiSetup();
while (1)
{
printf("*** T E S T ***n");
usleep(100000);
}

}


How can I fix the problem with wiringPi library?










share|improve this question














I work with ODROID-C2. I have installed the wiringPi library followed the instructions (from page https://wiki.odroid.com/odroid-c2/application_note/gpio/wiringpi):



$ sudo apt install git



$ git clone https://github.com/hardkernel/wiringPi



$ cd wiringPi



$ sudo ./build



and finaly I get the information "All Done".
However during the instalation among different common warnings (e.g. "ignoring return value of ...") I get the following warning (e.g.):
"implicit declatration of function 'pinMode' [-Wimplicit-function-declaration]".
Similar warnings related to the diffrent functions appear many times during library instalation.
After instalation the usage of the command gpio readall allows to get the whole map of pins. Moreover, if I add the library to my program in C(#include <wiringPi.h>), the program is compiled successfully. However, when I use the command from library (e.g. wiringPiSetup();), the compilation fails and the following error appears:
16: error: 'wiringPiSetup' was not declared in this scope.
My simple code bellow:



#include <unistd.h>
#include <wiringPi.h>
#include <cstdio>
using namespace std;

int main (void)
{
wiringPiSetup();
while (1)
{
printf("*** T E S T ***n");
usleep(100000);
}

}


How can I fix the problem with wiringPi library?







c raspberry-pi3 odroid wiringpi






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 2 at 10:35









Bob SOBob SO

355




355













  • Did you provide your compiler collection an argument to link wiringPi? There is a snippet on the page you linked that does exactly that. It's the first snipper in Odroid-C2 section (look at -lwiringPi argument). Also take a look at gcc's -l option

    – pbn
    Jan 2 at 10:44













  • I use the following command to compile the file in Geany: gcc -Wall -c "%f" -lwiringPi

    – Bob SO
    Jan 2 at 10:53













  • What happens when you add extern void wiringPiSetup (void); before int main?

    – pbn
    Jan 2 at 11:10











  • After adding above line a new error appears: undefined reference to wiringPiSetup

    – Bob SO
    Jan 2 at 11:16













  • Well it means that wiringPi library is not available under default path.

    – pbn
    Jan 2 at 11:21





















  • Did you provide your compiler collection an argument to link wiringPi? There is a snippet on the page you linked that does exactly that. It's the first snipper in Odroid-C2 section (look at -lwiringPi argument). Also take a look at gcc's -l option

    – pbn
    Jan 2 at 10:44













  • I use the following command to compile the file in Geany: gcc -Wall -c "%f" -lwiringPi

    – Bob SO
    Jan 2 at 10:53













  • What happens when you add extern void wiringPiSetup (void); before int main?

    – pbn
    Jan 2 at 11:10











  • After adding above line a new error appears: undefined reference to wiringPiSetup

    – Bob SO
    Jan 2 at 11:16













  • Well it means that wiringPi library is not available under default path.

    – pbn
    Jan 2 at 11:21



















Did you provide your compiler collection an argument to link wiringPi? There is a snippet on the page you linked that does exactly that. It's the first snipper in Odroid-C2 section (look at -lwiringPi argument). Also take a look at gcc's -l option

– pbn
Jan 2 at 10:44







Did you provide your compiler collection an argument to link wiringPi? There is a snippet on the page you linked that does exactly that. It's the first snipper in Odroid-C2 section (look at -lwiringPi argument). Also take a look at gcc's -l option

– pbn
Jan 2 at 10:44















I use the following command to compile the file in Geany: gcc -Wall -c "%f" -lwiringPi

– Bob SO
Jan 2 at 10:53







I use the following command to compile the file in Geany: gcc -Wall -c "%f" -lwiringPi

– Bob SO
Jan 2 at 10:53















What happens when you add extern void wiringPiSetup (void); before int main?

– pbn
Jan 2 at 11:10





What happens when you add extern void wiringPiSetup (void); before int main?

– pbn
Jan 2 at 11:10













After adding above line a new error appears: undefined reference to wiringPiSetup

– Bob SO
Jan 2 at 11:16







After adding above line a new error appears: undefined reference to wiringPiSetup

– Bob SO
Jan 2 at 11:16















Well it means that wiringPi library is not available under default path.

– pbn
Jan 2 at 11:21







Well it means that wiringPi library is not available under default path.

– pbn
Jan 2 at 11:21














0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54004785%2fthe-problem-with-wiringpi-library-on-odroid-c2-function-not-declared-in-this-s%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54004785%2fthe-problem-with-wiringpi-library-on-odroid-c2-function-not-declared-in-this-s%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas