[Solved]Tutorial 1: HelloWorld doesn't compile in MS VS 2008

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
Rainer
Posts: 3
Joined: Wed May 20, 2009 10:40 pm

[Solved]Tutorial 1: HelloWorld doesn't compile in MS VS 2008

Post by Rainer »

I am using MS VS 2008.
I created a new empty Visual C++ project and copied and pasted the tutorial code into IrrlichtHelloWorld.cpp.
When compiling I got the error message:
"Component not found.
The Application couldn't start because Irrlicht.dll coudn't be found.
New installation might resolve the problem".
I then put the main()-function into the namespace IrrlichtHelloWorld.
Now I am getting the error message:
"error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup MSVCRTD.lib Irrlicht Hello World" and
"fatal error LNK1120: 1 unresolved externals D:\Projekte\Eigene\Visual Studio 2008\Irrlicht\Debug\Irrlicht Hello World.exe Irrlicht Hello World"

What to do to resolve this problem?
Thanks for help
Last edited by Rainer on Thu May 21, 2009 1:16 pm, edited 1 time in total.
d3jake
Posts: 198
Joined: Sat Mar 22, 2008 7:49 pm
Location: United States of America

Post by d3jake »

Try opening the directory that the example program is sitting in and open the Visual studio project\solution file that is provided.
The Open Descent Foundation is always looking for programmers! http://www.odf-online.org
"I'll find out if what I deleted was vital here shortly..." -d3jake
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

The Application couldn't start because Irrlicht.dll coudn't be found.
heres your first clue. When an error pops up, fix it first.

ITS TELLING YOU WHAT IS WRONG. Put the irrlicht dll from the bin folder, into the same folder as your application exe.

Then it will work, dont break it further by adding namespaces (Especially if you dont know what a namespace does)..
huydotnet
Posts: 81
Joined: Tue Sep 25, 2007 12:26 pm
Location: Danang, Vietnam

Post by huydotnet »

try to link user32.lib gdi32.lib to your project's linker
or use int main() instead of WINMAIN()
Rainer
Posts: 3
Joined: Wed May 20, 2009 10:40 pm

Now it works

Post by Rainer »

I opened the solution provided with the samples.
It worked. Then I tried to copy the project-properties to my own project
(for example the "Additional Library Directories"-entry under the "Configuration Properties -> Linker -> General" of the project).
It didn't run.
Only putting the Irrlicht.dll into the same folder as "Irrlicht Hello World.vcproj" worked.
Really strange that VS ignores the entries made under "tools -> options".
Maybe because I am using Windows Vista.
@all: Thanks for the posts
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

It doesn't ignore the options you set. It just makes exactly what you tell it to do.
Also Vista has nothing to with it that you can't control your IDE.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
Rainer
Posts: 3
Joined: Wed May 20, 2009 10:40 pm

Post by Rainer »

I just thought the Tutorial on the Web is complete!
The Tutorial tells to put
"irrlicht-1.5\irrlicht-1.5\include" to the "Include files" of VS
and
"irrlicht-1.5\irrlicht-1.5\lib\Win32-visualstudio" to the "Library files" of VS
Instead the Irrlicht.dll is in "irrlicht-1.5\irrlicht-1.5\bin\Win32-VisualStudio".
The Tutorial HTML within the downloaded example-folder tells:
"...
Solution: You may have forgotten to copy the Irrlicht.dll file from Irrlicht\bin\VisualStudio to the directory the tutorial's project file is in."
So that's all!
(I still wonder why the example project works fine.)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You need to link the .lib file, which is indeed in the Lib directory (so that part was already correct). The thing with copying Irrlicht.dll is not really solvable in general. The solution the examples from the SDK use is to generate all exe files and the dll into one directoy - done.
Post Reply