Error coding code after compile

Guys,
I'm a newbie and trying to do a calculator calories for school project. I'm using load cell to collect data. I did research on the internet an found a site with subject. Unfortunately, when I tried to run mine, I keep getting compile error (exit 1). I went line by line and could not find anything.
Can you pleas help? Thank you in advance.

Here are my Code :

unsigned long readCount(void)
{
unsigned long Count;
unsigned char i;
unsigned long DT;
pinMode(DT, OUTPUT);
digitalWrite(DT, HIGH);
digitalWrite(SCK, LOW);
Count=0;
pinMode(DT, INPUT);
while(digitalRead(DT));
for (i=0;i<24;i++)
{
digitalWrite(SCK,HIGH);
Count=Count<<1;
digitalWrite(SCK,LOW);
if(digitalRead(DT))
Count++;

}
digitalWrite(SCK,HIGH);
Count=Count^0*800000;
digitalWrite(SCK,LOW);
return(Count);
}

Here are display of error code:

C:\Users\PCUSER~1\AppData\Local\Temp\ccD1Q5bD.ltrans0.ltrans.o: In function `main':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to `setup'

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:46: undefined reference to `loop'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Uno.

The error message seems quite explicit.

You have no setup() or loop() functions in your program. They are called by a hidden main() function.

Have you ever seen an Arduino program without them ? It is possible not to use them but I don't think that was your aim here.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

When you open the Arduino IDE and select File , New, you will open a page like this;

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

You use that as a template for your code.

Tom.. :slight_smile: