Author Topic: Alternate Include Path (Global Variable in CodeBlocks)?  (Read 9118 times)

Offline dominover

  • Multiple posting newcomer
  • *
  • Posts: 46
Alternate Include Path (Global Variable in CodeBlocks)?
« on: July 02, 2013, 03:18:55 am »
I've set up CodeBlocks for FLTK.  If I set up the Global Variable Editor with the 'base' c:\fltk-1.3.2 it will look for the include directory in c:\fltk-1.3.2\include .  Same goes for the libs etc.

There is an alternative field for the include path below the 'base' field. Because FLTK does not have an 'include' directory I want the include directory to be the 'FL' directory.  So my include path should be
c:\fltk-1.3.2\FL.   But even if I place that directory in the include path field, codeblocks still doesn't seem to see it.

Is there any way to get this to work or is that not what this 'include' field is for?
The only way I can get this to work is to make my own include folder and dump all the FL contents in it.  But really, I shouldn't have to do that.

Thanks

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5906
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Alternate Include Path (Global Variable in CodeBlocks)?
« Reply #1 on: July 03, 2013, 02:26:00 am »
I've set up CodeBlocks for FLTK.  If I set up the Global Variable Editor with the 'base' c:\fltk-1.3.2 it will look for the include directory in c:\fltk-1.3.2\include .  Same goes for the libs etc.
Correct.
In your case:

Base:
FLTK  ---> c:\fltk-1.3.2
include path (if your leave the "include" field empty in Global Variable Editor)
FLTK.include  ---> c:\fltk-1.3.2\include
lib path(if your leave the "lib" field empty in Global Variable Editor)
FLTK.lib ---> c:\fltk-1.3.2\lib



Quote
There is an alternative field for the include path below the 'base' field. Because FLTK does not have an 'include' directory I want the include directory to be the 'FL' directory.  So my include path should be
c:\fltk-1.3.2\FL.   But even if I place that directory in the include path field, codeblocks still doesn't seem to see it.

Is there any way to get this to work or is that not what this 'include' field is for?
The only way I can get this to work is to make my own include folder and dump all the FL contents in it.  But really, I shouldn't have to do that.

Thanks
You have two ways:
In your Global Variable Editor, you can put: "$(#FLTK)\FL" (no double quotes) in the "include" field, then in your project build setting $(#FLTK.include) will becomes c:\fltk-1.3.2\FL

Another way:
Leave the "include" field empty, and use "$(#FLTK)\FL" in your project search paths.

For lib path, they are similar.

You can find more details in wiki page: Global compiler variables - CodeBlocks
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.