Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

undefined reference header file in proteus

okbro

Member
Hello,
I have a simple LCD to arduino program in proteus. When all the lcd code is put inside the main.ino it works but when i put the lcd codes in seperate header file lcd.h and c file lcd.c file and reference them in the main.ino it won't build with error saying undefined reference to... as shown in the below.
1.jpg


in main.ino i have the header file included as shown above. the header file and c file were added using right click on the project panel so proteus places them automatically in the folder ARDUINO UNO_1 which was created automatically and the files resides within it as shown.

2.jpg

Can anybody help to know the problem and how to resolve?

btw the same situation works with atmega32 with LCD files in separate files from main.c
thank you
 

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
If you look at your output, It is clearly looking in //debug folder for the header file. If you look in the "debug" folder the INO will be in there already.. Just copy the LCD files in to that folder.
 

rjenkinsgb

Well-Known Member
Most Helpful Member
Note the double dot part /../
That takes it up a level from the previous directory, so back to ARDUINO UNO_1
It appears to be looking for the file there?
 

mramos1

Active Member
I have never used VSM studio. If Arduino, I could help. The .. might make me think the project/source could be a level low than it wants maybe and it's going up to search down.
 

mramos1

Active Member
Look in a sample project or old project, see the name of the folder with the header files and create one in that project, then move the .h file and you should be fine. Make sure it's in quotes, the lcd.h
 

Latest threads

Top