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

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

Postby corey__cakes on Mon Sep 21, 2015 4:22 pm

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.
corey__cakes
ES Beta Backer
ES Beta Backer
 
Posts: 23
Joined: Mon Dec 23, 2013 9:56 pm
Location: Your VCR.

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

Postby dandymcgee on Mon Sep 21, 2015 4:44 pm

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:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

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

Postby corey__cakes on Mon Sep 21, 2015 5:04 pm

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.
corey__cakes
ES Beta Backer
ES Beta Backer
 
Posts: 23
Joined: Mon Dec 23, 2013 9:56 pm
Location: Your VCR.

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

Postby dandymcgee on Mon Sep 21, 2015 6:02 pm

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:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

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

Postby corey__cakes on Tue Sep 22, 2015 1:32 pm

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.
corey__cakes
ES Beta Backer
ES Beta Backer
 
Posts: 23
Joined: Mon Dec 23, 2013 9:56 pm
Location: Your VCR.

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

Postby dandymcgee on Tue Sep 22, 2015 5:00 pm

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:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire


Return to Programming Discussion

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron