Compiling my first tutoriol/program, goes fine. Building gives this error:
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/helwld.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Creating browse info file...
helwld.exe - 2 error(s), 0 warning(s)
I am new to C++ but have followed the directions on the tutorial, whcih says: to set the options>idirectories>include "\include directory of the Irrlicht Engine ", and to clcik libraries and put in the library path for VS studio in for the same machine above.s After researching I also Ihave put the Irrlicht.lib in the project settings link list as well.
This is an xp running VS 6.0 C++
I dont know what else to add...
[B]OH ohB]the tutorial said if you get the first error then you have done the options/directories include wrong, but I have checked it several times....
I have searched the msdn for info on the #pragmatic statement too, and all looks acurater there...
Thanks for any help
iti
Code:
// helwld.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "resource.h"
#include "irrlicht.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#pragma comment(lib, "Irrlicht.lib") //linking to the irr library
int main()
{
IrrlichtDevice *device =
createDevice(EDT_SOFTWARE, dimension2d<s32>(512, 384), 16,
false, false, false, 0);
device->setWindowCaption(L"Another Hello World!!!");
IVideoDriver* driver = device->getVideoDriver(); //SET pntrs to these devices
ISceneManager* smgr = device->getSceneManager(); // for convenience
IGUIEnvironment* guienv = device->getGUIEnvironment();
guienv->addStaticText(L"Hello World! This is the Irrlicht Software engine!",
rect<int>(10,10,200,22), true);
IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2"); //load a Quake
// 2 model and display it
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
//To make the mesh look a little bit nicer, change it material
// a little bit: disable lighting because we do not have a
// dynamic light in here and the mesh would be totally black
// Then set the frame loop so that the animation is looped
if (node){
node->setMaterialFlag(EMF_LIGHTING, false);
node->setFrameLoop(0, 310);
node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") );
}
smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); //place the camera
while(device->run()){
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop(); return 0;
}