I downloaded FLTK (Fast Light Toolkit) and I'm having trouble using the header files in it. Normally I store all of my C++ files and header files in a separate folder located in my User folder. However, when I extracted the FLTK folder(which holds the files) into this folder, and tried to compile a program that includes some of the header files, it was unable to locate them. Is there a place I should put the FLTK folder so the compiler will be able to access it, or a way to specify a file path to look for header files?
project -> build options ->search directories -> (compiler or linker)
note that you can set directories to be project or target specific (manage your targets in project -> properties)
you can also declare global variables that reside in your user settings, so that you don't have to hardcode paths in your project files.
see also:
http://wiki.codeblocks.org/index.php?title=The_build_process_of_Code::Blocks
http://wiki.codeblocks.org/index.php?title=Global_compiler_variables
http://wiki.codeblocks.org/index.php?title=Builtin_variables
Build options is greyed out. I'm not in a project, it's just a C++ file.
you can also set global directories in settings -> compiler and debugger. but why not just make a project?
I'm self learning and am doing lots of individual small exercises, so I don't want to make a project for every one, or make the whole thing one big project.
So if I select put under search directories a folder with other folders in it, will it read into those too? I'm still running into compiler errors and I'm thinking it's because I need to specify every sub folder that needs to be read into. The file path kind of looks like this...
C:/Users/Alex/C++/ftlk
Then there are lots of folders in ftlk with headers in them. However, all I added in to the search directories was what I listed above. Do I need to specify all of the directories inside of ftlk as well?
yes, unless you specify the includes in your code, with subpaths starting from the point you added to the search paths (that is : relative to C:/Users/Alex/C++/ftlk).
All right I got it. This isn't directly related to the compiler but I figured I would post it anyway. The compiler generates an error when trying to access certain functions in the cmath header such as..
using ::acos //::acos has not been declared
Does anyone know where the functions in the cmath header come from? Because all of the functions in it generate compiler errors.
Well I tried just running a normal input/output program, and the compiler can't find the iostream directory? What is up?
Edit: Saving new files as C files rather than C++ files.....?
This is *not* a general development forums. Thus your post(s) violate our forum rules.
Please try a C::B book or a C/C++ dedicated forum. Topic locked.