Omnimaga
Calculator Community => TI Calculators => Calculator C => Topic started by: Jonson26 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?
#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();
}
-
It would help if you included the compiler output.
-
Well.. I only get this one error:
Unresolved reference to 'OSdequeue'.
-
Well.. I only get this one error:
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.
-
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.
-
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?
-
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
-
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.