User forums > Using Code::Blocks
Missing includes / Preprocessor directive error ?
Jenna:
I just tested it in the actual version from my repo with "Settings -> Editor... -> Code completion -> C/C++ parser -> Parse preprocessor directives" enabled, and it works correctly here.
It does not respect defines made in the projects "Build options", just defines inside the code.
ingpjb:
Well,
I've checked my code-completion settings and they are correct ! But still, my Code::Blocks does not parse the header file correct.
The original code is :
#ifdef INTERFACE_LISTENER
extern void pjb_if_init(PjbIf* handleStatemachine_cy* statemachine, EventSet* eventSet);
extern void pjb_if_set_listener(PjbIf* handle, handleEvent handleEventPtr);
extern void pjb_if_raiseEventPjbIf* handle, _Event* event);
#else
extern void pjb_if_init(PjbIf* handle, Statemachine_cy* statemachine, EventSet* eventSet, EventPool* eventPool);
extern sc_boolean pjb_if_is_entryOn_raised(PjbIf* handle );
extern sc_boolean pjb_if_is_exitOn_raised(PjbIf* handle );
extern sc_boolean pjb_if_is_entryOff_raised(PjbIf* handle );
extern sc_boolean pjb_if_is_exitOff_raised(PjbIf* handle );
extern void pjb_if_raise_switchOn(PjbIf* handle);
extern void pjb_if_raise_switchOff(PjbIf* handle);
extern void pjb_if_raise_leave(PjbIf* handle);
#endif // INTERFACE_LISTENER
Even when NOT using INTERFACE_LISTENER the parser does not show the functions between #else & #endif ..... ???
When commenting out to the following :
//#ifdef INTERFACE_LISTENER
// extern void pjb_if_init(PjbIf* handleStatemachine_cy* statemachine, EventSet* eventSet);
// extern void pjb_if_set_listener(PjbIf* handle, handleEvent handleEventPtr);
// extern void pjb_if_raiseEventPjbIf* handle, _Event* event);
//#else
extern void pjb_if_init(PjbIf* handle, Statemachine_cy* statemachine, EventSet* eventSet, EventPool* eventPool);
extern sc_boolean pjb_if_is_entryOn_raised(PjbIf* handle );
extern sc_boolean pjb_if_is_exitOn_raised(PjbIf* handle );
extern sc_boolean pjb_if_is_entryOff_raised(PjbIf* handle );
extern sc_boolean pjb_if_is_exitOff_raised(PjbIf* handle );
extern void pjb_if_raise_switchOn(PjbIf* handle);
extern void pjb_if_raise_switchOff(PjbIf* handle);
extern void pjb_if_raise_leave(PjbIf* handle);
//#endif // INTERFACE_LISTENER
then the functions show up in the symbol listing and codecompletion ..... which is obvious ....
Any ideas anyone ?
PeTer
MortenMacFly:
--- Quote from: ingpjb on April 20, 2012, 04:30:03 pm ---Any ideas anyone ?
--- End quote ---
Enable macro parsing in the CC options.
Jenna:
--- Quote from: MortenMacFly on April 20, 2012, 04:40:59 pm ---
--- Quote from: ingpjb on April 20, 2012, 04:30:03 pm ---Any ideas anyone ?
--- End quote ---
Enable macro parsing in the CC options.
--- End quote ---
Works here without it.
@ingpjb:
which version of C::B do you use ?
ingpjb:
@ jens
Hi jens,
I'm currently using version 10.05 (Build: May 27 2010, 11:01:50 - wx2.8.10 (Linux, unicode) - 32 bit) on a Debian machine .....
Regards,
PeTer
Navigation
[0] Message Index
[*] Previous page
Go to full version