Compiler cannot resolve type definition

Hello all,

I am getting the following error compiling my project:


D:\.../src/engine/Plugin.hpp:78:21: error: 'engineVersion_t' does not name a type


I defined engineVersion_t in engine.hpp which looks as followed:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef ENGINE_HPP_
#define ENGINE_HPP_

#include <global/dataTypes.hpp>

namespace tradingScreener
{
	namespace engine
	{
		struct engineVersion_t
		{
			uint16 main;
			uint16 release;
			uint16 bugfix;
		};

	} // namespace engine

} // namespace tradingScreener

#endif /* ENGINE_HPP_ */ 


Plugin.hpp includes engine.hpp and looks as followed:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef PLUGIN_HPP_
#define PLUGIN_HPP_

#include <string>
#include <engine/engine.hpp>

#define WIN32_LEAN_AND_MEAN
#include <windows.h>

namespace tradingScreener
{

	namespace engine
	{
		class Core;

		class Plugin
		{
			...
			public:
				engineVersion_t getEngineVersion() const;
		};

	} // namespace engine

} // namespace tradingScreener

#endif /* PLUGIN_HPP_ */ 


Can somebody help me to get my head around this issue? Why the compiler cannot resolve the data type?

Many thanks,
Konstantin
closed account (zb0S216C)
You need to fully qualify engineVersion_t with: tradingScreener::engine.

On a side note, the _t suffix is reserved for UNIX system implementations. I know you're on Windows, but I thought you would like to know :)

Wazzak
@kribel
The code you have posted doesn't show what is wrong. There must be something else going on that you have not shown us.

@Framework
He should not have to specify tradingScreener::engine because it's defined in the same namespace.



Last edited on
Hi Peter87, Framework,

@Framework:
I tried your suggestion, unfortunately it did not work. The following error appeared instead:

D:\.../src/engine/Plugin.hpp:78:21: error: 'engineVersion_t' in namespace 'tradingScreener::engine' does not name a type


I also tried ::tradingScreener::engine::engineVersion_t and it did not work out.

@Peter87:
You are absolutely right. There must be something somewhere else. Lets have a deeper look into the project.

engine.hpp is included in the following files:
- Plugin.hpp (for content of this file please see the 1st post)
- GeneralPlugin.hpp

Content of GeneralPlugin.hpp:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef GENERALPLUGIN_HPP_
#define GENERALPLUGIN_HPP_

#include <boost/property_tree/ptree.hpp>
#include <engine/engine.hpp>
#include <global/dataTypes.hpp>

namespace tradingScreener
{
	namespace engine
	{

		typedef std::string property_t;

		class GeneralPlugin
		{
			public:
				virtual ~GeneralPlugin() = 0;

				virtual std::string getName() const = 0;
				virtual engineVersion_t getPluginVersion() const = 0;
				virtual std::string getPluginDescription() const = 0;
				virtual boost::property_tree::ptree getPluginProperties() const = 0;
				virtual void setPluginProperties(boost::property_tree::ptree properties) = 0;
				virtual std::string getPropertyDescription( property_t property, languageCode_t languageCode) const = 0;
		};

	} // namespace engine

} // namespace tradingScreener

#endif /* GENERALPLUGIN_HPP_ */ 


If you are interested in the complete project code, you are welcome to have a look at it. You can find it here:
http://svn.code.sf.net/p/tradingscreener/code-0/trunk
Topic archived. No new replies allowed.