Problem iIn Making Header in Arduino

Hello all
First sorry for poor English :frowning:
I want to write a header for using in Arduino.
My header has also another header Wire.h the same as below.
But when I compile the program I have errors the same as bellow.
If somebody can , please help me.
Thanks.

//Errors:

c:/programfiles(x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.8.1/../../../../avr/lib/avr5/crtmpo:(.init9+0x0): undefined reference to `main'collect2.exe: error: ld returned 1 exit status
Error compiling.

Sorry .but what should I do?

Nobody is to answer me .please
I'm here to get answer.thanks

Sorry .but what should I do?

Write your code properly. This is NOT the way to include a header file:

#include "C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\Wire.h
#include <Wire.h>

or

#include "Wire.h"

is.

Nobody is to answer me .please
I'm here to get answer.thanks

Whining after 11 minutes? Give it a rest kid!

I tried this way ,but when I compile , it doesn't.
It can not find the direct of file. It is true for string.h or studio.h or Arduino.h but for Wire.h It is not.

Hi guys :wink:
I want to define a header that inside that I'm using function related to Wire.h header.
But when I use my header in arduino ,it doesn't compile and has the error "can not find direct of Wire.h".
It has no error when I use Arduino.h in my header or string.h , but about Wire.h and spi.h it has that error.
If somebody know, please help.
Thanks :wink:

You mean in this way can I use Wire.h functions in my header.?

Thanks dear Delta.
I'll go on it.

Anyone answer?

Okay Mark. But I should solve this problem.please guys.

You have posted this problem in several crossposts. I have put the solution to it in one of the other posts that you did.

How many blasted threads did you start? Get a grip man.

Please do not cross-post. This wastes time and resources as people attempt to answer your question on multiple threads.

Threads merged.

leoncorleone:
Anyone answer?

You are wasting about 15 minutes of my time merging all these threads. Have some consideration for other people, I don't care how urgent it is to you.

How to use this forum

Please use code tags.

Read this before posting a programming question


Another cross-post and you will get a week's time-out.

leoncorleone:
Okay Mark. But I should solve this problem.please guys.

You should read how to use this forum, that's what you should do.

How to use this forum

First:

In your #include statement, use angle brackets if the file is part of the standard arduino library (Wire.h), and use quotes if the include file is part of the project.

Your other problem - as far as I cam make out - is that you declare that I2CHasan has a function named I2CBegin, but you don't define that function anywhere. Now, I can see that this function is defined in I2CHasan.cpp, so it seems that this cpp file isn't being "linked" into the executable.

Not sure how that gets done in the arduino IDE.

Sorry about wasting your time.I don't have any purpose
From now I'll consider all thing.
Thanks for reminder.

//Main.ino
#include <I2CH.h>
#include <string.h>

void setup() {
}

void loop() {
}

Code tags, buddy.

Please edit your post, select the code, and put it between [code] ... [/code] tags.

You can do that by hitting the "Code" icon above the posting area. It is the first icon, with the symbol: </>