You are not logged in.

  • Login

1

Thursday, December 14th 2006, 2:05pm

DOCH nicht erledigt! [simpler code, dummer fehler! hilfe!]

das headerfile:

C Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef _GtGuiHardwareModell_h_
#define _GtGuiHardwareModell_h_
 
#include TcsPtcDetectorStruct
#include <map>
 
using namespace std;
 
class GtGuiHardwareModell
{
	public:
		GtGuiHardwareModell();
		~GtGuiHardwareModell();
 
	private:	
		unsigned short getFrequency();
		std::map <unsigned short, unsigned short> getPtcDetectorMap();
 
		std::map <unsigned short, unsigned short> ptcDetectorMap_;
		unsigned short frequency_;
};
#endif


source file:

C Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "GtGuiHardwareModell.h"
 
GtGuiHardwareModell::GtGuiHardwareModell() 
{
	frequency_=1;
}
 
GtGuiHardwareModell::~GtGuiHardwareModell()
{
 
}
 
unsigned short GtGuiHardwareModell::getFrequency()
{
	return frequency_;
}
 
std::map<unsigned short, unsigned short> GtGuiHardwareModell::getPtcDetectorMap()
{
	ptcDetectorMap_[1] = 3;
	return ptcDetectorMap_;
}


falls ich bei den includes ein struct include, das ich erstellt habe, scheitert das ganze.

C Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef _TcsPtcDetectorStruct_h_
#define _TcsPtcDetectorStruct_h_
 
 
struct TcsPtcDetectorStruct
{
	unsigned short partition;
	bool enabled;
//	std::string widgetId;
	std::string caption;
//	bool ptcEnabled;
};
#endif



Quoted

#include TcsPtcDetectorStruct verursacht einen fehler!

In file included from GtGuiHardwareModel.h:11,
from GtGuiHardwareModel.cc:8:
TcsPtcDetectorStruct.h:17: syntax
error before `;' token
In file included from /usr/include/c++/3.2.3/bits/stl_algobase.h:75,
from /usr/include/c++/3.2.3/bits/stl_tree.h:86,
from /usr/include/c++/3.2.3/map:66,
from GtGuiHardwareModel.h:12,
from GtGuiHardwareModel.cc:8:
/usr/include/c++/3.2.3/bits/stl_iterator.h:647: syntax error before `&' token
/usr/include/c++/3.2.3/bits/stl_iterator.h:649: `bool
__gnu_cxx::operator==(...)' must have an argument of class or enumerated
type
/usr/include/c++/3.2.3/bits/stl_iterator.h:649: `bool
__gnu_cxx::operator==(...)' must take exactly two arguments
/usr/include/c++/3.2.3/bits/stl_iterator.h:653: syntax error before `&' token
/usr/include/c++/3.2.3/bits/stl_iterator.h:655: `bool
__gnu_cxx::operator==(...)' must have an argument of class or enumerated
type
/usr/include/c++/3.2.3/bits/stl_iterator.h:655: `bool
__gnu_cxx::operator==(...)' must take exactly two arguments
/usr/include/c++/3.2.3/bits/stl_iterator.h:659: syntax error before `&' token
/usr/include/c++/3.2.3/bits/stl_iterator.h:661: `bool
__gnu_cxx::operator!=(...)' must have an argument of class or enumerated
type
/usr/include/c++/3.2.3/bits/stl_iterator.h:661: `bool
...
..
.


woran scheitert es!?!!?!?

bitte um hilfeee!

lg,
KITT

2

Thursday, December 14th 2006, 5:51pm

In der 3. von dir gepasteten Datei fehlt ein
#include <string>

Zur Info:
Statt einer map<ushort, ushort> würde ich eine const map<ushort, ushort>& zurückgeben, da sonst alle Elemente kopiert werden!

hth

Social bookmarks