Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming

Reply
 
LinkBack Thread Tools
Old 09-22-07   #1 (permalink)
PC Gamer
 
coltsrock's Avatar
 
intel ati

Join Date: Apr 2006
Location: Neeeeebraska
Posts: 3,518

Rep: 109 coltsrock is acknowledged by manycoltsrock is acknowledged by many
Unique Rep: 90
Folding Team Rank: 751
Trader Rating: 0
Default What does "Undeclared Identifier" mean?

I keep getting this error in Visual Studios 05 when i try to edit SodaDMTGuys speed converter, I am trying to change it to a length (english/metric converter) and if i edit the line:
cin >> c2d;
cout << "Comparable AMD Athlon (64/X2/FX) speed is: " << c2d * 1.3333333333333333333333 << endl;

to:
cin >> mile;
cout << "Comparable AMD Athlon (64/X2/FX) speed is: " << mile * 1.3333333333333333333333 << endl;


It says that Mile is an undeclared identifier so what do i do to it?
__________________

System: ^The Man \/ The legend
CPU
E8400 Q815A182 @4.104
Motherboard
Asus P5E
Memory
G.Skill 4GBPQ 1000
Graphics Card
VisionTek 4870
Hard Drive
WD Raptor XXX
Sound Card
X-Fi Xtremegamer Fatal1ty
Power Supply
Corsair 750TX
Case
Antec P180
CPU cooling
Xigmatek HDT-S1283 + MX2 TIM
GPU cooling
Stock+30% Fan
OS
Vista Home Premium x64
Monitor
Samsung T240 24'
coltsrock is offline I fold for Overclock.net coltsrock's Gallery   Reply With Quote
Old 09-22-07   #2 (permalink)
Programmer
 
amd nvidia

Join Date: Jul 2007
Location: New Jersey
Posts: 233

Rep: 22 sherlok is acknowledged by some
Unique Rep: 22
Trader Rating: 0
Default

Quote:
Originally Posted by coltsrock View Post
I keep getting this error in Visual Studios 05 when i try to edit SodaDMTGuys speed converter, I am trying to change it to a length (english/metric converter) and if i edit the line:
cin >> c2d;
cout << "Comparable AMD Athlon (64/X2/FX) speed is: " << c2d * 1.3333333333333333333333 << endl;

to:
cin >> mile;
cout << "Comparable AMD Athlon (64/X2/FX) speed is: " << mile * 1.3333333333333333333333 << endl;


It says that Mile is an undeclared identifier so what do i do to it?
I'm assuming it compiled when it said c2d?

You probably didn't initialize mile, ie before you can store whatever input the user enters in the variable mile you have to tell the computer your using it.

Something like

float mile; or double mile;

unless you did that?
__________________
System: R.I.P. My Girl -new build otw
CPU
XP2500-M @ 2.2
Motherboard
Asus A7N8X-X
Memory
1Gig Twin Crucial
Graphics Card
XFX 7600GT
Hard Drive
80Gig DeskStar
Sound Card
Onboard :)
Power Supply
Garbage 500W
CPU cooling
TT Volcano 7
OS
XP
Monitor
17" TFT
sherlok is offline   Reply With Quote
Old 09-22-07   #3 (permalink)
Photography nut
 
dangerousHobo's Avatar
 
amd nvidia

Join Date: Dec 2005
Location: ~/
Posts: 3,484

FAQs Submitted: 7
Folding Team Rank: 451
Trader Rating: 0
Default

Some where theres probaby a line that says
int c2d;
or
double c2d;

you just need to change that or add
int mile;
or
double mile;


The error message means you never declared what type of scalar mile is.

Quote:
Originally Posted by sherlok View Post
You probably didn't initialize mile, ie before you can store whatever input the user enters in the variable mile you have to tell the computer your using it.
I don't think its an initialization problems since it says unknown identifier, I think he just never declared "mile" before he tried to use it.
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn

Try out the latest Programming Challenge
Quote:
Originally Posted by Melcar
Only one reasonable way to solve this... a dance off.

