This is the first time I've used Eclipse for writing C code, so the answer might be very simple. I'm also figuring that Eclipse is already setup to compile, build, and link appropriately. This is being ran on a Windows 7 64-bit machine.
In my C code, it seems that anytime I use the malloc()
or even printf()
function it puts the red squiggly line below it. Just the function is underlined, not the casting or even the parameters.
Here is what the line of code:
#include <stdlib.h>
#include <stdio.h>
int* list; //This is a global variable
int main(){
//...inside a function
list = (int*) malloc( sizeof(int) ); // Out of this line, only the word "malloc" is underlined in red.
printf(""); //printf also gives me an error
return 0;
}
When I hover my mouse over the error, it says the following:
Function 'malloc' could not be resolved.
Am I even using malloc()
right?