473,395 Members | 1,440 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,395 software developers and data experts.

Dev C++ compile problem

Here is the error, and the program run no problem in VC++;
Compiler: Default compiler
Building Makefile: "H:\CS2332\Summer\STL001\Makefile.win"
Executing make...
make.exe -f "H:\CS2332\Summer\STL001\Makefile.win" all
g++.exe -c R03_stackDriver.cpp -o R03_stackDriver.o -I"C:/Dev-Cpp/lib/
gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward"
-I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/
3.4.2" -I"C:/Dev-Cpp/include"

In file included from R03_stackDriver.cpp:2:
R03_stack.h:105: error: declaration of `class T'

R03_stack.h:19: error: shadows template parm `class T'
In file included from R03_stack.h:115,
from R03_stackDriver.cpp:2:
R03_stack.cpp.h: In member function `bool Stack<T>::contains(const T&)
const':
R03_stack.cpp.h:116: error: expected `;' before "p"
R03_stack.cpp.h:117: error: `p' undeclared (first use this function)
R03_stack.cpp.h:117: error: (Each undeclared identifier is reported
only once for each function it appears in.)
R03_stack.cpp.h: In member function `unsigned int
Stack<T>::count(const T&) const':

R03_stack.cpp.h:131: error: expected `;' before "p"
R03_stack.cpp.h:132: error: `p' undeclared (first use this function)
R03_stack.cpp.h: In member function `unsigned int
Stack<T>::count(const T&) const [with T = int]':
R03_stackDriver.cpp:75: instantiated from here
R03_stack.cpp.h:131: error: dependent-name `
std::vector<T,std::allocator<_CharT::const_iterato r' is parsed as a
non-type, but instantiation yields a type

R03_stack.cpp.h:131: note: say `typename
std::vector<T,std::allocator<_CharT::const_iterato r' if a type is
meant
R03_stack.cpp.h: In member function `bool Stack<T>::contains(const T&)
const [with T = int]':
R03_stackDriver.cpp:83: instantiated from here
R03_stack.cpp.h:116: error: dependent-name `
std::vector<T,std::allocator<_CharT::const_iterato r' is parsed as a
non-type, but instantiation yields a type
R03_stack.cpp.h:116: note: say `typename
std::vector<T,std::allocator<_CharT::const_iterato r' if a type is
meant

make.exe: *** [R03_stackDriver.o] Error 1

Execution terminated

Some of the code(the Dev C++ says there are errors),

/**
* @brief display the whole stack
*/
template <class T>
friend ostream& operator << (ostream& outStream, const Stack<T>&
out);

How can I fix the problems? Thanks!
Jul 2 '08 #1
2 2123
On Jul 2, 11:06 am, SamuelXiao <foolsmart2...@gmail.comwrote:
Here is the error, and the program run no problem in VC++;
Compiler: Default compiler
Building Makefile: "H:\CS2332\Summer\STL001\Makefile.win"
Executing make...
make.exe -f "H:\CS2332\Summer\STL001\Makefile.win" all
g++.exe -c R03_stackDriver.cpp -o R03_stackDriver.o -I"C:/Dev-Cpp/lib/
gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward"
-I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/
3.4.2" -I"C:/Dev-Cpp/include"

In file included from R03_stackDriver.cpp:2:
R03_stack.h:105: error: declaration of `class T'

R03_stack.h:19: error: shadows template parm `class T'
In file included from R03_stack.h:115,
from R03_stackDriver.cpp:2:
R03_stack.cpp.h: In member function `bool Stack<T>::contains(const T&)
const':
R03_stack.cpp.h:116: error: expected `;' before "p"
R03_stack.cpp.h:117: error: `p' undeclared (first use this function)
R03_stack.cpp.h:117: error: (Each undeclared identifier is reported
only once for each function it appears in.)
R03_stack.cpp.h: In member function `unsigned int
Stack<T>::count(const T&) const':

R03_stack.cpp.h:131: error: expected `;' before "p"
R03_stack.cpp.h:132: error: `p' undeclared (first use this function)
R03_stack.cpp.h: In member function `unsigned int
Stack<T>::count(const T&) const [with T = int]':
R03_stackDriver.cpp:75: instantiated from here
R03_stack.cpp.h:131: error: dependent-name `
std::vector<T,std::allocator<_CharT::const_iterato r' is parsed as a
non-type, but instantiation yields a type

R03_stack.cpp.h:131: note: say `typename
std::vector<T,std::allocator<_CharT::const_iterato r' if a type is
meant
R03_stack.cpp.h: In member function `bool Stack<T>::contains(const T&)
const [with T = int]':
R03_stackDriver.cpp:83: instantiated from here
R03_stack.cpp.h:116: error: dependent-name `
std::vector<T,std::allocator<_CharT::const_iterato r' is parsed as a
non-type, but instantiation yields a type
R03_stack.cpp.h:116: note: say `typename
std::vector<T,std::allocator<_CharT::const_iterato r' if a type is
meant

make.exe: *** [R03_stackDriver.o] Error 1

Execution terminated

Some of the code(the Dev C++ says there are errors),

/**
* @brief display the whole stack
*/
template <class T>
friend ostream& operator << (ostream& outStream, const Stack<T>&
out);

How can I fix the problems? Thanks!
Hello,

I believe you should provide minimal code that reproduces the error.

Regards.
Jul 2 '08 #2
On Wed, 02 Jul 2008 02:06:32 -0700, SamuelXiao wrote:
Here is the error,
[...]

Please read:

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

Thanks,

--
Lionel B
Jul 2 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: janeaustine50 | last post by:
Python's InteractiveInterpreter uses the built-in compile function. According to the ref. manual, it doesn't seem to concern about the encoding of the source string. When I hand in an unicode...
5
by: Carmine Cairo | last post by:
Hi, I'm working on a project and today I've note a little problem during the compile fase. Here a little piece of code: // 1st version welldone = 0; size = p->getSize(); backbone = new...
5
by: Brice Prunier | last post by:
Here under 4 schemas i'm working with ( it may be long: sorry...) The context is the following : Resident.xsd imports Person.xsd and includes Common.xsd ( anonimous schema: no TargetNamespace )...
10
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat...
9
by: serge | last post by:
I have a stored procedure that is over 1000 + lines of code. When i try to compile I get the following error: ABC.TEST123: 1285: SQL0104N An unexpected token "END" was found following " END...
10
by: Bart Goeman | last post by:
Hi, I have a question about how to put redundant information in data structures, initialized at compile time. This is often necessary for performance reasons and can't be done at run time (data...
10
by: Chris LaJoie | last post by:
Our company has been developing a program in C# for some time now, and we haven't had any problems with it, but just last night something cropped up that has me, and everyone else, stumped. I...
6
by: Thomas Connolly | last post by:
I have 2 pages referencing the same codebehind file in my project. Originally the pages referenced separate code behind files. Once I changed the reference to the same file, everything worked...
6
by: Tom | last post by:
I am developing my pages on my development machine and then copying to the production server. I am not pre-compiling, I am using the 'dynamic compile' feature. This is working fine except that...
0
by: Jérôme Le Bougeant | last post by:
Hello (and sorry for my English), I downloaded the VideoCapture module on the http://videocapture.sourceforge.net/ site. I tested it with a webcam and that functions. Now I want to...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.