oh boy, VC6 problem

G

Gernot Frisch

class GFFront2D
{
public:
std::vector<GFFront2D::SECTION>& sections);
};


yields a C2027 (use of undefined type "GFFront2D")

Can you help me out?

This VC6 crap gives me the super-creeps. I hate it, hate it, hate
it... Unfortunately I have to use it for this project.
 
S

Sharad Kala

Gernot Frisch said:
class GFFront2D
{
public:
std::vector<GFFront2D::SECTION>& sections);

std::vector< ::GFFront2D::SECTION>& sections;

Does this help ? I don't have VC 6 to test it.
Also, what is SECTION ? There should be no ')' before semicolon.

Sharad
 
G

Gernot Frisch

Sharad Kala said:
std::vector< ::GFFront2D::SECTION>& sections;

Does this help ? I don't have VC 6 to test it.
Also, what is SECTION ? There should be no ')' before semicolon.

No, it does not help. Sorry, I provided too little snippet.

#include <vector>
class GFFront2D
{
public:
struct NODE
{
double x, y;
double val;
};
struct SECTION
{
NODE pos;
int nreg_before;
};


public:
GFFront2d();
int IntersectRegionsWithLine(const NODE n[2],
std::vector<GFFront2D::SECTION>& sections);
};

This copiles fine with Comeau online test compiler and .NET7.1.
<sigh>
-Gernot
 
G

Gernot Frisch

void foo(std::vector<GFFront2D::SECTION>& sections);

void foo(std::vector<SECTION>& sections);
worked...
 
B

Ben

Gernot said:
void foo(std::vector<SECTION>& sections);
worked...

I'm not sure if this answers your question, but if "GFFront2d()" is
meant to be your c-tor function then you need to have the same name as
your class (upercase D) "GFFront2D()"

Also, you only have the c-tor header, so if you use the class then you
need to implement it.

I changed your code to:

#include <vector>
class GFFront2D
{
public:
struct NODE
{
double x, y;
double val;
};
struct SECTION
{
NODE pos;
int nreg_before;
};
public:
GFFront2D();
int IntersectRegionsWithLine(const NODE n[2],
std::vector<GFFront2D::SECTION>& sections);
};

GFFront2D::GFFront2D()
{
}


int main()
{
GFFront2D *abc;
abc = new GFFront2D;
}


This compiles just fine with MS Visual C++ 2003.

-Benjamin Dacko
 
A

Andrey Tarasevich

Gernot said:
class GFFront2D
{
public:
std::vector<GFFront2D::SECTION>& sections);
};


yields a C2027 (use of undefined type "GFFront2D")

Can you help me out?

This VC6 crap gives me the super-creeps. I hate it, hate it, hate
it... Unfortunately I have to use it for this project.

Firstly, your code contains a meaningless closing brace. Secondly, your
code refers to an undeclared nested name 'GFFront2D::SECTION'. That
would be OK in a member function definition, but is an error in a data
member definition.

This code has a good potential to run into a "VC6 crap", but at this the
crap is entirely yours, not VC6's.
 
G

Gernot Frisch

Andrey Tarasevich said:
Firstly, your code contains a meaningless closing brace. Secondly,
your
code refers to an undeclared nested name 'GFFront2D::SECTION'. That
would be OK in a member function definition, but is an error in a
data
member definition.

This code has a good potential to run into a "VC6 crap", but at this
the
crap is entirely yours, not VC6's.

Yes, sorry. The poblem was:

class A
{
struct A::B // Error
{};
};

I had to write "B" instead of "A::B", which was perfectly OK with
VC.net 7.1.
Anyway, thank you very much,
Gernot
 

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
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top