CPU-Z Validation
@ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15


Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More

System: Anomaly
CPU
Athlon 3700 SD(KACAE)0546 @3.02ghz
Motherboard
DFI UT nF4 Ultra-D
Memory
G.Skill 2x512 UTT(BH-5)
Graphics Card
evga 6800gs
Hard Drive
Maxtor 300GB + WD 250GB
Sound Card
onboard
Power Supply
Ultra 500w V-series
Case
one from Ultra
CPU cooling
Big Typhoon
GPU cooling
80mm fan mounted on
OS
Arch64 & Slackware 12.1
Monitor
Acer AL2216W 22" WS LCD

Last edited by dangerousHobo : 09-22-07 at 11:29 PM.
dangerousHobo is offline I fold for Overclock.net Overclocked Account dangerousHobo's Gallery   Reply With Quote
Old 09-22-07   #4 (permalink)
PC Gamer
 
coltsrock's Avatar
 
intel ati

Join Date: Apr 2006
Location: Neeeeebraska
Posts: 3,518

Rep: 109 coltsrock is acknowledged by manycoltsrock is acknowledged by many
Unique Rep: 90
Folding Team Rank: 751
Trader Rating: 0
Default

no, I just edited the compiled program, so i figured it would work if I just changed the variables/words, ill try doing what you said
EDIT: ^Gotcha
__________________

System: ^The Man \/ The legend
CPU
E8400 Q815A182 @4.104
Motherboard
Asus P5E
Memory
G.Skill 4GBPQ 1000
Graphics Card
VisionTek 4870
Hard Drive
WD Raptor XXX
Sound Card
X-Fi Xtremegamer Fatal1ty
Power Supply
Corsair 750TX
Case
Antec P180
CPU cooling
Xigmatek HDT-S1283 + MX2 TIM
GPU cooling
Stock+30% Fan
OS
Vista Home Premium x64
Monitor
Samsung T240 24'
coltsrock is offline I fold for Overclock.net coltsrock's Gallery   Reply With Quote
Old 09-22-07   #5 (permalink)
Programmer
 
amd nvidia

Join Date: Jul 2007
Location: New Jersey
Posts: 233

Rep: 22 sherlok is acknowledged by some
Unique Rep: 22
Trader Rating: 0
Default

yea you can't jsut edit single parts, if you change a variable name in one place you have to search the entire program to change all isntances of it. The program needs to know what kind of variable it is so it can allocate the right space for it and so it knows what 'things' you can do to it and what you can't.
__________________
System: R.I.P. My Girl -new build otw
CPU
XP2500-M @ 2.2
Motherboard
Asus A7N8X-X
Memory
1Gig Twin Crucial
Graphics Card
XFX 7600GT
Hard Drive
80Gig DeskStar
Sound Card
Onboard :)
Power Supply
Garbage 500W
CPU cooling
TT Volcano 7
OS
XP
Monitor
17" TFT
sherlok is offline   Reply With Quote
Old 09-22-07   #6 (permalink)
PC Gamer
 
coltsrock's Avatar
 
intel ati

Join Date: Apr 2006
Location: Neeeeebraska
Posts: 3,518

Rep: 109 coltsrock is acknowledged by manycoltsrock is acknowledged by many
Unique Rep: 90
Folding Team Rank: 751
Trader Rating: 0
Default

Alright I will look for all instances of it
EDIT: DUH forgot to change the beginning variables

