Guys,
It occurs to a: confirm that WiringPi is no longer supported but b: it is still a viable method of accessing your GPIO world, I'm still using it and it does still work very well and c: yes there's newer way to access GPIO which clearly is the future.
The key thing being, running on an older release of operating system and still having the very important WiringPi library and header file.
Just having the C source code and declaring compiling it triggers an error isn't all that helpful without also showing the command line holding the strings of magic that both invokes the C compiler and tells it how the compile process is to be carried out.
Using WiringPi as an example you need its header file containing all the function prototypes and include it at the top of the file to tell your compiler the calling detail so that it can confirm you're using the function calls properly. You can then confirm it'll compile by including the "compile-only" option when compiling meaning NO run time program is produced.
The clever bits in WiringPi are in its library file and, if you want your program to use the actual functions at run-time you need to tell your compiler that you want to produce a runnable program AND include at compile time (or certainly at linking time) the necessary library or libraries so it can all be linked together into a run-able program.
In a big project your program would have multiple source files each encompassing a particular aspect of the final program and likely requiring access to other useful functions in the other source files. To give code in one file access to functions in other files the function prototypes have to be published. This is what the header files provide and this allows the compiler to compile each of your source files individually into a module without triggering any errors.
Once all the individual source files have been reduced to a compiled module the whole lot can be linked together, with any necessary libraries, into the final run-time program. Compilers like GCC let you compile multiple source files and link all the results together with any libraries all on one command line. Its just a matter of giving GCC to correct recipe.
The really clever way to manage a big multi-source file project is with a make file. Enough already!
It occurs to a: confirm that WiringPi is no longer supported but b: it is still a viable method of accessing your GPIO world, I'm still using it and it does still work very well and c: yes there's newer way to access GPIO which clearly is the future.
The key thing being, running on an older release of operating system and still having the very important WiringPi library and header file.
Just having the C source code and declaring compiling it triggers an error isn't all that helpful without also showing the command line holding the strings of magic that both invokes the C compiler and tells it how the compile process is to be carried out.
Using WiringPi as an example you need its header file containing all the function prototypes and include it at the top of the file to tell your compiler the calling detail so that it can confirm you're using the function calls properly. You can then confirm it'll compile by including the "compile-only" option when compiling meaning NO run time program is produced.
The clever bits in WiringPi are in its library file and, if you want your program to use the actual functions at run-time you need to tell your compiler that you want to produce a runnable program AND include at compile time (or certainly at linking time) the necessary library or libraries so it can all be linked together into a run-able program.
In a big project your program would have multiple source files each encompassing a particular aspect of the final program and likely requiring access to other useful functions in the other source files. To give code in one file access to functions in other files the function prototypes have to be published. This is what the header files provide and this allows the compiler to compile each of your source files individually into a module without triggering any errors.
Once all the individual source files have been reduced to a compiled module the whole lot can be linked together, with any necessary libraries, into the final run-time program. Compilers like GCC let you compile multiple source files and link all the results together with any libraries all on one command line. Its just a matter of giving GCC to correct recipe.
The really clever way to manage a big multi-source file project is with a make file. Enough already!
Statistics: Posted by RaspISteve — Wed Feb 21, 2024 9:32 pm