Printi() not working?
Sapphire
Posts: 496
I tried using printi() in a program and I get a build error: undefined reference to `_printi'
So I wrote this program using SimpleIDE to test it. I included the simpletext.h file, but still get the error. What am I missing?
So I wrote this program using SimpleIDE to test it. I included the simpletext.h file, but still get the error. What am I missing?
/* Blank Simple Project.c http://learn.parallax.com/propeller-c-tutorials */ #include "simpletools.h" // Include simple tools #include "simpletext.h" // Include simple text int main() // Main function { print("Print test: %d\n",1); // this works printi("Printi test: %d\n",2); // THIS DOESN'T WORK! }
Comments
I had updated my learn folder this week to the 8-27-14 version (and just did it again now) but still get the same error. The SimpleIDE version is 0.9.64.
Do you have any "library" folders in your project folder? If so move them to another folder or remove them entirely. Presumably they would only appear because they were zipped in the first place.
There have been different versions of Simple Libraries with different functions, and the Zip feature tries to put the libraries used at Zip time in the Zip for being able to recompile the program at some later time. The problem with this approach which I begged to not implement is that old libraries can end up in bad places. This issue comes up again, and again.
The library rule is that if a project folder contains a library set, that folder will be searched first. If there are no library folders, then the SimpleIDE program will search SimpleIDE/Simple Libraries/Learn folder.
The "third most likely cause" of the problem is in having "Auto Include Simple Libraries" unchecked. Please ensure that "Auto Include Simple Libraries" is checked in the Properties -> General tab (this setting is sticky in one SimpleIDE version, but by design it should never be or have been sticky). There are times where we don't want this to be selected, but those times are rare and can cause more trouble for the target audience. The same goes for many other decisions made in SimpleIDE behavior for the Learn program.
Thanks for your reply. The check box to Auto Include Simple Libraries is checked. The Projects check box is not checked.
I'm not sure where to look for the duplicate libraries in my projects, but I did find this: there are two Text Devices folders in the \Documents\SimpleIDE\Learn\Simple Libraries folder, one called "Text Devices" and one called "TextDevices" (without a space). The latter is much older. Is this the library I should remove?
In case this helps, here is the build error log:
Success. It builds fine now. Thank you very much for enlightening me on this one!