Author Topic: TIGCC kbd_queue problem  (Read 7566 times)

0 Members and 1 Guest are viewing this topic.

Offline Jonson26

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 118
  • Rating: +1/-0
  • Follow cat! Do what cat! Into tree! Now!
    • View Profile
TIGCC kbd_queue problem
« on: October 13, 2017, 04:32:23 pm »
Well, I started into tigcc  programming, and i am unable t compile this example. Has anyona an idea why?
Code: [Select]
#include <tigcclib.h>

void _main(void) {
    void *kbq = kbd_queue();
    unsigned short key;
    unsigned long count = 0;

    // clear the screen
    clrscr();

    // print the string telling the user to press a key
    printf("Please press a key.\n");

    // while no key was retrieved from the keyboard queue
    while (OSdequeue(&key, kbq)) {
        // increment the variable number by one
        printf("Queue Check: %lu.\n", count);
        ++count;
    }
   

    // tell them what key they pressed
    printf("The keycode was %hu\n", key);

    // wait for input before exiting
    ngetchx();
}

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: TIGCC kbd_queue problem
« Reply #1 on: October 14, 2017, 01:39:56 pm »
It would help if you included the compiler output.
/e

Offline Jonson26

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 118
  • Rating: +1/-0
  • Follow cat! Do what cat! Into tree! Now!
    • View Profile
Re: TIGCC kbd_queue problem
« Reply #2 on: October 14, 2017, 04:16:28 pm »
Well.. I only get this one error:
Quote
Unresolved reference to 'OSdequeue'.

Offline 123outerme

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 458
  • Rating: +23/-0
  • Self-unpaid intern
    • View Profile
Re: TIGCC kbd_queue problem
« Reply #3 on: October 14, 2017, 05:07:42 pm »
Well.. I only get this one error:
Quote
Unresolved reference to 'OSdequeue'.
That usually signifies a missing -l(library) argument, forgetting to #include something, not having the library files in the right places, or the PATH variables being wrong. Try any of those things and you'll probably fix it.

Offline TravisE

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 182
  • Rating: +33/-0
    • View Profile
    • ticalc.org
Re: TIGCC kbd_queue problem
« Reply #4 on: October 14, 2017, 08:05:34 pm »
Are you using TIGCC, or GCC4TI? What version is it, how is your environment set up, and how are you running the compiler?

I have no problem compiling the example myself with GCC4TI on the command line in my Linux system (after adding the appropriate #define USE_TI89/USE_TI92PLUS/USE_V200 lines to the source). It's possible your installation or setup may be misconfigured somehow.
ticalc.org staff member—http://www.ticalc.org/

Offline Jonson26

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 118
  • Rating: +1/-0
  • Follow cat! Do what cat! Into tree! Now!
    • View Profile
Re: TIGCC kbd_queue problem
« Reply #5 on: October 16, 2017, 01:08:34 pm »
Sorry for the slow response time (school & stuff). I'm on WinXP pro sp3 and I'm using TIGCC v 0.98 Beta. I installed it using an exe installer.
Edit: Re-installed Tigcc as 0.95 (non-beta). I still get hte same error, though.
Edit 2: I tried gcc4ti. Didn't work neither. Maybe i'll try it on win7?
« Last Edit: October 16, 2017, 05:20:06 pm by Jonson26 »

Offline Jonson26

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 118
  • Rating: +1/-0
  • Follow cat! Do what cat! Into tree! Now!
    • View Profile
Re: TIGCC kbd_queue problem
« Reply #6 on: October 27, 2017, 01:54:59 pm »
So... I tried it on windows 7. Guess what? I got exactly the same error...  :-\
Oddly enough, if i download the project folder directly from technoplaza, then it does indeed compile...
I'm really perplexed....

Just to be sure: the code i use in the project i created is exactly the same...



BIG Change (that's why i decided to make a standalone post):
After i added #define USE_V200 at the beginning it somehow worked ;D... Still, it's something VERY odd.

Edit (Eeems): Merged double post
« Last Edit: October 27, 2017, 04:35:50 pm by Eeems »

Offline TravisE

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 182
  • Rating: +33/-0
    • View Profile
    • ticalc.org
Re: TIGCC kbd_queue problem
« Reply #7 on: October 27, 2017, 05:10:26 pm »
It may have to do with the project settings, if you're using the IDE and .tpr files. I'm no longer familiar with that since on Linux, TIGCC/GCC4TI comes as a command-line tool only (there used to be the KTIGCC IDE, but it uses obsolete KDE 3 libraries that have not been available in popular distros for ages).

I do seem to recall that the compiler can be picky about including the proper constants in the source files like one or more of USE_TI89/USE_TI92PLUS/USE_V200, and sometimes MIN_AMS (if you're using features introduced after the very first AMS 1.01 version).

On an unrelated note, I would recommend sticking with GCC4TI, as it was updated much more recently than TIGCC. The latest version of TIGCC I know of was released an entire decade ago.
ticalc.org staff member—http://www.ticalc.org/