Vector trouble from within class

B

bg_ie

Hi all,

I'm trying to use the following kit -

http://ccrma.stanford.edu/software/stk/

but I'm having trouble building the code. I've tried isolating the
problem by deleting code and removing files from the project and here's
what I was left with -

voicer1.h -

#ifndef STK_VOICER_H
#define STK_VOICER_H

#include <vector>

class Voicer
{
public:
struct Voice
{
Voice();
};

std::vector<Voice> voices_;
};

#endif

Voicer1.cpp -

#include "Voicer1.h"

// nothing else

These are the only files left in my project and when I compile
voicer1.cpp this is what I get -

Voicer1.cpp
C:\Program Files\DevStudio\VC\INCLUDE\vector(103) : error C2065:
'Voice' : undeclared identifier
C:\Program Files\DevStudio\VC\INCLUDE\vector(103) : error C2440:
'default argument' : cannot convert from 'int' to 'const struct
Voicer::Voice &'

Reason: cannot convert from 'int' to 'const struct Voicer::Voice'
No
constructor could take the source type, or constructor overload
resolution was ambiguous
Error executing cl.exe.

I'm using Microsoft Developer Studio 97. Can anyone tell me what the
problem is. The errors above isa the same ('Voice' : undeclared) as
those I got before I started deleting code from voicer1.cpp and
voicer.h.

Thanks for your help,

Barry.
 
V

Victor Bazarov

I'm trying to use the following kit -
[...]

These are the only files left in my project and when I compile
voicer1.cpp this is what I get -

Voicer1.cpp
C:\Program Files\DevStudio\VC\INCLUDE\vector(103) : error C2065:
'Voice' : undeclared identifier
C:\Program Files\DevStudio\VC\INCLUDE\vector(103) : error C2440:
'default argument' : cannot convert from 'int' to 'const struct
Voicer::Voice &'

Reason: cannot convert from 'int' to 'const struct Voicer::Voice'
No
constructor could take the source type, or constructor overload
resolution was ambiguous
Error executing cl.exe.

I'm using Microsoft Developer Studio 97. Can anyone tell me what the
problem is. [...]

That's the problem. Right there. Stop using such an old compiler.

V
 
B

bg_ie

Oh! What free compiler would you recommend?

Thanks very much for your help,

Barry.


Victor said:
I'm trying to use the following kit -
[...]

These are the only files left in my project and when I compile
voicer1.cpp this is what I get -

Voicer1.cpp
C:\Program Files\DevStudio\VC\INCLUDE\vector(103) : error C2065:
'Voice' : undeclared identifier
C:\Program Files\DevStudio\VC\INCLUDE\vector(103) : error C2440:
'default argument' : cannot convert from 'int' to 'const struct
Voicer::Voice &'

Reason: cannot convert from 'int' to 'const struct Voicer::Voice'
No
constructor could take the source type, or constructor overload
resolution was ambiguous
Error executing cl.exe.

I'm using Microsoft Developer Studio 97. Can anyone tell me what the
problem is. [...]

That's the problem. Right there. Stop using such an old compiler.

V
 
V

Victor Bazarov

Oh! What free compiler would you recommend?

Try Microsoft Visual Studio 2005 Express Edition. There is plenty
of others, just google for 'free C++ compiler'.

V
 

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,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top