Lesson 22
Lesson 22
Hello , when I was watching this lesson and tried to do this stuff ,something terrible happened and gave an error ,that can't be founded in code "Game.obj : error LNK2019: Link unresolved external symbol "void __cdecl LoadSprite(struct Sprite *,char const *,int,int,unsigned long)" (?LoadSprite@@YAXPAUSprite@@PBDHHK@Z). So basically my question is what is this , why is this there, does it refers to image that i'm loading ? And between that a question about pointers( they are so confusing times to times ), where we need to use them ?From my little experience I know that we need to pass adress ( pointer ) , when we have array or object that has big amount information in it ,other things that are small we can pass a value.
Re: Lesson 22
It means it could not find the declaration of the function. If you write in game.h a function "void myFunc ( );" and then in code try to use it: "myFunc();", but you have not declared it, eg. written first "void Game::myFunc() { return; }" you will get an unresolved external.
Check that you have written the function and make sure you have the "Game::" in front of the function, or where ever it is.
Without seeing the code I can't say for sure.
Check that you have written the function and make sure you have the "Game::" in front of the function, or where ever it is.
Without seeing the code I can't say for sure.
ʕ •ᴥ•ʔ
Re: Lesson 22
I just changed parametres for the function in header and forgot to change them in cpp , happens =(
and what about pointers?
and what about pointers?
Re: Lesson 22
well, what exactly do you not understand about pointers? o,o
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Re: Lesson 22
I said it in earlier post, mostly the question is situation to use pointers.
Re: Lesson 22
well they would be used for variables that have been declared in other scopes and to modify the variable's value in functions it is passed to
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Re: Lesson 22
Just to know 1 thing , in book , that I read about C ( Deitel ), there're some examples in which they make a variable like char* something[ ... ] and pass this to a function without pointer like
somefunc( char something [...] ). It's just visa versa as chilli does, so I'd like to know , what way is more correct or it's the same thing ?
somefunc( char something [...] ). It's just visa versa as chilli does, so I'd like to know , what way is more correct or it's the same thing ?
Re: Lesson 22
well if you do something like
then that wouldn't work since char* something[5] acts as if it were a char**
but this
then in that case it would work
Code: Select all
char* something[ 5 ];
// pass to somfunc
somefunc( something );
but this
Code: Select all
char* something[ 5 ];
// pass to somefunc version 1
somefunc( *something );
// or pass to somefunc version 2, x being some pre-declared var lol
somefunc( something[ x ] );
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --