Apologies if this question has been asked before, but all other threads are so old that it was advised to start a new thread.
As the title suggest, i'm having trouble linking files in Code::Blocks(Linux OS). I had the same problems back when i was using Windows. Error message is of undefined reference, even though i have the header file includes correct.
Example code:
main.c
#include "lib.h"
int main()
{
printWorld();
return 0;
}
lib.h
void printWorld();
lib.c
#include <stdio.h>
#include "lib.h"
void printWorld()
{
printf("Hello World!\n");
}
Is there a way to automatically link all include files, like what Mono is able to do. I would use Mono, but when it comes to accepting user input, it simply skips the steps and runs the program until it terminates, without taking user input.
Thanks in advance for any help with this.