EDIT: what does this mean:
c:\documents and settings\user\my documents\visual studio 2005\projects\speed coverter\speed coverter\file.cpp(52) : error C2563: mismatch in formal parameter list
c:\documents and settings\user\my documents\visual studio 2005\projects\speed coverter\speed coverter\file.cpp(52) : error C2568: '<<' : unable to resolve function overload
c:\program files\microsoft visual studio 8\vc\include\ostream(971): could be 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
with
[
_Elem=wchar_t,
_Traits=std::char_traits<wchar_t>
]
c:\program files\microsoft visual studio 8\vc\include\ostream(963): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\program files\microsoft visual studio 8\vc\include\ostream(937): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
c:\documents and settings\user\my documents\visual studio 2005\projects\speed coverter\speed coverter\file.cpp(64) : error C2563: mismatch in formal parameter list
c:\documents and settings\user\my documents\visual studio 2005\projects\speed coverter\speed coverter\file.cpp(64) : error C2568: '<<' : unable to resolve function overload
c:\program files\microsoft visual studio 8\vc\include\ostream(971): could be 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
with
[
_Elem=wchar_t,
_Traits=std::char_traits<wchar_t>
]
c:\program files\microsoft visual studio 8\vc\include\ostream(963): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\program files\microsoft visual studio 8\vc\include\ostream(937): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
Build log was saved at "file://c:\Documents and Settings\User\My Documents\Visual Studio 2005\Projects\speed coverter\speed coverter\Debug\BuildLog.htm"
__________________

System: ^The Man \/ The legend
CPU
E8400 Q815A182 @4.104
Motherboard
Asus P5E
Memory
G.Skill 4GBPQ 1000
Graphics Card
VisionTek 4870
Hard Drive
WD Raptor XXX
Sound Card
X-Fi Xtremegamer Fatal1ty
Power Supply
Corsair 750TX
Case
Antec P180
CPU cooling
Xigmatek HDT-S1283 + MX2 TIM
GPU cooling
Stock+30% Fan
OS
Vista Home Premium x64
Monitor
Samsung T240 24'

Last edited by coltsrock : 09-22-07 at 11:47 PM.
coltsrock is offline I fold for Overclock.net coltsrock's Gallery   Reply With Quote
Old 09-23-07   #7 (permalink)
PC Gamer
 
coltsrock's Avatar
 
intel ati

Join Date: Apr 2006
Location: Neeeeebraska
Posts: 3,518

Rep: 109 coltsrock is acknowledged by manycoltsrock is acknowledged by many
Unique Rep: 90
Folding Team Rank: 751
Trader Rating: 0
Default

any ideas guys? I Tried changing th beginning variables, and every instance and got that^ error
__________________

System: ^The Man \/ The legend
CPU
E8400 Q815A182 @4.104
Motherboard
Asus P5E
Memory
G.Skill 4GBPQ 1000
Graphics Card
VisionTek 4870
Hard Drive
WD Raptor XXX
Sound Card
X-Fi Xtremegamer Fatal1ty
Power Supply
Corsair 750TX
Case
Antec P180
CPU cooling
Xigmatek HDT-S1283 + MX2 TIM
GPU cooling
Stock+30% Fan
OS
Vista Home Premium x64
Monitor
Samsung T240 24'
coltsrock is offline I fold for Overclock.net coltsrock's Gallery   Reply With Quote
Old 09-23-07   #8 (permalink)
Programmer
 
kdbolt70's Avatar
 
intel ati

Join Date: May 2007
Location: Walled Lake, MI
Posts: 1,119

Rep: 127 kdbolt70 is acknowledged by manykdbolt70 is acknowledged by many
Unique Rep: 92
Folding Team Rank: 284
Trader Rating: 1
Default

eesh, those are some strange error messages, it'd be easier if you posted up your code so we could see what was happening. You don't even need to replace c2d with mile in every case, as long as you declare mile.

Code:
double mile;
cin >> mile;
cout << "Comparable AMD Athlon (64/X2/FX) speed is: " << mile * 1.3333333333333333333333 << endl;
Also, are you including

#include <iostream>

at the top of your file?
__________________

~M Hail to the Victors M~

