Shop OBEX P1 Docs P2 Docs Learn Events
FlexProp command line tools — Parallax Forums

FlexProp command line tools

First, I did read the README.md file in the FlexProp directory but I'm still not sure how to build the samples. Do I need to set an environment variable that points to the system includes? If I try to compile cdemo.c, I get this:
dbetz@Davids-Mac-mini-2 samples % flexcc cdemo.c 
error: Preprocessor errors:
/Users/dbetz/Dropbox/p2/flexprop/samples/cdemo.c:4: error: Can't open include file "stdio.h"
    #include <stdio.h>
/Users/dbetz/Dropbox/p2/flexprop/samples/cdemo.c:5: error: Can't open include file "propeller.h"
    #include <propeller.h>
/Users/dbetz/Dropbox/p2/flexprop/samples/cdemo.c:18: error: Can't open include file "sys/p2es_clock.h"
    #include "sys/p2es_clock.h"
3 errors in preprocessor.
What step did I miss?

Comments

  • David BetzDavid Betz Posts: 14,516
    edited 2020-12-19 02:02
    Okay, this seems to work but is there an easier way?
    flexcc -2 -I ../flexprop/include cdemo.c
    
  • Now I see that flexprop/include has at least some of the simple libraries. I guess I should have looked before I asked.
  • Normally flexcc and flexspin look for the include files in PATH_TO_EXECUTABLE/../include, so if you put them in e.g. /opt/flexprop/bin/flexcc.exe then they'll look in /opt/flexprop/include. You can override this with the -I command line option (as you discovered) or with the FLEXCC_INCLUDE environment variable.
  • ersmith wrote: »
    Normally flexcc and flexspin look for the include files in PATH_TO_EXECUTABLE/../include, so if you put them in e.g. /opt/flexprop/bin/flexcc.exe then they'll look in /opt/flexprop/include. You can override this with the -I command line option (as you discovered) or with the FLEXCC_INCLUDE environment variable.
    I see what I did wrong. I added flexprop/bin to my path when I should have added flexprop/flexprop/bin. When I did that it now finds the include files.

Sign In or Register to comment.