User forums > Using Code::Blocks
Missing includes / Preprocessor directive error ?
ingpjb:
Hello All,
I'm writing code in ANSI C and have a few header-files with (amongst other things) my function prototypes.
In one header-file I use a precompiler directive like :
#ifdef INTERFACE_LISTENER
use function 1
#else
use function 2
#endif // INTERFACE_LISTENER
I DO NOT specify INTERFACE_LISTENER at compile-time and so would expect function 2 in my global functions and code-completion.
BUT : I don't get function 2 (as well as function 1 by the way)
When I comment out to the following :
//#ifdef INTERFACE_LISTENER
// use function 1
//#else
use function 2
//#endif // INTERFACE_LISTENER
I get function 2 as I would like. (But that is very obvious .............!)
Can anyone give me a clou about the failing 'switch' for the precompiler ?
Regards,
PeTer
Freem:
I think I remember that rules said that this is not a general programming board.
Going on such a forum to ask your question will probably result in more useful answers. But when you will do that, do not forget to give true code, not pseudo code, because here, people can not see where is your error.
Another thing will be to specify your compiler and the error you have.
jarod42:
--- Code: ---#undef SOME_MACRO
#ifdef SOME_MACRO
void function_1a() {}
void function_1b();
#else
void function_2a() {}
void function_2b();
#endif // SOME_MACRO
void foo()
{
function_|Ctrl+Space
}
--- End code ---
code completion doesn't show any function_2 (but for me, it shows the function_1).
and in the item list that shows function names, function_2a is not present (but I have function_1a)
stahta01:
--- Quote from: Freem on April 20, 2012, 02:03:20 pm ---I think I remember that rules said that this is not a general programming board.
Going on such a forum to ask your question will probably result in more useful answers. But when you will do that, do not forget to give true code, not pseudo code, because here, people can not see where is your error.
Another thing will be to specify your compiler and the error you have.
--- End quote ---
The question above is very likely Code::Blocks related.
As it is about Code Completion and maybe symbol browser.
NOTE: My only suggestion is trying a nightly build and see if the problem goes away.
FYI: Without a Code::Blocks version information this post is more likely to be ignored.
Tim S.
Freem:
Err... sorry, it seem I am a bit tired... My apologies
Navigation
[0] Message Index
[#] Next page
Go to full version