Results 1 to 6 of 6
Hi guys,
ive got a problem, im a first year computer sciences student and im just goin over work at home and im getting this error,
Code:
prog3.c:(.text+0x16): undefined reference ...
- 02-13-2010 #1Just Joined!
- Join Date
- Feb 2010
- Posts
- 2
C noob.
Hi guys,
ive got a problem, im a first year computer sciences student and im just goin over work at home and im getting this error,
the code is,Code:prog3.c:(.text+0x16): undefined reference to `getInt' prog3.c:(.text+0x2b): undefined reference to `getInt' prog3.c:(.text+0x40): undefined reference to `getInt' prog3.c:(.text+0x55): undefined reference to `getChar' prog3.c:(.text+0x6a): undefined reference to `getChar'
Code:#include <stdio.h> int main() { int a, b, c; char d, e; printf("Please input a value \n"); a = getInt(); printf("Please input a value \n"); b = getInt(); printf("Please input a value \n"); c = getInt(); printf("Please input a Char \n"); d = getChar(); printf("Please input a Char \n"); e = getChar(); printf("Equality example:\n"); printf("\tIs a equal to b? (0==0) %d (true) \n", a==b ); printf("\tIs d equal to e? (A==a) %d (false)\n", d==e ); printf("Inequality example:\n\tIs a not equal to c? "); printf(" (0!=1) %d (true)\n", a != c ); printf("Greater than example:\n\tIs a greater than c?"); printf("(0>1) %d (false) \n", a > c ) ; printf("Less than example:\n\tIs a less than c?"); printf(" (0<1) %d (true) \n", a < c ); printf("Greater than or equal to example:\n"); printf("\tIs a greater than or equal to be? "); printf(" (0>=0) %d (true) \n", a >= b ); printf("Less than or equal to example:\n"); printf("\tIs c less than or equal to a? "); printf("(1<=0 %d (false) \n", c <= a ); return 0; }
i really am a noob so any advice would be apreciated.
cheers =)
- 02-13-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Where is the functions getInt() and getChar() declared & defined?
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 02-13-2010 #3Just Joined!
- Join Date
- Feb 2010
- Posts
- 2
hmm we use simpleio.h at uni but i havent got it on my home computer, would this be why?
- 02-13-2010 #4
most likely, if that is where those functions are defined you need to include that header to use it, you should be able to copy the file to a flash drive on a uni computer and bring it home though
- 02-13-2010 #5Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Yes. You need the header as well as the library (either shared or static) that contains the implementation of these functions. Also, if the platforms are incompatible (your system and school's), then you will need the source code of that library to compile on your system, or a copy that is compatible with your system.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 02-19-2010 #6Just Joined!
- Join Date
- Feb 2010
- Posts
- 2


Reply With Quote
