Menu

using curses with Dev-cpp?

Kurgusov
2007-03-10
2012-09-26
  • Kurgusov

    Kurgusov - 2007-03-10

    Hi..about 5 months ago I download ncurse's 5.5 but ever since have been trying to get Dev-cpp to use it..it says
    "no such folder or directory".
    The ncurses folder is placed in the Dev-cpp root directory and in "Project options" under parameters linker I add -1ncurses,no joy...obviously I'm wrong here..has anyone here succeded in using the curses with any of their projects with dev-cpp?
    (I'm using xp,Dev-cpp 4.9.9.2 in c++)..thx.

     
    • Kurgusov

      Kurgusov - 2007-03-10

      p.s. and yeah i also #include "curses.h" didnt work so i tried #include <curses.h> ...zip.
      thx for any replys.

       
    • Nobody/Anonymous

      Hi
      First of all don't curse Dev-C++, it's one of the very good software available for free.

      Second, you added "-1ncurses" instead of "-lncurses" in Project Options->Parameters->Linker section. It's '-l' not '-1'. Here 'l' stands for library.

      just_learning

       
    • Anonymous

      Anonymous - 2007-03-10

      If you read the "<-PLEASE READ BEFORE POSTING A QUESTION" thread, you will find information on how to post the information necessary to answer your question (the so called 'basic three'. Primarily in this case we need the Compile Log so you can accurately and effortlessly describe what you are really doing, and the actual result, and so that we can stop guessing.

      To compile and link code from a library Dev-C++ needs to be 'told' three things:

      1) Where the header file(s) are (-I options)
      2) Where the library files are (-L options)
      3) What the library is called (-l options)

      You have only mentioned item (3). All of these options can be set in the Project Options dialog. The Compile Log will reveal all and is a simple Copy & Paste.

      ... 5 months! Really!?

      Clifford

       
    • Nobody/Anonymous

      okay...thx slocombe...trying now...
      and yeah maybe more like 4/4.5months I gave up for a while there but black/white is hurting my eyes.

       
    • Nobody/Anonymous

      so using dev-cpp 4.9.9.2 in the console setting with windows XP and using c++ language.
      I put -Incurses
      -Lncurses
      -lncurses
      all in project options>parameters>linker....
      I also tried them all in project options>compiler>c++...
      I also tried them in both at the same time.
      The curses folder is in Dev-cpps root directory.
      Its named ncurses-5.6

      Compiler: Default compiler
      Building Makefile: "C:\Dev-Cpp\Makefile.win"
      Executing make...
      make.exe -f "C:\Dev-Cpp\Makefile.win" all
      g++.exe -c Deeper.cpp -o Deeper.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"

      Deeper.cpp:4:20: curses.h: No such file or directory

      make.exe: *** [Deeper.o] Error 1

      Execution terminated

       
    • Anonymous

      Anonymous - 2007-03-10

      Randomly placing options in boxes is not a good approach, you really need to know and understand what you are doing, and what the various options are for and where thay go.

      Linker options are not the problem here (yet) since you have not yet got as far as linking, it is failing to compile. The -I option goes in the Project->Project options>Parameters->C++ Compiler box, not the Linker box. -L and -l are linker options. Rather than using -l and -L you can explicitly browse for the library file using the "Add Library or Object" button

      The -I and -L options need to have a fully qualified path (look at your own compile log for examples!), or a path relative to one already defined with a -I/-L option. I don't know where you installed your ncurses distribution so I can't tell exactly what to do.

      The -lncurses option implies that the library file to be linked is called libncurses.a - is that the case?

      Get the -I option in the right place first, and set the paths correctly. If you have further problems post the new log.

      Clifford

       
    • Anonymous

      Anonymous - 2007-03-10

      >> ...but black/white is hurting my eyes

      I am not sure what you mean - ncurses is not the only way to get colour into your console apps.

       
    • Kip

      Kip - 2007-03-10

      www.ubuntu.com

      Kip

       
    • Nobody/Anonymous

      >> ...but black/white is hurting my eyes

      >>I am not sure what you mean - ncurses is not the only way to get colour into your console apps.

      .......Thats only a minor reason i want to use curses actually,I did find an addColorConsole header file that u can add and it works great except the con::fg_blue(etc) call to get that colour can only be added within a cout statement,so its pretty restrictive.thx for your great help i'm trying now!

       
    • Nobody/Anonymous

      I know u cant help on this but not one folder in the 8mb download of ncurses5.6 that includes a library folder,it has a lot of other folders and an include folder but no folder called lib or library or anything close.

       
    • Nobody/Anonymous

      errr srry yeah it does.replying to my last reply!

       
    • Anonymous

      Anonymous - 2007-03-11

      >> I did find an addColorConsole header file...
      That is not what I was referring to, I was referring to the rather more obvious: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/console_functions.asp

      >> sugar..no ncurse does not have a lib file ...

      Well it would be a .a (archive) file rather than a .lib file. This is the GNU convention for libraries. That said, it would have to be a specifically MinGW/GCC build and not just any old .a file. For this reason most Open Source projects are delivered as source (as the name would suggest), and you have to build the library yourself. Most likely it uses a Linux .configure script to generate a target specific make file. To run such a script on Windows to generate a MinGW archive you will need to use Msys and possibly a full installation of MinGW rather than the minimal tool set that Dev-C++ ships with (www.mingw.org).

      Having said all that and possibly overwhelmed you, there is an easier method; the ncurses compatible pdcurses library. This is available as a Dev-C++ compatible DevPak, and can be downloaded and automatically installed via Tools->Check for Updates/Packages, select the DevPaks.org server from the Server drop-down, click "Check for Updates", select "Text Console" from the Group drop-down, click pdcurses, followed by "Download Selected". The DevPak will be downloaded and installed.

      That done, go to File->New->Project, select the "Other" tab at the top of the project dialog, and select the "Curses Application" template. This template will provide sample code but more importantly will correctly set all the project options to link the library etc. Give your project a name, and select between C and C++, save the project in a folder of its own (without any spaces in the path), click "Build", save the sample code (or replace with your own), Click "Run". Job done!

      Clifford

       
    • Nobody/Anonymous

      Clifford I love you!!!
      If my computer was a teller machine i'd send you my next pay cheque.....
      much,much respects....Kurgusov :)- .

       
      • Anonymous

        Anonymous - 2007-03-11

        I really hope you are a woman! Although, for money... ;-)

         
        • Nobody/Anonymous

          "Although, for money... ;-)"
          That explains your Microsoft "orientation".

           
    • Nobody/Anonymous

      I am seriously punishing my gray muscles to build an application that will take any name in any language of the world and will quickly tell whether a person is a male or female (I am desperately troubled by this problem).

       
      • Nobody/Anonymous

        Chris, Jules, Max...

        Soma ^_^

        HINT: Can't be done.

         
    • Nobody/Anonymous

      ok thx anon...Ill try it now!
      "Dont curse Dev-cpp"...hahaha.

       
    • Nobody/Anonymous

      still no joy...
      under parameters>linker I put -lncurses(l being a lowercase L) and i did both #include "curses.h" and #include <curses.h>...
      i'll point out that im using c++ and in a console application.
      compiler says "no such file or directory"...
      any responses much much appreciated.

       
    • Kurgusov

      Kurgusov - 2007-03-11

      sugar..no ncurse does not have a lib file in it so I'll have to go and see whats up with that!!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.