System: It's about time!
CPU
Q6600 G0 @3.3Ghz
Motherboard
Gigabyte P35-DS3L
Memory
2Gb Ballistix DDR2 800 @915Mhz
Graphics Card
Sapphire 2900Pro Flashed to XT
Hard Drive
Seagate Barracuda 320Gb
Sound Card
Onboard
Power Supply
Corsair HX 620W
Case
CM 690
CPU cooling
Tuniq Tower 120
GPU cooling
stock
OS
Vista Business and VMWare Ubuntu
Monitor
Acer AL2223W 22"
kdbolt70 is offline I fold for Overclock.net   Reply With Quote
Old 09-23-07   #9 (permalink)
PC Gamer
 
coltsrock's Avatar
 
intel ati

Join Date: Apr 2006
Location: Neeeeebraska
Posts: 3,518

Rep: 109 coltsrock is acknowledged by manycoltsrock is acknowledged by many
Unique Rep: 90
Folding Team Rank: 751
Trader Rating: 0
Default

well i got it to work, i think it was that i was using commas to write 5280 so now its fine
__________________

System: ^The Man \/ The legend
CPU
E8400 Q815A182 @4.104
Motherboard
Asus P5E
Memory
G.Skill 4GBPQ 1000
Graphics Card
VisionTek 4870
Hard Drive
WD Raptor XXX
Sound Card
X-Fi Xtremegamer Fatal1ty
Power Supply
Corsair 750TX
Case
Antec P180
CPU cooling
Xigmatek HDT-S1283 + MX2 TIM
GPU cooling
Stock+30% Fan
OS
Vista Home Premium x64
Monitor
Samsung T240 24'
coltsrock is offline I fold for Overclock.net coltsrock's Gallery   Reply With Quote
Old 09-23-07   #10 (permalink)
Born to ROCK!
 
The_Rocker's Avatar
 
intel nvidia

Join Date: Jul 2007
Location: England
Posts: 6,166

Rep: 351 The_Rocker is a proven memberThe_Rocker is a proven memberThe_Rocker is a proven memberThe_Rocker is a proven member
Unique Rep: 238
Hardware Reviews: 6
Trader Rating: 1
Default

You didn't declare mile.
__________________
..::The_Rocker's Hardware History::..
Q6600 B3 @ 3.2 | Q6600 B3 @ 3.6 | Q6700 G0 @ 3.6 | E8600 @ 4.33
ASUS P5N32-E SLI 680i | eVGA 680i A1 | eVGA 780i A1
XFX 7600GT XXX | BFG 8800GTX OC2 | PoV 8800GTS 512 | SLI Gainward 8800GTX's | SLI eVGA 9800GTX SC's
SLI Zotac GTX280 AMP's | SLI XFX GTX280's


..::Coming Soon::..
Intel QX9650 Quad Extreme (Arrived)
eVGA 790i FTW
2 x 2GB G.Skill HZ 1600Mhz DDR3


System: -=The DiSeMbOwLeR v1.9=-
CPU
QX9650 @ (OVERCLOCKING IN PROGRESS)
Motherboard
eVGA 780i A1 (P07 BIOS - V Droop modded)
Memory
2 x 2GB G.Skill PK @ 1066Mhz 5-5-5-15 2T
Graphics Card
2 x XFX GTX280's in SLI
Hard Drive
3 x WD 640GB AALS RAID 0 & 2 x WD 500GB AAKS
Sound Card
Auzentech X-Fi Prelude (Optical DTS> Z-5500's)
Power Supply
Tagan 900w BZ Modular Piperock (Turbo Mode)
Case
Antec 1200 Ultimate Gamers case
CPU cooling
Lapped TRUE 120 & OCZ 120mm Fan
GPU cooling
Nvidia GTX280 Reference coolers.
OS
Vista Ultimate x64 SP1
Monitor
20" Samsung Syncmaster 2032BW (1680 * 1050)
The_Rocker is offline Overclocked Account   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -4. The time now is 02:40 AM.


Overclock.net is a Carbon Neutral Site Creative Commons License Internet Security By ControlScan

Terms of Service / Forum Rules | Privacy Policy | Advertising | Become an Official Vendor
Copyright © 2008 Shogun Interactive Development. Most rights reserved.
Page generated in 0.32766 seconds with 8 queries