Page 1 of 1
Using irrlicht in command prompt
Posted: Sat Mar 14, 2009 4:30 am
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?
Posted: Sat Mar 14, 2009 4:41 am
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
Posted: Sat Mar 14, 2009 4:44 am
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.
Posted: Sat Mar 14, 2009 5:11 am
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?
Posted: Sat Mar 14, 2009 5:55 am
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
Posted: Sat Mar 14, 2009 3:05 pm
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.
Posted: Sat Mar 14, 2009 6:54 pm
by vitek
You are really bad at this, aren't you?
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
If you need to add an include, you'd type
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
Posted: Sat Mar 14, 2009 7:27 pm
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?
Posted: Sat Mar 14, 2009 9:09 pm
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.
Posted: Sat Mar 14, 2009 11:48 pm
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!
Posted: Sun Mar 15, 2009 4:44 am
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
Posted: Sun Mar 15, 2009 5:26 am
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...
Posted: Sun Mar 15, 2009 5:28 am
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
Posted: Sun Mar 15, 2009 4:43 pm
by hybrid
Works for me on both systems as well, but I never started a new project, just using those coming with Irrlicht.
Posted: Sun Mar 15, 2009 6:03 pm
by Sylence
Creating a new projects works for me on Ultimate and Business. Can't image why it shouldn't work on Home Premium