Questions tagged [undeclared-identifier]
257 questions
68
votes
13 answers
What is an 'undeclared identifier' error and how do I fix it?
What are undeclared identifier errors? What are common causes and how do I fix them?
Example error texts:
For the Visual Studio compiler: error C2065: 'cout' : undeclared identifier
For the GCC compiler: 'cout' undeclared (first use in this…

sashoalm
- 75,001
- 122
- 434
- 781
38
votes
1 answer
error: 'uint16_t' undeclared?
I have the code
#include
#include
void print128_num(__m128i var)
{
uint16_t *val = (uint16_t*) &var;
printf("Numerical: %i %i %i %i %i %i %i %i \n",
val[0], val[1], val[2], val[3], val[4], val[5],
…

pandoragami
- 5,387
- 15
- 68
- 116
21
votes
2 answers
Use of undeclared identifier: ASIdentifierManager
I am using the following code to show the unique identifier to be used for admob test apps.
This is with my applicationDidFinishLaunching...
// Print IDFA (from AdSupport Framework) for iOS 6 and UDID for iOS < 6.
if…

StuartM
- 6,743
- 18
- 84
- 160
9
votes
3 answers
How to check if a variable is undefined versus it is undeclared in javascript?
I know that to find if a variable is undeclared in javascript, I can use if (typeof variable === 'undefined'). If I declare a variable as undefined (var variable = undefined), the if statement still returns true. Is it possible, in JavaScript, to…

Nathan Chu
- 635
- 1
- 3
- 19
9
votes
3 answers
glutInitContextVersion() is missing from glut library
I am practicing some opengl code, how ever when i want to force the opengl context to use a certain version of opengl through glutInitContextVersion() it fails compilation process and gives this message:-
use of undeclared identifier…

BulBul
- 1,159
- 3
- 24
- 37
9
votes
3 answers
"undeclared identifier" is actually declared
I've been getting error C2065s for variables that I've declared in the class header file as public data members, one int and one pointer to that int. The lines of code being flagged as erroneous are only when I use these variables in a function -…

Mareth
- 93
- 1
- 1
- 3
8
votes
2 answers
Error: Undeclared identifier: 'OutputDebugString'
I use OutputDebugString in my Delphi Code, but I receive the error:
Error: Undeclared identifier: 'OutputDebugString'
Which package is this OutputDebugString in?

spspli
- 3,128
- 11
- 48
- 75
8
votes
1 answer
error: use of undeclared identifier 'std' c++
I am new to coding in C++ and I want to make a simple Pokemon game.
I created a class in a header file and I am defining the functions in a separate .cpp file.
I also have a main file where I will run my actual code.
So I am defining a std::string…

SahithiumZ
- 81
- 1
- 1
- 2
8
votes
4 answers
Precompiled Header with Constants issue
I have a few constants files "Constants.h" in my project that I am including in the Prefix.pch file to be available to all the classes in my project. They just contain a bunch of #define statements.
My classes don't recognize these constants (no…

TTillage
- 1,886
- 2
- 12
- 10
6
votes
0 answers
'Use of undeclared identifier' error using Clang in a C++ project
I am using Clang as a syntax checker in my C++ project. It's called through Flycheck in Emacs, and I am getting an annoying use of undeclared identifier error, the following Minimal Working Example to illustrates the problem:
In file…

mkm
- 673
- 5
- 21
4
votes
1 answer
Why is "using" seemingly rejected in one function, but okay in another?
With this code:
Protected Function GetArgValsForCompanyName(coName As String) As String()
Dim args(2) As String
Using con As New SqlConnection("SERVER=PLATYPUS42;DATABASE=duckbilldata;UID=durante;PWD=pondscum"),
cmd As New…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862
3
votes
2 answers
Delphi "IdHTTP.Request.Range" propertie: undeclared identifier
I was looking for some tutorials/source codes to resume paused/aborted downloads.
I found a source code, but I'm getting this error:
procedure TForm1.Download(url, pathLocal : String);
var
eFile : TFileStream;
IdHTTP : TIdHTTP;
begin
…

paulohr
- 576
- 1
- 9
- 24
3
votes
3 answers
C++ undeclared identifier
I want to create a sea battle game. I have two classes: Ship and Cell.
#pragma once
#include"stdafx.h"
#include"Globals.h"
#include
#include"MCell.h"
class Ship
{
private:
int lenght;
int oriantation;
vector… |

Ostap Maliuvanchuk
- 1,125
- 2
- 12
- 32
3
votes
3 answers
C++ beginner's coding mistake: "Undeclared identifier"?
I'm to use C++ for a very small part of my project. I must be coding something wrong, but my knowledge of C++ is what it is and I can't get around this...
See both the AbstractContactListener.h and .mm files below. The problem is in…

Jem
- 6,226
- 14
- 56
- 74
3
votes
2 answers
How to check if a variable has been declared even if it hasn't been defined?
This question:
JavaScript check if variable exists (is defined/initialized)
does not regard the case of variables which have been declared but not defined (as opposed to undeclared and undefined). Specifically, if I want to check whether x has been…

Muhammad Umer
- 17,263
- 19
- 97
- 168