When I change the file extension from hello_world/world.c to world.cpp and compile, everything is fine. When I #include "bcm_host.h" or #include <bcm_host.h> in world.c and compile, everything is fine also. Including bcm_host.h in world.cpp however, gives an error:
- Code: Select all
pi@raspberrypi /opt/vc/src/hello_pi/hello_world $ make
g++ -c -o world.o world.cpp
world.cpp:23:22: fatal error: bcm_host.h: No such file or directory
make: *** [world.o] Error 1
It's the same with the other examples. I'm trying to refactor the triangle.c code to c++. I'm sure I'm missing something obvious, but it's not obvious to me at the moment. A hint in the right direction would be appreciated.