Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Included namespace's content not recognized
Included namespace's content not recognized [message #869815] Fri, 04 May 2012 11:53 Go to next message
Harry Houdini is currently offline Harry HoudiniFriend
Messages: 142
Registered: February 2010
Senior Member
Hello,

I include in a .cpp a .h with angle branckets.
This .h contain a class definition within a two levels namespace.

In my cpp, when I type the first level namespace, the autocompletion does work; it completes with the name of the second level namespace as soon as I type :: (there isn't ay other second level namespace for now). But the completion doesn't propose me the class defined in the .h. When I type myslef the class name, Codan tells me that the type cnanot be resolved.

There isn't any other included file with the namespaces. And if I comment the class definition inclusion, Codan doesn't know anymore these namespaces. So why doesn't it see the class definition ?

I have no problem when compiling (I don't compile in Eclipse).
Re: Included namespace's content not recognized [message #869823 is a reply to message #869815] Fri, 04 May 2012 12:08 Go to previous messageGo to next message
Harry Houdini is currently offline Harry HoudiniFriend
Messages: 142
Registered: February 2010
Senior Member
Apparently, the problem comes from a macro at the definition class :
class YUNI_DECL MyClass
{
   ...
};

Where YUNI_DECL is defined as :

# ifdef YUNI_DYNAMIC_LIBRARY
#	ifdef YUNI_OS_MSVC
#		ifdef YUNI_DYNAMIC_LIBRARY_EXPORT
#			define YUNI_DECL             __declspec(dllexport)
#			define YUNI_EXPIMP_TEMPLATE
#		else
#			define YUNI_DECL             __declspec(dllimport)
#			define YUNI_EXPIMP_TEMPLATE  extern
#		endif
#	endif
# endif
/* Fallback to empty */
# ifndef YUNI_DECL
#	define YUNI_DECL
# endif
# ifndef YUNI_EXPIMP_TEMPLATE
#	define YUNI_EXPIMP_TEMPLATE
# endif

If I remove YUNI_DECL, the indexer has no problem.
Re: Included namespace's content not recognized [message #869824 is a reply to message #869823] Fri, 04 May 2012 12:15 Go to previous messageGo to next message
Harry Houdini is currently offline Harry HoudiniFriend
Messages: 142
Registered: February 2010
Senior Member
I had to include in the project properties (but not in my source file) the directory where is defined the macro.
Re: Included namespace's content not recognized [message #869828 is a reply to message #869824] Fri, 04 May 2012 12:42 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Harry Houdini wrote on Fri, 04 May 2012 14:15
I had to include in the project properties (but not in my source file) the directory where is defined the macro.

How do you include this header in your build process? Do you add it directly to the gcc command line with the -include option and is this header outside of your workspace?


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Included namespace's content not recognized [message #869835 is a reply to message #869828] Fri, 04 May 2012 13:10 Go to previous messageGo to next message
Harry Houdini is currently offline Harry HoudiniFriend
Messages: 142
Registered: February 2010
Senior Member
What header are you talking about ?
The one where is defined the class using the macro, or the one defining the macro ?
Re: Included namespace's content not recognized [message #869837 is a reply to message #869835] Fri, 04 May 2012 13:21 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
The one defining the macro.

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Included namespace's content not recognized [message #869850 is a reply to message #869837] Fri, 04 May 2012 13:53 Go to previous message
Harry Houdini is currently offline Harry HoudiniFriend
Messages: 142
Registered: February 2010
Senior Member
The makefile was created with a cascade of CMake files. I didn't do them, and I hardly undestand them.

But the CMake configuration for my project inherits from a CMake configuration of an other project where is located the definition of the macro.

I suppose make reflects that, because I have no problem when compiling.

[Updated on: Fri, 04 May 2012 14:02]

Report message to a moderator

Previous Topic:Unresolved includes (not standard include)
Next Topic:How to make CDT/Eclipse work with C++11 threads?
Goto Forum:
  


Current Time: Fri Apr 26 20:55:04 GMT 2024

Powered by FUDForum. Page generated in 0.02938 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top