undefined reference header file in proteus

Status
Not open for further replies.

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.


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.


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
 
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.
 
Open the debug folder.. Then look at the folders in there... tell us where main.ino is located.

This line

is pointing to the debug folder and possible subdirectories..
 
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?
 
I always thought that arduino was very fussy about "where it's files" are located..
I also thought the naming convention of directories was a ball ache..
 
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.
 
I do not have the Arduino license so I cannot even make a project... VSM is just an IDE.. The rules of play are down to each compiler / linker..
 
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
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…