Page 1 of 1

About demo file

Posted: Sat Jan 02, 2010 10:03 pm
by Mircea Popescu
Whats

Code: Select all

#pragma comment(lib, "Irrlicht.lib")
supposed to accomplish in the main.cpp in the demo package ?

Re: demo file

Posted: Sat Jan 02, 2010 10:42 pm
by frr171
#pragma comment is a VC++ compiler directive used to specify linker options.

Basically, including that line of code is equivalent to adding all of the Irrlicht code files to your project. The .lib is the precompiled version.

Posted: Sat Jan 02, 2010 10:48 pm
by Mircea Popescu
Ya, but if you're trying to compile it with anything OTHER than vc it would cause the resulting program to fail (through having linked the wrong libraries).

So basically, all the problems people with dev-cpp have been having (I've seen a few people complaining they can't compile the examples on the forum) could really be traced back to this directive ?

Posted: Sat Jan 02, 2010 10:50 pm
by monkeycracks
Not all of them, but probably most of the linker error issues.

Posted: Sat Jan 02, 2010 11:41 pm
by hybrid
The pragma is simply ignored by other compilers, the errors people have with other IDEs are simply due to wrong usage of the tools :!: