473,670 Members | 2,405 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dev C++ compile problem

Here is the error, and the program run no problem in VC++;
Compiler: Default compiler
Building Makefile: "H:\CS2332\Summ er\STL001\Makef ile.win"
Executing make...
make.exe -f "H:\CS2332\Summ er\STL001\Makef ile.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>::conta ins(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,s td::allocator<_ CharT::const_it erator' is parsed as a
non-type, but instantiation yields a type

R03_stack.cpp.h :131: note: say `typename
std::vector<T,s td::allocator<_ CharT::const_it erator' if a type is
meant
R03_stack.cpp.h : In member function `bool Stack<T>::conta ins(const T&)
const [with T = int]':
R03_stackDriver .cpp:83: instantiated from here
R03_stack.cpp.h :116: error: dependent-name `
std::vector<T,s td::allocator<_ CharT::const_it erator' is parsed as a
non-type, but instantiation yields a type
R03_stack.cpp.h :116: note: say `typename
std::vector<T,s td::allocator<_ CharT::const_it erator' 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 2137
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\Summ er\STL001\Makef ile.win"
Executing make...
make.exe -f "H:\CS2332\Summ er\STL001\Makef ile.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>::conta ins(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,s td::allocator<_ CharT::const_it erator' is parsed as a
non-type, but instantiation yields a type

R03_stack.cpp.h :131: note: say `typename
std::vector<T,s td::allocator<_ CharT::const_it erator' if a type is
meant
R03_stack.cpp.h : In member function `bool Stack<T>::conta ins(const T&)
const [with T = int]':
R03_stackDriver .cpp:83: instantiated from here
R03_stack.cpp.h :116: error: dependent-name `
std::vector<T,s td::allocator<_ CharT::const_it erator' is parsed as a
non-type, but instantiation yields a type
R03_stack.cpp.h :116: note: say `typename
std::vector<T,s td::allocator<_ CharT::const_it erator' 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
2810
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 object, it is encoded in utf-8 automatically. It can be a problem when I'm building an interactive environment using "compile", with a different encoding from utf-8. IDLE itself has the same problem. ( '<a string with non-ascii-encoding>' is...
5
3326
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 rightType;
5
3808
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 ) Person.xsd includes Common-Naming.xsd ( anonimous schemas ) Common-Naming.xsd includes common.xsd ( both are anonimous schemas ) Compilation of Resident.xsd raise the following exception: "System.Xml.Schema.XmlSchemaException: The attribute 'oid'...
10
4450
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 Enterplise Linux 3 ES, and applied FixPack fp5_mi00069.tar to it. After creating an instance, starting the database, creating a database, and entering the table definitions, all of which seems to work OK, I entered a tiny 8-row table and can do...
9
3759
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 IF; END IF; ". Expected tokens may include: "END". LINE NUMBER=1285. SQLSTATE=42601 I tried creating a new tablespace + buffer pool on this database but still
10
4775
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 structures are read only) Ideally one should be able to put the redundant information there automatically so no mistakes are possible, but in a lot of case I see no way how to do it.
10
19708
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 have a struct that contains several different types of data. This struct is used throuout the program. Now, when I compile, I get 6 errors, all of them "Use of possibly unassigned field 'awayTime'" or "Use of possibly unassigned field 'intlTime'"....
6
2848
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 fine while the file was in the project directory. When the obsolete file was removed from the project directory, my application will no longer compile. Can someone please help with this issue? Thank in advance, Tom
6
2652
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 everytime I change a page on the production server I need to restart IIS to effect the change. If I don't restart IIS, it tries to recompile but gets and error ( 'cannot execute a program......vbc.exe......). Am I missing something which allows...
0
2030
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 compile his file .cpp (vidcap.cpp). Thereafter, the idea is to be able to modify the code to include my own modifications.
0
8384
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8813
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8659
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7412
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6212
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4388
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2799
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2037
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.