Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

error using header file

+1 vote
asked Jul 24, 2019 by amitai (140 points)
Hello,

I'm trying to simulate some project, for which I have

copied some functions to the main (C) file and add

some header file. I'm getting error of "undefined reference to `Scanner'".

Here is the link to the project -

https://onlinegdb.com/Hk7h7jrGS

Am I doing something wrong here?
Thanks , Amitai

2 Answers

0 votes
answered Jul 25, 2019 by Saddam Hussain
You are using Scanner class from java. And you are compiling that  in C, change your compiler to java and try again...
+1 vote
answered Jul 26, 2019 by Jun
You have not declared a "Scanner" struct as a variable anywhere in your main program. I suppose you need to start it as a global variable.

on file main.c:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "step.h"

struct SCANNER Scanner;
struct STEP_MOTOR StepMotor;

/*always declare your functions before*/

void FillSmoothPointSection (int *temperature, int *currentStep);
void WriteToScannerSamplesArray(int temperature, int currentStep);

/*here you start you main function*/
int main(){

...
}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...