This is really making mad. I'm trying to add two numbers. This is a basic code that I can't get to compile.
#include <stdio.h>
#include <stdlib.h>
extern int addus(int,int);
int main() {
int a;
int b;
int result;
a=5;
b=6;
result = addus(a,b);
printf("Your value is: %d", result);
return EXIT_SUCCESS;
}
.globl _addus
_addus:
push %ebp
movl %esp, %ebp
movl 8(%ebp), %ecx
addl 12(%ebp), %ecx
movl %ecx, %eax
movl %ebp, %esp
popl %ebp
ret
Here is my error.
**** Build of configuration Debug for project Trial447 ****
**** Internal Builder is used for build ****
gcc -O0 -g3 -Wall -c -fmessage-length=0 -osrc\Trial447.o ..\src\Trial447.c
gcc -oTrial447.exe src\Trial447.o
src\Trial447.o: In function `main':
C:/Workspace/Trial447/Debug/../src/Trial447.c:24: undefined reference to `addus'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 1062 ms.