Using irrlicht in command prompt

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
NasaGuru
Posts: 7
Joined: Tue Mar 10, 2009 9:25 pm
Location: U//:MilkyWay/Sol/Earth/US/VA/Midlothian
Contact:

Using irrlicht in command prompt

Post by NasaGuru »

Hey guys. I have forsaken all IDE's for the Command Prompt (I am using Borland compiler). I have a file called main.cpp which has this:

Code: Select all

#include <irrlicht.h>
#include <iostream.h>

using namespace std;
void main()
{
 cout << "Yo";
}
I edited the Path in Environment Variables and added this:
C:\irrlicht-1.5\include
and
C:\irrlicht-1.5\lib\Win32-gcc
But when I compile from the command prompt it tells me "Error: Unable to open "irrlicht.h". What am I doing wrong?
"In Space, there is Liberty" - Epsilon
... at least there's SOMETHING up there...
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

You probably need to tell your compiler where to find the Irrlicht header and library files. If you are compiling from the command line, you need to add a -I<path> flag to the compile line. Just replace <path> with the path to the Irrlicht headers. You need to add a -L<path> flag to the link line also, but the <path> would be the path to the Irrlicht library file.

Travis
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I don't know what version of the Borland compiler you're using, but you probably want to #include <iostream> instead of <iostream.h>. The one you're currently using usually is the home for the old C++ IOStreams library which is probably not in namespace std and is old/defunct.
NasaGuru
Posts: 7
Joined: Tue Mar 10, 2009 9:25 pm
Location: U//:MilkyWay/Sol/Earth/US/VA/Midlothian
Contact:

Post by NasaGuru »

No it's still giving me issues
when I type "bcc32 -I c:\irrlicht-1.5\include"
it tells me it can't find file "include.cpp" 0.o
Any other ideas?
"In Space, there is Liberty" - Epsilon
... at least there's SOMETHING up there...
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

There is no space between the -I and <path>. You should be able to type bcc32 --help or bcc32 /? to get a list of the command line arguments you may use with your compiler. If you are going to avoid using an IDE, you should get familiar with them, and you should probably look over (and even copy) the makefile used by the Irrlicht examples.

Travis
NasaGuru
Posts: 7
Joined: Tue Mar 10, 2009 9:25 pm
Location: U//:MilkyWay/Sol/Earth/US/VA/Midlothian
Contact:

Post by NasaGuru »

I tried that:

Code: Select all

C:\Users\unknown>bcc32 -LC:\irrlicht-1.5\include
Error E2236: No file names given
I tried appending \*.h to it but it still tells me that.
"In Space, there is Liberty" - Epsilon
... at least there's SOMETHING up there...
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

You are really bad at this, aren't you?

Code: Select all

Error E2236: No file names given
Well, the compiler is telling you what you're doing wrong. Perhaps you should provide the name of the file you want to compile?

To compile and link t.cpp into a program from the command line, you'd typically write

Code: Select all

bcc32 t.cpp
If you need to add an include, you'd type

Code: Select all

bcc32 -I<path> t.cpp
If you need to add a library, you'd type

Code: Select all

bcc32 -I<path> t.cpp -L<path> <library>
Like I said in my previous post, you should really have a look at the documentation for your compiler and the makefile that is used to build the examples.

Travis
NasaGuru
Posts: 7
Joined: Tue Mar 10, 2009 9:25 pm
Location: U//:MilkyWay/Sol/Earth/US/VA/Midlothian
Contact:

Post by NasaGuru »

Allright now when I try that once i type
bcc32 -IC:\irrlicht-1.5\include main.cpp
It prints out
functions containing for are not expanded inline
or
functions containing while are not expanded inline
for each .h file...
All of these are warnings. But after a while the console just says "too many errors or warnings". Is there a way to fix these warnings, or is there a way to make the console just continue, ignoring the warnings?
"In Space, there is Liberty" - Epsilon
... at least there's SOMETHING up there...
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

According to this
you need to add -w-inl or something similar to your command line to disable that warning, or perhaps it's because you have a bcc32.cfg that already contains -w and you need to remove that line, or set the maximum number of warnings. Should all be in the docs anyway.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
NasaGuru
Posts: 7
Joined: Tue Mar 10, 2009 9:25 pm
Location: U//:MilkyWay/Sol/Earth/US/VA/Midlothian
Contact:

Post by NasaGuru »

bitplane wrote:According to this
you need to add -w-inl or something similar to your command line to disable that warning, or perhaps it's because you have a bcc32.cfg that already contains -w and you need to remove that line, or set the maximum number of warnings. Should all be in the docs anyway.
Nope still gives me warnings!
"In Space, there is Liberty" - Epsilon
... at least there's SOMETHING up there...
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Learn to use your compiler, or use one that others actualy use. I suggest you use Microsoft Visual C++ Express. It is free, is easy to use, has an excellent debugger, and will build Irrlicht without problems.

Travis
NasaGuru
Posts: 7
Joined: Tue Mar 10, 2009 9:25 pm
Location: U//:MilkyWay/Sol/Earth/US/VA/Midlothian
Contact:

Post by NasaGuru »

vitek wrote:Learn to use your compiler, or use one that others actualy use. I suggest you use Microsoft Visual C++ Express. It is free, is easy to use, has an excellent debugger, and will build Irrlicht without problems.

Travis
Yes it's free and easy and doesn't work with Vista Home Premium because of the "Create Project" error. TextPad w/ C++ sucks, DevC++ sucks, don't even get me STARTED on Ecipse...
"In Space, there is Liberty" - Epsilon
... at least there's SOMETHING up there...
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I don't know what Create Project error you're speaking of, but I'm using it just fine here. I use it on XP Pro at work and on Vista Home Premium upstairs in my home office.

Travis
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Works for me on both systems as well, but I never started a new project, just using those coming with Irrlicht.
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

Creating a new projects works for me on Ultimate and Business. Can't image why it shouldn't work on Home Premium
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
Post Reply