VC++ Express and pdCurses - Newbie

Help
Anonymous
2006-05-27
2013-04-25
  • Anonymous

    Anonymous - 2006-05-27

    Hey everyone! I'm taking the Computer Science course at the local university, so I've finally learnt a good programming language, C++. I've always loved roguelikes, so I wanted to try having a bit of fun coding one too, just for experience. So I found pdcurses.

    I'm trying to get it to run with Visual C++ 2005 Express, but being a bit of a newbie to this whole thing, I'm getting a few problems. What I've done so far:

    1) Create empty project
    2) Add curses.h, cursespriv.h, panel.h and term.h   to my project, then a main.cpp file with #include "curses.h" and a main function with initscr(), that's all.
    3) Included pdcurses.lib and panel.lib to my additional dependencies list and updated the include directories.
    4) Got a problem saying the compiler couldn't find "libc.lib" - after some research on the net, I decided ignoring that would be the best. Did it, and got the same for uuid.lib, which had happened before. Added that to the ignore library list too.

    Where I'm at now:

    With initscr() commented, I can compile, with it uncommented, I get:

    Linking...
    pdcurses.lib(pdckbd.obj) : error LNK2019: unresolved external symbol __imp__MapVirtualKeyA@8 referenced in function _GetInterestingEvent
    pdcurses.lib(pdcutil.obj) : error LNK2019: unresolved external symbol __imp__MessageBeep@4 referenced in function _PDC_beep

    Can anyone help me? Sorry if it's obvious... again, I'm a newbie. Since I didn't have a DLL come with the package, I also created a project with said .h files, and compiled that to get my dll, which is only 32kb, leading me to believe something might be wrong with that too.

    Oh, and I added a line to curses.h with "#define WIN32 1", which seems to be what it wanted at some point.

     
    • William McBrine

      William McBrine - 2006-05-28

      > 4) Got a problem saying the compiler couldn't
      > find "libc.lib" - after some research on the
      > net, I decided ignoring that would be the best.

      If the compiler can't find libc, you've got serious problems. Don't ignore it.

      > Since I didn't have a DLL come with the package,
      > I also created a project with said .h files,
      > and compiled that to get my dll, which is only
      > 32kb, leading me to believe something might be
      > wrong with that too.

      Yes, that's smaller than it should be. But I'm a little vague on what you did, or why you expected it to build a DLL... PDCurses builds a static library by default. You don't need a DLL, and I wouldn't bother with one, except in rare cases.

       
    • Anonymous

      Anonymous - 2006-05-28

      Heh, again, still a newbie, don't see much difference between static and dynamic libraries, I'll make a note to read a bit on it at some point!

      Regarding libc, apparently VC++ 2005 Express doesn't come with that or libcmt.lib, which are deprecated. Multi-threaded only.

      Here's a quote: "The single-threaded CRT (libc.lib, libcd.lib) (formerly the /ML or /MLd options) is no longer available. Instead, use the multithreaded CRT. See Multithreaded Libraries Performance."

      That's from http://msdn2.microsoft.com/en-us/library/abx4dbyh.aspx

      Anyway, the problem seems to be in finding pdcurses related stuff. I've got the paths set correctly. Any ideas?

      Anything I need to change in any .h file or something? I only added that #define WIN32 1 line in curses.h

       
    • William McBrine

      William McBrine - 2006-05-29

      > Regarding libc, apparently VC++ 2005 Express doesn't come
      > with that or libcmt.lib, which are deprecated. Multi-threaded
      > only.

      They can't _both_ be deprecated -- nor is that what that page says. (The "mt" in "libcmt.lib" stands for multithreaded.)

      If libc is unavailable, you'll have to rebuild PDCurses from source to make it use libcmt.

      > Anyway, the problem seems to be in finding pdcurses related > stuff.

      Not so. What those error messages show is that pdcurses.lib _was_ found, but functions that _it_ depended on, like MessageBeep, were not. Presumably because they're in libc.

       
    • Anonymous

      Anonymous - 2006-05-29

      You're right, my bad. Stupid mistake, I think I must've confused libcd.lib with libcmt.lib - and the errors were inside pdcurses functions, but referring to stuff outside pdcurses.

      Still, the multi-threaded library should support single-threaded applications, right? They shouldn't be deprecating something single-threaded support completely.

      I'd like to avoid downloading Dev-Cpp for now, or switching to Linux for curses programming, I'm not used to either (yet). Any ideas?

      P.S. Thanks for all the answers thus far:) They're appreciated!

       
    • William McBrine

      William McBrine - 2006-05-30

      > Still, the multi-threaded library should support single-threaded
      > applications, right? They shouldn't be deprecating something
      > single-threaded support completely.

      Well, you can always have a "multithreaded" app with only one thread. So, they could discontinue support for single-threaded apps as a separate category.

      > I'd like to avoid downloading Dev-Cpp for now, or switching
      > to Linux for curses programming, I'm not used to either (yet).
      > Any ideas?

      Like I said -- rebuild PDCurses from source. Download pdcurs28.zip, and follow the instructions therein. Note that it's set up to build from the command line, not as a project.

       
    • Anonymous

      Anonymous - 2006-05-30

      Alrighty, I'll definitely be looking into that. End of semestre at uni is pretty much eating me alive right now (and spitting me out at the end of it, hopefully, if rather chewed).

      I'll try doing that and recording most of my steps so I can post a small walkthrough for anyone who comes across the same situation.

      Thanks a lot for your help! Hopefully, I'll be able to manage from now on. If not, see you "soon"! *grin*

      Thanks!

       

Log in to post a comment.