NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » make: *** [portplay.hex] Error 1
February 10, 2013 by Nichben ![]() |
I get this when I try to compile this program. When I remove the while loop or substitute a literal for the second variable it compiles and runs fine. I've installed WinAVR on my PC with Windows Vista. Here's my program:
All the .c and .h files are in libnerdkits folder. This has only started this evening after almost a year of trouble free programming. Thanks. |
---|---|
February 11, 2013 by Noter ![]() |
You have the -lm in your make file but it needs to follow your source/object references as shown here:
Also, as a matter of practice, the return 0 at the end of your source is useless. It follows an endless loop so will never be executed and even if it was, there is nothing to return to. |
February 12, 2013 by Nichben ![]() |
Hi, I've tried your suggestions but still get the same problem. In my program, portplay, if I change line 42 to itr = idx; it works but not as it's given here even with the changes to the makefile. I've also tried the original makefile from nerdkits that was included in the libnerdkits folder that i downloaded from nerdkits when I first bought my nerdkit with the ATMega168 mpu. I made the necessary changes in my program before doing so. Next I changed that original makefile for the 168 according to your suggestion and this too didn't work. I've even tried changes to the arguments in pow(2, pr) from integer to double types and this didn't have an effect either. Here is the makefile for the ATMega328 with your advised changes.
Please let me know if I can fix this. I've had similar problems in other programs that involved the use of pow(x,y) function. When I assign it to a variable and try to pass the value to another function or to a loop I get the same Error 1. I've even tried to pass the reference to a function or loop to no avail. |
February 12, 2013 by Noter ![]() |
I'm not sure what you've tried but you want to use pow() like you are then you have to move the linkflags to follow the .c and .o in your make file - like this:
|
February 12, 2013 by Nichben ![]() |
Working now. many thanks. |
Please log in to post a reply.
Did you know that NerdKits has a TV commercial, seen on MythBusters and the Science Channel? Learn more...
|