is this bug? [solved]

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
ijo coim
Posts: 57
Joined: Fri Mar 25, 2005 1:29 pm
Location: indonesia, jogja-jogja

is this bug? [solved]

Post by ijo coim »

hi,
i made 3 files:
kata2.cpp
kata2.h //header file for kata2.cpp
main_kata_2.cpp //execute file for all

when i compile main_kata_2.cpp, everything is OK. but when i compile, it give me error like this:

Code: Select all

Linking...
main_kata_2.obj : error LNK2001: unresolved external symbol "public: bool __thiscall kata2::run(bool &,bool &,bool &,bool &,bool &,enum irr::video::E_DRIVER_TYPE &)" (?run@kata2@@QAE_NAA_N0000AAW4E_DRIVER_TYPE@video@irr@@@Z)
main_kata_2.obj : error LNK2001: unresolved external symbol "public: __thiscall kata2::kata2(void)" (??0kata2@@QAE@XZ)
Debug/main_kata_2.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
main_kata_2.exe - 3 error(s), 0 warning(s)
then, i recompile kata2.cpp, then i reexecute main_kata_2.cpp and it's work.

is this bug? or maybe i wrote a wrong code?
why when i execute main_kata_2.cpp for the first time it gave me some errors?

regards,

ijo coim.
hybrid

Post by hybrid »

I think you shoudl study your compiler documentation first :lol:
There are different stages in compiling an executable. First all .cpp files are compiled to .o files (object files). These are linked together to form the executable. You're obviously linking before all object files are available. Thus, some references to methods in missing object files are printed and the executable cannot be created.
There are means to automatically build missing object files based on calculated dependencies, namely Makefiles and project files. Since you're using some MS operating system you should search for project file creation for your compiler suite.
ijo coim
Posts: 57
Joined: Fri Mar 25, 2005 1:29 pm
Location: indonesia, jogja-jogja

finally

Post by ijo coim »

hybrid, thanks for that. now, i can see demo works for me.
before it didn't work, but, after i read your message, now i am understand.
thanks a lot hybrid.

(do you know, the demo didn't work for almost 4 months :oops: , but now it works)

regards,

ijo coim
Post Reply