Problem with compiling by DEV C++

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
tommyb
Posts: 9
Joined: Tue Sep 04, 2007 5:31 pm
Location: Poland
Contact:

Problem with compiling by DEV C++

Post by tommyb »

Hi, i'm new, i spent last time on creating games in flash, but now i've discovered this site and start using this tutorials, but i have a problem with the first one :oops: . I'm usin DEV C++ 4.9.9.2 And follow the tutorial from main page about using irrlicht and this compiler, i follow all steps, but i always see this problem. Can you tell me what is wrong? I have no more ideas. Thank you very much for help, i know that my english is horrible.

Image
lukrop
Posts: 27
Joined: Wed Aug 29, 2007 10:28 am
Location: Vienna, Austria

Post by lukrop »

do the same like i told this guy ;) post your linker flags... http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=23701
tommyb
Posts: 9
Joined: Tue Sep 04, 2007 5:31 pm
Location: Poland
Contact:

Post by tommyb »

Heh, it i easier to say than do this, if i good understand i should paste irrlicht.h into my project folder and change directory, i try this but effect is the same, can you tell me stp by step which part of irrlicht i should paste and where? your solution gave no result.

I also pasted the file makefile.win into project folder, but it didn't solve the problem.
lukrop
Posts: 27
Joined: Wed Aug 29, 2007 10:28 am
Location: Vienna, Austria

Post by lukrop »

you should post the contents of your Makefile.win here or on nopaste because this seems to be a linker problem and you maybe got the wrong linker flags (which are declared in the Makefile.win) ;) I'm not familiar with the linker-flags for windows but maybe someone else here...
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I thought that dev-c++ 5.beta is called 4.9.9.3, in that case you have to update. Older versions do not properly work. But you seem to lack the same library than the other guy: You have tom link against Irrlicht, otherwise irrlicht cannot be used...
TomiZ
Posts: 40
Joined: Wed Aug 29, 2007 6:02 am
Location: Poland
Contact:

Post by TomiZ »

I will write how to start project from the beginning.

First create new project - console application. Save it (it's not important where). In main menu select "project" and then "project options". Select card "Directories". In "include directories" add path to Include folder in irrlicht. Now select page "Parameters"and add library to linker (just press button). This library is "lib/Win32-gcc/libIrrlicht.a" in irrlicht directory.

add lines:

Code: Select all

#include <irrlicht.h>
#pragma comment(lib, "Irrlicht.lib")
Now you can write any program you want :)

Code: Select all

#include <irrlicht.h>

#pragma comment(lib, "Irrlicht.lib")

int main(int argc, char *argv[])
{
    irr::IrrlichtDevice *device 
          =  irr::createDevice( irr::video::EDT_SOFTWARE, irr::core::dimension2d<irr::s32>(640, 480), 16, 
                        false, false, false, 0);
			
   while(device->run())
   {
                       
   }
			
    return 0;
}
If you don't want to write "irr::" you can write "using namespace irr;" under include :)
To run program you have to copy dll file to system dir, or to you exe file.

btw: I really don't like Dev C++ auto formatting code, also intellisense isn't work for me. I suggest you to download MS Visual C++ 2005 (it's free).

It is work with 4.9.9.2 :)
tommyb
Posts: 9
Joined: Tue Sep 04, 2007 5:31 pm
Location: Poland
Contact:

Post by tommyb »

This is my makefile.win

Code: Select all

# Project: Projekt próba
# Makefile created by Dev-C++ 4.9.9.2

CPP  = g++.exe
CC   = gcc.exe
WINDRES = windres.exe
RES  = 
OBJ  = projekt2/Untitled1.o $(RES)
LINKOBJ  = projekt2/Untitled1.o $(RES)
LIBS =  -L"d:/Dev-Cpp/lib" -L"C:/Irrlicht/include" C:/Irrlicht/lib/Win32-gcc/libIrrlicht.a  
INCS =  -I"d:/Dev-Cpp/include"  -I"C:/Irrlicht/include" 
CXXINCS =  -I"d:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"d:/Dev-Cpp/include/c++/3.4.2/backward"  -I"d:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"d:/Dev-Cpp/include/c++/3.4.2"  -I"d:/Dev-Cpp/include"  -I"C:/Irrlicht/include" 
BIN  = "Projekt próba.exe"
CXXFLAGS = $(CXXINCS)  
CFLAGS = $(INCS)  
RM = rm -f

.PHONY: all all-before all-after clean clean-custom

all: all-before "Projekt próba.exe" all-after


clean: clean-custom
	${RM} $(OBJ) $(BIN)

$(BIN): $(OBJ)
	$(CPP) $(LINKOBJ) -o "Projekt próba.exe" $(LIBS)

projekt2/Untitled1.o: projekt2/Untitled1.cpp
	$(CPP) -c projekt2/Untitled1.cpp -o projekt2/Untitled1.o $(CXXFLAGS)



Method from preview post doesn't work, there is the same problem, i will try MS visual 2005 free edition, it should be better for me as it is easier in use for beginner. Thanks for help.
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

pragma comment is not supported by gcc, but it's not needed anyway. The Makefile you posted should work if all pathes are correct. But the library is used as an object, not as a library. That's not the best way.
fireside
Posts: 158
Joined: Thu Dec 01, 2005 10:55 pm

Post by fireside »

What you might want to do is download the irrlicht devpackage. It's for version 1.3, but you can replace the link file with the new version. The microsoft compiler is huge and a pain to set up.
http://sourceforge.net/project/showfile ... _id=497002
tommyb
Posts: 9
Joined: Tue Sep 04, 2007 5:31 pm
Location: Poland
Contact:

Post by tommyb »

Thanks for help, i will try your propositions.
tommyb
Posts: 9
Joined: Tue Sep 04, 2007 5:31 pm
Location: Poland
Contact:

Post by tommyb »

Now I'm using Microsoft Visual C++ Expresss Edition, but it is worse than Dev, i can't find even easiest function, like adding libraries, but i will try, does anybody know if there is a tutorial showing how to use irrlicht with this compiler?
tommyb
Posts: 9
Joined: Tue Sep 04, 2007 5:31 pm
Location: Poland
Contact:

Post by tommyb »

Ok, problem is solved by MS Visual C++ Express Edition, there is no problem with this compiler, it worka fine, but i can't link textures, the normal for me way ( ex. c:\irrlicht\media\sydney.md2 ) and texture is not loaded, but i will try to solve it.
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

If you use \ in a string you have to escape it, otherwise e.g. \n will be a newline character. So use \\ or even better /
tommyb
Posts: 9
Joined: Tue Sep 04, 2007 5:31 pm
Location: Poland
Contact:

Post by tommyb »

Ok, everything clear, now i can start learning irrlicht, there are some small problems but i will solve them. Thanks for help.
Post Reply