Sign in to follow this  

help with error: JRect' was not declared in this scope

This topic is 3866 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I've created a template class called JRect<T> which sits in JRect.h/JRect.cpp. When including it in my main script I'm doing this: #include <JRect.h> // prototype void SetCamera(JRect<unsigned int> rect); I'm getting the error: `JRect' was not declared in this scope, pointing me to the line containing the function prototype. I'm sure its included propery as if I move JRect.h I get loads of other errors (can't find it). I'm using gcc/mingw as the compiler (on windows), and my makefile is as follows: objects = jtest.o JRect.o flags = -DWIN32 -D_GNU_SOURCE=1 -Dmain=SDL_main libs = -lmingw32 -lSDLmain -lSDL -lSDL_image -lSDL_ttf -lopengl32 -mwindows engine : $(objects) g++ -o jtest.exe $(flags) $(libfolder) $(includefolder) $(objects) $(libs) jtest.o : jtest.cpp g++ $(flags) $(includefolder) -c -o jtest.o jtest.cpp JRect.o : JRect.cpp g++ $(flags) $(includefolder) -c -o JRect.o JRect.cpp Any help appreciated! thanks jimbogd

Share this post


Link to post
Share on other sites
Try

#include "JRect.hpp"

Although "JRect.h" should be working, a few times I ran into that problem and I resaved the file as JRect.hpp and then used "JRect.hpp"

Share this post


Link to post
Share on other sites

This topic is 3866 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this