Identifier not found when it is.... what?

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
corey__cakes
ES Beta Backer
ES Beta Backer
Posts: 23
Joined: Mon Dec 23, 2013 7:56 pm
Current Project: Canadian Simulator 2017
Favorite Gaming Platforms: GBA, DC, iOS, SNES, WS, 360, N64
Programming Language of Choice: C++, Lua
Location: Your VCR.

Identifier not found when it is.... what?

Post by corey__cakes »

I am making a level editor with C++ and SDL. In this program, I have function called CreateTexture() that returns a texture with the dimensions specified in what I pass through the parameters. This function is declared in a header SysFunc.h and defined in SysFunc.cpp (sorry if I use the wrong terminology there). So basically this:

Code: Select all

//SysFunc.h
#pragma once
#include <SDL.h>

//other functions and crap
SDL_Texture* CreateTexture(int Width, int Height, SDL_Renderer* renderer);

Code: Select all

//SysFunc.cpp
SDL_Texture* CreateTexture(int Width, int Height, SDL_Renderer* renderer) {
//create a texture n crap
return texture;
}
So all I have to do if I want to use this function is #include "SysFunc.h", right? Well it's not working. It was working fine up until a point where I added a bunch of calls to that function. I use Visual Studio and SDL2. If you need me to give more details. Just ask.
Thank you,

Now I'm going back to playing Runescape and being sad because my program don't work no mo.
What do you call a cow with no legs?

Ground beef.
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Identifier not found when it is.... what?

Post by dandymcgee »

corey__cakes wrote:Well it's not working.
Well I can't help you [without more information about your actual problem]. Could you perhaps describe what exactly "not working" means?
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
corey__cakes
ES Beta Backer
ES Beta Backer
Posts: 23
Joined: Mon Dec 23, 2013 7:56 pm
Current Project: Canadian Simulator 2017
Favorite Gaming Platforms: GBA, DC, iOS, SNES, WS, 360, N64
Programming Language of Choice: C++, Lua
Location: Your VCR.

Re: Identifier not found when it is.... what?

Post by corey__cakes »

dandymcgee wrote:
corey__cakes wrote:Well it's not working.
Well I can't help you [without more information about your actual problem]. Could you perhaps describe what exactly "not working" means?
Sorry, I had to type this post twice because my internet was being stupid. So the second time was a little rushed. I keep getting the error "identifier not found."
What do you call a cow with no legs?

Ground beef.
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Identifier not found when it is.... what?

Post by dandymcgee »

corey__cakes wrote:Sorry, I had to type this post twice because my internet was being stupid. So the second time was a little rushed. I keep getting the error "identifier not found."
Can you please post the exact, full error in [ code ] tags. I have no idea which identifier you're talking about.

Are you sure you're linking SDL properly?
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
corey__cakes
ES Beta Backer
ES Beta Backer
Posts: 23
Joined: Mon Dec 23, 2013 7:56 pm
Current Project: Canadian Simulator 2017
Favorite Gaming Platforms: GBA, DC, iOS, SNES, WS, 360, N64
Programming Language of Choice: C++, Lua
Location: Your VCR.

Re: Identifier not found when it is.... what?

Post by corey__cakes »

dandymcgee wrote:
corey__cakes wrote:Sorry, I had to type this post twice because my internet was being stupid. So the second time was a little rushed. I keep getting the error "identifier not found."
Can you please post the exact, full error in [ code ] tags. I have no idea which identifier you're talking about.

Are you sure you're linking SDL properly?
The function CreateTexture is the identifier not found. There are other identifiers not found. Like this instance of a struct that includes three ints and an SDL_Texture*. In that case, I use the keyword new to call the constructor and delete in the destructor. I have this instance in a class. Basically I'm getting this error "_____: identifier not found" for some things that I have 100% certainty about being declared before being called.

As to linking SDL, I always try to not copy and paste projects with SDL already linked because then I'll never memorize it. I always start fresh with an SDL project. And I've checked and double checked. I don't think it's the linker. The problem didn't arise until farther along the project and I didn't touch the project properties since the conception of it.
What do you call a cow with no legs?

Ground beef.
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Identifier not found when it is.... what?

Post by dandymcgee »

Just to verify, you are using Visual Studio, correct? Do you have #include "SysFunc.h" in every file that calls CreateTexture? Have you done a Clean -> Rebuild all?

Edit: If you still can't figure it out, just .zip the whole project directory and upload it somewhere. It'll be much easier than guessing.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
Post Reply