why does initialise with vector not work here ?

M

Matthias Pospiech

This class:

#pragma once
#include <vector>
#include "um.h"

#define MAXMROOT 9 /* 2^(MAXMROOT-1) = # of elements in BRcnt */

class FastFourierTrans
{
public:
FastFourierTrans(void);
~FastFourierTrans(void);

public:

void FFT2D(vector<vector<CComplex> > InputArray,
vector<vector<CComplex> > OutputArray, long N,long sd);


};

throws the following error i do not understand:

1>e:\daten\dev\cpp\lightmodulator2dmat\lightmodulator2d\FastFourierTrans.h(34)
: error C2061: Syntaxfehler: Bezeichner 'vector'
1>.\FastFourierTrans.cpp(17) : error C2065: 'vector': nichtdeklarierter
Bezeichner
1>.\FastFourierTrans.cpp(17) : error C2059: Syntaxfehler: '>'
1>.\FastFourierTrans.cpp(21) : error C2143: Syntaxfehler: Es fehlt ';'
vor '{'
1>.\FastFourierTrans.cpp(21) : error C2447: '{': Funktionskopf fehlt -
Parameterliste im alten Stil?

What is wrong ?

Matthias
 
K

kingfox

This class:

#pragma once
#include <vector>
#include "um.h"

#define MAXMROOT 9 /* 2^(MAXMROOT-1) = # of elements in BRcnt */

class FastFourierTrans
{
public:
FastFourierTrans(void);
~FastFourierTrans(void);

public:

void FFT2D(vector<vector<CComplex> > InputArray,
vector<vector<CComplex> > OutputArray, long N,long sd);

};

throws the following error i do not understand:

1>e:\daten\dev\cpp\lightmodulator2dmat\lightmodulator2d\FastFourierTrans.h(-34)
: error C2061: Syntaxfehler: Bezeichner 'vector'
1>.\FastFourierTrans.cpp(17) : error C2065: 'vector': nichtdeklarierter
Bezeichner
1>.\FastFourierTrans.cpp(17) : error C2059: Syntaxfehler: '>'
1>.\FastFourierTrans.cpp(21) : error C2143: Syntaxfehler: Es fehlt ';'
vor '{'
1>.\FastFourierTrans.cpp(21) : error C2447: '{': Funktionskopf fehlt -
Parameterliste im alten Stil?

What is wrong ?

Matthias

It seems that the error message from compiler is not in English. SO,
could you please translate the error message to English?
 
V

Victor Bazarov

Matthias said:
This class:

#pragma once
#include <vector>
#include "um.h"

#define MAXMROOT 9 /* 2^(MAXMROOT-1) = # of elements in BRcnt */

class FastFourierTrans
{
public:
FastFourierTrans(void);
~FastFourierTrans(void);

public:

void FFT2D(vector<vector<CComplex> > InputArray,
vector<vector<CComplex> > OutputArray, long N,long sd);

Either use 'std::vector' or add 'using std::vector' before this class
definition. BTW, what book are you reading that doesn't explain 'std'
namespace and how it's to be used?
};

throws the following error i do not understand:

1>e:\daten\dev\cpp\lightmodulator2dmat\lightmodulator2d\FastFourierTrans.h(34)
1>.\FastFourierTrans.cpp(17) : error C2065: 'vector':
nichtdeklarierter Bezeichner
1>.\FastFourierTrans.cpp(17) : error C2059: Syntaxfehler: '>'
1>.\FastFourierTrans.cpp(21) : error C2143: Syntaxfehler: Es fehlt ';'
vor '{'
1>.\FastFourierTrans.cpp(21) : error C2447: '{': Funktionskopf fehlt -
Parameterliste im alten Stil?

What is wrong ?

'vector' is undefined. Next time please translate the error message into
English -- this is an English speaking newsgroup.

V
 
P

*PaN!*

void FFT2D(vector<vector<CComplex> > InputArray,
vector<vector<CComplex> > OutputArray, long N,long sd);

Use std::vector.

btw, i'm not sure it's a good idea passing two, possibly big,
vector<vector<X> > by value. In particular, it's not a brilliant idea if one
of them is supposed to be modified by the method (and you really want the
result to reach the caller).
I'd use a const reference and a simple reference respectively.
 
F

Fei Liu

Matthias said:
This class:

#pragma once
#include <vector>
#include "um.h"

#define MAXMROOT 9 /* 2^(MAXMROOT-1) = # of elements in BRcnt */

class FastFourierTrans
{
public:
FastFourierTrans(void);
~FastFourierTrans(void);

public:

void FFT2D(vector<vector<CComplex> > InputArray,
vector<vector<CComplex> > OutputArray, long N,long sd);


};

throws the following error i do not understand:

1>e:\daten\dev\cpp\lightmodulator2dmat\lightmodulator2d\FastFourierTrans.h(34)
: error C2061: Syntaxfehler: Bezeichner 'vector'
1>.\FastFourierTrans.cpp(17) : error C2065: 'vector': nichtdeklarierter
Bezeichner
1>.\FastFourierTrans.cpp(17) : error C2059: Syntaxfehler: '>'
1>.\FastFourierTrans.cpp(21) : error C2143: Syntaxfehler: Es fehlt ';'
vor '{'
1>.\FastFourierTrans.cpp(21) : error C2447: '{': Funktionskopf fehlt -
Parameterliste im alten Stil?

What is wrong ?

Matthias

I don't understand your language, but it seems you are missing
'using namespace std' or you can try 'std::vector' when you use vector
in your code.

Fei
 
M

Matthias Pospiech

*PaN!* said:
Use std::vector.

Yes, of course. I know why I need it, but id did not came to my mind...
btw, i'm not sure it's a good idea passing two, possibly big,
vector<vector<X> > by value. In particular, it's not a brilliant idea if one
of them is supposed to be modified by the method (and you really want the
result to reach the caller).
I'd use a const reference and a simple reference respectively.

You are absolutely right. I have changed it.

Matthias
 
R

Ron Natalie

Matthias said:
This class:

#pragma once
#include <vector>
#include "um.h"

#define MAXMROOT 9 /* 2^(MAXMROOT-1) = # of elements in BRcnt */

class FastFourierTrans
{
public:
FastFourierTrans(void);
~FastFourierTrans(void);

public:

void FFT2D(vector<vector<CComplex> > InputArray,
vector<vector<CComplex> > OutputArray, long N,long sd);
std::vector.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,142
Messages
2,570,820
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top