Hi, I am on Mac using Terminal for compilation and I also had trouble starting with portsf library. I figured that you cannot use the 4 files directly as you described. You will need to build a library from those 4 files which is (once you know how it's done) rather easy.
1) Copy the complete folder "/Volumes/Audio_Programming_Book_V1/Code/BookCode/chapters/02dobsonBOOKexamples" to your desktop or any folder you like.
2) open a Terminal/Console window and go to the just created folder on your HD
3) Type "make" and hit enter. This will compile the 4 files into 1 library file (called "libportsf.a") which you can find now in the "lib" subfolder (which has been empty before).
4) Now you can use the library and you only need to include "portsf.h" in your projects.
5) Compiling a source *.c file which uses portsf works as follows for me:
In Terminal go to the folder which contains the "portsf.h" & the "/lib/libportsf.a" files
and type ("sine.c" stands for any file you want to compile ):
gcc sine.c -o sine -I include -Llib -lportsf -lm
gcc ... call the c compiler
sine.c ... the source file
-o sine ... specify the output file name
-I include ... the include folder for header files containing the portsf.h file
-Llib -lpostsf ... give the location of the library file
-lm ... don't know (?)
6) finally you can use the created executable in Terminal typing:
./sine arguments_list
Just try to compile the *.c files that are already contained as *.c and executables in the mentioned folder. Hope I could help you in any way, since it also gave me some headache starting out! Kind regards.
JFC! That worked. Thanks.
It looks like you're new here. If you want to get involved, click one of these buttons!