Hi I'm fairly new to c++ and i'm trying to use curses. I tried to include it and it says [b]"curses.h: No such file or directory."[/b]
[code]
#include <cstdlib>
#include <iostream>
#include <curses.h>
using namespace std;
int main(int argc, char *argv[])
{
system("PAUSE");
return 0;
}
[/code]
I'm assuming I have to download something but I don't know where to download it, I've googled it and can't find anything. If someone could tell me how to get this working that'd be great, thanks.
You have to include the directory where curses.h is located in the project. What IDE?
I don't know what you mean exactly, I'm using dev C++?
[code]3 C:\Users\Home\Desktop\CRpg\main.cpp curses.h: No such file or directory. [/code]
i included the other part of the error if that helps
I also have not downloaded anything if that's what you're asking. I just opened a new project in dev C++ and added the include line
- Download a curses implementation (ncurses, pdcurses, ...)
- Add curses include directory to your includes path
[QUOTE=q3k;32832920]- Download a curses implementation (ncurses, pdcurses, ...)
- Add curses include directory to your includes path[/QUOTE]
Yeah that's the problem i, for some reason couldn't find a download link. Can you give me a link to a direct download.
Google 'pdcurses'.
Click first link.
:\
Don't use Dev C++.
[QUOTE=ROBO_DONUT;32833181]Google 'pdcurses'.
Click first link.
:\[/QUOTE]
I'm looking for ncurses and the hard part is what kind of file am I suppose to be downloading. my lack of understanding makes it more difficult than it needs to be.
[editline]17th October 2011[/editline]
[QUOTE=Yogurt;32833213]Don't use Dev C++.[/QUOTE]
you're giving a statement with no arguments, the only thing annoying i've found is the damn tabbing..
[QUOTE=LauScript;32833270]I'm looking for ncurses and the hard part is what kind of file am I suppose to be downloading. my lack of understanding makes it more difficult than it needs to be.[/QUOTE]
ncurses is for posix systems (i.e. Linux, BSD, Mac OS X, etc.).
[QUOTE=LauScript;32833270]I'm looking for ncurses and the hard part is what kind of file am I suppose to be downloading. my lack of understanding makes it more difficult than it needs to be.
[editline]17th October 2011[/editline]
you're giving a statement with no arguments, the only thing annoying i've found is the damn tabbing..[/QUOTE]
DevC++ is ancient. No-one should use it anymore. Use Visual Studio or if you don't like that for some bizarre reason, use Code::Blocks.
[QUOTE=ROBO_DONUT;32833347]ncurses is for posix systems (i.e. Linux, BSD, Mac OS X, etc.).[/QUOTE]
Oh, well someone gave me false information >:( thanks
pdcurses [b]is[/b] ncurses for all it matters. You can use the ncurses references and it'll work perfectly fine with pdcurses.
okay so i got it to include without any errors, but i'm supplying a the filepath as
[code]
#include <C:\Users\Home\Desktop\CRpg\curses.h>
[/code]
which obviously won't work on all computers, how do I get it to work on all computers.
[QUOTE=LauScript;32833658]okay so i got it to include without any errors, but i'm supplying a the filepath as
[code]
#include <C:\Users\Home\Desktop\CRpg\curses.h>
[/code]
[B]which obviously won't work on all computers[/B], how do I get it to work on all computers.[/QUOTE]
Doesn't matter. It's compiled into the program.
You should set up include paths, though, so you only have to #include <curses.h>.
[editline]17th October 2011[/editline]
I have no idea how you do that in DevC++, by the way.
looks like i need a new program
You should stop making threads every time you want to ask a question. There is a special thread for questions.
You probably need more eye-of-newt.
[editline]18th October 2011[/editline]
Or possibly "#include <witchcraft>"
[QUOTE=LauScript;32833658]okay so i got it to include without any errors, but i'm supplying a the filepath as
[code]
#include <C:\Users\Home\Desktop\CRpg\curses.h>
[/code]
which obviously won't work on all computers, how do I get it to work on all computers.[/QUOTE]
For direct paths to include files you should be using quotes and not braces.
[code]#include "C:\\Users\\Home\\Desktop\\CRpg\\curses.h"[/code]
Along with using double-slashes to prevent escape characters from being used (depending on IDE/compiler).
Using braces < > with includes tells the preprocessor to use the specified include directories in your project as well as the INCLUDE environment variable on Windows based machines. Given that you used a specific path, you should be using quotes or defining the path as others mentioned in your includes property.
As others said, DevC++ is old, uses an extremely out-dated compiler (MingW, which is maintained still but the DevC++ version is outdated), and is just lacking in features. If you are developing on Windows, the recommended is Visual Studio which you can get free.
[QUOTE=atom0s;32845980]For direct paths to include files you should be using quotes and not braces.
[code]#include "C:\\Users\\Home\\Desktop\\CRpg\\curses.h"[/code]
Along with using double-slashes to prevent escape characters from being used (depending on IDE/compiler).
Using braces < > with includes tells the preprocessor to use the specified include directories in your project as well as the INCLUDE environment variable on Windows based machines. Given that you used a specific path, you should be using quotes or defining the path as others mentioned in your includes property.
As others said, DevC++ is old, uses an extremely out-dated compiler (MingW, which is maintained still but the DevC++ version is outdated), and is just lacking in features. If you are developing on Windows, the recommended is Visual Studio which you can get free.[/QUOTE]
<> for things located inside environment folders (standard libraries for example) or added to the project
"" for files local to the project.
[QUOTE=Asgard;32845682]You should stop making threads every time you want to ask a question. There is a special thread for questions.[/QUOTE]
Didn't see one, sorry. (clearly i'm blind)
thanks for the info on <>
Sorry, you need to Log In to post a reply to this thread.