473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Vector trouble from within class

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
5 1874
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
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
Oh! What free compiler would you recommend?

Thanks very much for your help,

Barry.

Jun 26 '06 #4
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Drew | last post by:
Hello: I am having trouble getting a vector of a class to work from another class //******************** class CaClass{ int idata; CaClass(){idata =1;}
18
by: John Black | last post by:
Hi, I am not familiar with for_each very well, suppoase I have a vector<pair<unsigned int, unsigned int> > vec1 and the contents are {<0x00000000, 0x000000FF>, <0x10000000, 0x2FFFFFFF>} what...
16
by: Honestmath | last post by:
Hi, I added the following line to my code within a class declaration: std::vector<Date> m_duedates(100); I also tried: std::vector<Date> m_duedates(100, Date());
17
by: Michael Hopkins | last post by:
Hi all I want to create a std::vector that goes from 1 to n instead of 0 to n-1. The only change this will have is in loops and when the vector returns positions of elements etc. I am calling...
2
by: eric | last post by:
i need a class whose interface allows the class to be interrogated at runtime by a client with no prior knowledge of the implementation. i've accomplished this with an abstract base class Object...
5
by: cayblood | last post by:
Hello, I have a vector of pointers to a class, like so: vector<Node*> m_parents; I'm having trouble creating an iterator to go through the elements in this vector. Here is my syntax: ...
32
by: zl2k | last post by:
hi, c++ user Suppose I constructed a large array and put it in the std::vector in a function and now I want to return it back to where the function is called. I can do like this: ...
9
by: aaragon | last post by:
I am trying to create a vector of type T and everything goes fine until I try to iterate over it. For some reason, the compiler gives me an error when I declare std::vector<T>::iterator iter;...
5
by: Alan | last post by:
I was wondering whether it is good programming practice or asking for trouble to modify a vector while iterating through it. That is, I want to do something like the following pseudocode in C++: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.