I used project generator to create a new app for code::blocks. it is failing to compile, and complains that it can’t find an include:
if I edit it to:
then it gets past that line. BUT if i leave the original, and use Settings->Compiler->Search Directories & put /usr/include/cairo in that list, it does NOT find the include file. I don’t want to hard-code paths to every include file. I am new to Code::Blocks, as you might have guessed (the openframeworks lib does build, fwiw).
I have also tried adding /usr/include/cairo/ (tried both with trailing-slash & without) in the Project->Properties->C/C++ parser options, additional search paths. It’s as if something in the Makefile is overriding my attempts to help the compiler find its inputs… or is my code::blocks installation broken, perhaps?
in linux you configure the paths using the config.make file in the project folder not the codeblocks settings, since we use custom makefiles
Thank you. For the benefit of anyone else who finds this post, thanks to arturo I made this edit to config.make:
old line had [hash] PROJECT_EXTERNAL_SOURCE_PATHS =
I changed it by removing the [hash] and adding lines with += like this:
PROJECT_EXTERNAL_SOURCE_PATHS = /usr/include/cairo/
PROJECT_EXTERNAL_SOURCE_PATHS += /usr/include/gstreamer-1.0/
actually you should use
PROJECT_CFLAGS for this, like:
PROJECT_CFLAGS = -I/usr/include/cairo/
PROJECT_CFLAGS += -I/usr/include/gstreamer-1.0/
PROJECT_EXTERNAL_SOURCE_PATHS parses a folder outside of the project root and looks for source files in it adding them to be compiled with the project it also adds search paths for any folder in that path so it works too but it could have some negative effects since it’ll add everything recursively from those paths
also not sure why those paths are not autodetected, seems like a bug in those packages in your distro, what linux are you using?
Thanks for the info. I’m running Ubuntu (I think it’s 13.10, but I don’t
know how to check that easily). Could the autodetect failure be caused by
not having the -dev version of a package? That’s just a guess, as you can
see I have more C++ experience than linux or code::blocks experience.
Openframeworks works great in Visual Studio/Windows, but I’m trying to
broaden my horizons.
it could be, did you run the install_dependencies.sh script?