By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,004 Members | 2,304 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,004 IT Pros & Developers. It's quick & easy.

Vector trouble from within class

P: n/a
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.

Jun 26 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
bg***@yahoo.com wrote:
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
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 26 '06 #2

P: n/a
Oh! What free compiler would you recommend?

Thanks very much for your help,

Barry.
Victor Bazarov wrote:
bg***@yahoo.com wrote:
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
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


Jun 26 '06 #3

P: n/a
Oh! What free compiler would you recommend?

Thanks very much for your help,

Barry.

Jun 26 '06 #4

P: n/a
bg***@yahoo.com wrote:
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
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 26 '06 #5

P: n/a
b...@yahoo.com wrote:
Oh! What free compiler would you recommend?


Please quote the message you are responding to so all can follow the
conversation. In answer to your question, see this FAQ:

http://www.parashift.com/c++-faq-lit....html#faq-38.1

Cheers! --M

Jun 26 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.