Fun with GUI toolkits

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PaulBlay
    Knight
    • Jan 2009
    • 657

    Fun with GUI toolkits

    Using Visual C++ with Windows XP

    Doryen library : Can't run "Hello world". Functions cause mysterious crashes with no error message.

    Fast Light Toolkit : Failed to compile the "Hello world" program
    "fatal error C1083: Cannot open include file: 'X11/X.h': No such file or directory"

    Qt (with Qt creator IDE) : Close (I might go back to this one). Debugger glitch caused all compiler warnings to be meaningless. Unable to build accompanying libraries that were in source code form.

    TinyCurses : Failed to compile "Hello world" program. Produced "unresolved external symbol" linker errors to functions that do exist and are declared.

    SDL : I've got this the closest to working of all the ones I've tried so far. Not really a "GUI" library though. Trouble building SDL_ttf library (but I finally got it working, I think).

    GTK+ : Apparently impractical to use with VC++ more recent than 6.
    Currently turning (Angband) Japanese.
  • Magnate
    Angband Devteam member
    • May 2007
    • 5110

    #2
    Try Linux? Most of them work quite well there ... (I know you've answered that before - don't worry - I just never cease to be amazed at the effectiveness of M$'s monopoly, given how much harder it is to do any development for Windows - yet everyone seems to do it)
    "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

    Comment

    • PaulBlay
      Knight
      • Jan 2009
      • 657

      #3
      Originally posted by Magnate
      Try Linux? Most of them work quite well there ...
      Even if they do work well in Linux it doesn't solve my problem because 70+% of my potential audience is going to be using Windows.

      There is some good news though - I've got FLTK compiling properly now (it needed a /DWIN32 and a typo corrected).
      Currently turning (Angband) Japanese.

      Comment

      • artanis
        Rookie
        • May 2009
        • 7

        #4
        Originally posted by PaulBlay
        TinyCurses : Failed to compile "Hello world" program. Produced "unresolved external symbol" linker errors to functions that do exist and are declared.
        What's the specific error? Did you add SDL.lib and SDL_ttf.lib to the linker input property of the project?

        Comment

        • PaulBlay
          Knight
          • Jan 2009
          • 657

          #5
          Originally posted by artanis
          What's the specific error? Did you add SDL.lib and SDL_ttf.lib to the linker input property of the project?
          The errors were

          Code:
          main-tc.obj : error LNK2019: unresolved external symbol "int __cdecl getch(void)" (?getch@@YAHXZ) referenced in function _SDL_main
          main-tc.obj : error LNK2019: unresolved external symbol "int __cdecl refresh(void)" (?refresh@@YAHXZ) referenced in function _SDL_main
          main-tc.obj : error LNK2019: unresolved external symbol "int __cdecl printw(char const *,...)" (?printw@@YAHPBDZZ) referenced in function _SDL_main
          I'm pretty sure that the answer to your other question is yes, but there is no way to check (because I don't have that project any more and because things got a little messed up when I tried to recreate it from scratch).
          Currently turning (Angband) Japanese.

          Comment

          • artanis
            Rookie
            • May 2009
            • 7

            #6
            It's possible that the .lib you grabbed is for a compiler other than the one you're using. I was able to link it successfully to a new win32 project in VS2005. Are you still considering all options or have you settled on another one already? I'd be happy to help test or troubleshoot anything angband related.

            For reference here are the versions I grabbed.


            Comment

            • PaulBlay
              Knight
              • Jan 2009
              • 657

              #7
              Those were the same downloads I used. I have gone back to the start and recreated all the steps I used in detail.

              See the following pages in order:
              Creating a SDL project with VC++
              Creating a SDL_ttf project with VC++
              Creating a TinyCurses project with VC++

              All except the last step worked (but note that the SDL_ttf demo code is problematic).

              If you can work out a step I missed / got wrong please let me know.
              Currently turning (Angband) Japanese.

              Comment

              • artanis
                Rookie
                • May 2009
                • 7

                #8
                I got the same errors you did as soon as I added the sample code to my .cpp file.

                We're including a C header from a c++ file... fix it like this:
                Code:
                extern "C"
                {
                #include "tinycurses.h"
                }
                The problem is including the tinycurses.h file from c++ causes the linker to look for c++ name-mangled versions of those functions that dont exist. Tinycurses is c (maybe it'll build as cpp?). You can switch your entire project to C by renaming your project's .cpp files to .c or wrap the #include with a C directive like above.

                edit: just noticed it said that in the first step of the last link, :P
                Last edited by artanis; June 9, 2009, 18:52.

                Comment

                • PaulBlay
                  Knight
                  • Jan 2009
                  • 657

                  #9
                  Originally posted by artanis
                  We're including a C header from a c++ file... fix it like this:
                  That worked. I'll make the appropriate note on the RogueBasin page.

                  Now on to your other question, I am currently working on 'one and a half' projects. The 'half' project is AngEdit - intended to support multiple platforms, be easy to use and allow editing of *band variant data text files (e.g. monster.txt). Among other facilities I intend to support "easy mode" (by altering monster hit points and attack damage). Partial randomization of monster traits is another function I've been thinking about including. That will make use of FLTK and SQLite, but not TinyCurses. It's at a very early stage and I think I need to struggle on with it by myself for the meantime.

                  The other project is JBand - I 'broke' the .raw file / .txt loading system while making changes to support Unicode. I strained the left cerebral hemispheres trying to debug it so if you would take a bash at it I would be very grateful. My backup plan is to replace that section entirely and cease using .raw files (at least). Unfortunately I think it will only compile in VC++ at the moment.
                  Currently turning (Angband) Japanese.

                  Comment

                  • PaulBlay
                    Knight
                    • Jan 2009
                    • 657

                    #10
                    Originally posted by artanis
                    edit: just noticed it said that in the first step of the last link, :P
                    Only because I've just edited it in there.
                    Currently turning (Angband) Japanese.

                    Comment

                    • artanis
                      Rookie
                      • May 2009
                      • 7

                      #11
                      Originally posted by PaulBlay
                      Only because I've just edited it in there.
                      Oh, haha!

                      Originally posted by PaulBlay
                      The other project is JBand - I 'broke' the .raw file / .txt loading system while making changes to support Unicode. I strained the left cerebral hemispheres trying to debug it so if you would take a bash at it I would be very grateful. My backup plan is to replace that section entirely and cease using .raw files (at least). Unfortunately I think it will only compile in VC++ at the moment.
                      Sure, where can I find it?

                      Comment

                      • PaulBlay
                        Knight
                        • Jan 2009
                        • 657

                        #12
                        Originally posted by artanis
                        Sure, where can I find it?
                        Here - http://sourceforge.jp/projects/jband/

                        You should be able to apply to join as a project member from this page

                        (if that doesn't work I can write a "Project Help Wanted" notice)
                        Currently turning (Angband) Japanese.

                        Comment

                        • artanis
                          Rookie
                          • May 2009
                          • 7

                          #13
                          Well, I haven't got time to look further into it now, but it crashes here:
                          Code:
                          init2.c:593  init_header(&f_head, z_info->f_max, sizeof(feature_type));
                          because z_info is null. Which happens here:
                          Code:
                          init2.c:580  z_info = (maxima *)z_head.info_ptr;
                          which was nulled here:
                          Code:
                          init2.c:520  FREE(head->info_ptr);
                          I dont know the angband code at all, so I dont know what is vanilla and what you've modified... I ran out of time tonight to dig any deeper, sleep calls!

                          Comment

                          • PaulBlay
                            Knight
                            • Jan 2009
                            • 657

                            #14
                            Originally posted by artanis
                            I dont know the angband code at all
                            There is a lot of it.

                            so I dont know what is vanilla and what you've modified...
                            I've modified a lot of code* - but in that area the major modifications I've made are a) changes from char to wchar_t (when compiled in Unicode mode) and possibly b) changes to try to remove *.raw file usage.

                            Note that b) was after it had already started crashing in that general area. (And I'm not sure I actually kept any of those changes, or not).

                            I ran out of time tonight to dig any deeper, sleep calls!
                            It's 5:40am here - I haven't woken up yet. I'll look more carefully at your post when I have.

                            * Code changes have been a) to support Unicode, b) to remove compiler warnings. c) Very minor aesthetic changes (e.g. whitespace and some filename changes). No code changes intended to affect gameplay have been made and if you compare the latest Vanilla SVN code to the code in JBand they should look very similar indeed.

                            There's stuff in the JBand Wiki that you should probably read.
                            Last edited by PaulBlay; June 12, 2009, 05:51.
                            Currently turning (Angband) Japanese.

                            Comment

                            Working...
                            😀
                            😂
                            🥰
                            😘
                            🤢
                            😎
                            😞
                            😡
                            👍
                            👎