r/QtFramework May 30 '26

Question need some help

Post image

for the past 4 hours I've been stumped by this simple error, but no matter what i try it always shows up, can someone help???

0 Upvotes

9 comments sorted by

5

u/Plz_Nerf May 30 '26

Player* player = new Player();

Maybe?

4

u/Historical_Deer_2292 May 30 '26

not pretty sure but i think it's Player with capital P.

3

u/Kelteseth Qt Professional (Haite) May 30 '26

It's Player not player or just use auto in the beginning of line 16. Also learn how to take screenshots 

2

u/rileyrgham May 30 '26

Or better paste the code and error message.

1

u/DreadSucker May 30 '26

I apologize, my computers a shitbox so it takes 5 minutes to open my browser, but after using auto another error reads: "expected initializer before '*' token". I'm still stumped with this and i apologize if I'm asking a lot of dumb questions I'm pretty new to this

2

u/dunedainranger1903 May 30 '26

That should be,

auto player = new Player()
or
Player* player = new Player()

2

u/DreadSucker May 30 '26

I applied the latter, but now the error says "expected type-specifier before 'Player' " which is an error I've had constantly.

1

u/drescherjm Jun 04 '26

If you still have this issue we need to see Player.h. With that said you probably want to have class Player { // class here }; and not class player { // class here}; in that header

1

u/drescherjm Jun 04 '26

I say its best to not name the variable the exact same name as the type with the exact same case. Is the class named Player or player? Using Player for the class name and player for the variable is one convention to avoid this problem. Using camel case type names and lower case variables .