NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Support Forum » Error during compilation of tempsensor code
January 16, 2011 by jpower |
Hi all, I'm having trouble compiling the tempsensor project code. I'm fairly certain the problem isn't in the .c file itself, as the same problem occurs when attempting to compile the pre-written file that came with the nerdkits download. Here's what I'm getting:
The error seems to result from the first line of the makefile:
But I've no idea what any of that means... If it helps, I'm using windows Vista, according to the installation steps recommended by the Nerdkits team. Does anyone have any idea what's going wrong? Cheers! J |
---|---|
January 16, 2011 by Rick_S |
The makefile expects the files to be in certain places in relationship to each other. If that folder structure isn't there, you will not be able to complile because critical components of the code will be missing. |
January 17, 2011 by jpower |
Thanks Rick, I originally extracted the entire 'Code' folder tree into the WinAVR directory, and the complilation of the 'initiaload' program worked just fine from there. I tried your suggestion and redownloaded+extracted the nerdkits sample source code to C:Code, but the same problem is still occuring. I triple checked that I was using the code from the C:Codetempsensor folder. Any other ideas? |
January 17, 2011 by Rick_S |
It's odd to get that error with fresh files. Typically that error would be generated if the include for stdio.h wasn't around. Just for curiosity, does your initialload file still complile? I'm beginning to suspect the environment for WINAVR isn't right. The Windows environment System PATH variables have to be set for make to find the WinAVR includes. It sounds like they are not set right. When you installed WinAVR, did you right click and install as administrator? For it to install proplerly, that needs to be done. Even if you did, maybe uninstall and reinstall WinAVR, it'd only take a few minutes and may cure your woes. If that doesn't, maybe someone else can pop in and provide suggestions. |
January 20, 2011 by hevans (NerdKits Staff) |
Hi Jpower, Did this problem get resolved? It is definitely strange that you get this error with a fresh copy of the code. It could point to a wonky install of WinAVR. Could there be some sort of permissions issue you are running into? Humberto |
January 20, 2011 by jpower |
Thanks for the suggestion guys :) I haven't tried it yet, but I'll give it a go before tomorrow afternoon and let you know how it plays out. Also Rick, the initiaload file still compiles just fine. Cheers, Josh |
January 23, 2011 by jpower |
Hi guys, I uninstalled winAVR and reinstalled using 'run as admin', but I'm still encountering the same problem. Can you recommend another compiler that would work with your files? Thanks, Josh |
January 23, 2011 by hevans (NerdKits Staff) |
Hi jpower, This is a very strange problem you are having. Although there are other tool chains available out there I would like to have you setup and working with this one since it is the one we all know and can help you work with. I am confused by the fact that your initialload works fine. Could you go into the initialload folder and delete all the .o and .hex files in there, and try compiling again. Just so we can make absolutely sure could you post the first 10 lines or so of your tempsensor.c file. I'd like to make sure the proper includes are there. Humberto |
January 25, 2011 by jpower |
Hi Humberto, I deleted the .o and .hex files in the initiaload directory, and the program still compiled just fine. The original problem is still occuring with the tempsensor program. Here are the include lines from the tempsensor file:
Would including the contents of the makefile help also? Thanks, Josh |
January 25, 2011 by hevans (NerdKits Staff) |
Hi Josh, The includes look intact. Go ahead and post the contents of the Makefile for us too. The problem may be in there. Humberto |
January 31, 2011 by jpower |
Thanks again guys, Here's the makefile:
I hope this helps! Josh |
February 03, 2011 by rampraba |
Hi, I am trying to compile the 'tempsensor" code but i am getting a error message as '_FDEV_SETUP_WRITE'undeclared and subsequently '_FDEV_SETUP_RW'. Kinldy let me how to resolve this error message. I could able to successfully compile Led_blink. Thanks, Ram |
February 03, 2011 by rampraba |
Hi, This is regarding my earlier post on the error message while compiling tempsensor. "FDEV_SETUP_WRITE" undeclared. I tried to copy the stdio.h file to libnerdkits and declared it in the tempsensor file and it worked fine. I could able to compile tempsensor successuly. I already have a c compiler in the computer and while compiling the system i think it is trying to access the standard stdio and not the avr stdio.h file. Thanks, Ram |
February 03, 2011 by rampraba |
Hi Josh, I think you already have a c compiler in your system. Try copying the stdio.h file from avr and paste it in libnerdkits and declare it in the tempsensor.c file. include "../libnerdkits/stdio.h". Add # symbol before include and recompile it. It should work. Thanks, Ram |
February 12, 2011 by jpower |
Brilliant:) Thanks Ram, that solved it just fine. I do have another C compiler installed, that'd be a good one to keep an eye out for in future! |
Please log in to post a reply.
Did you know that you can make a capacitive proximity sensor with some aluminum foil and paperclips? Learn more...
|