Eclipse: can't resolve BIT and P2DIR symbols?

I’m using Eclipse to (hopefully) modify the io_repeater app for my project, but I can’t get the unmodified app to compile. Errors are:

Description Resource Path Location Type
Symbol ‘P2DIR’ could not be resolved io_repeater.c /pololu-wixel-sdk-48f7737/apps/io_repeater line 71 Semantic Error
Symbol ‘P2DIR’ could not be resolved io_repeater.c /pololu-wixel-sdk-48f7737/apps/io_repeater line 71 Semantic Error
Type ‘BIT’ could not be resolved board.h /pololu-wixel-sdk-48f7737/libraries/include line 123 Semantic Error
Type ‘BIT’ could not be resolved board.h /pololu-wixel-sdk-48f7737/libraries/include line 126 Semantic Error
Type ‘BIT’ could not be resolved io_repeater.c /pololu-wixel-sdk-48f7737/apps/io_repeater line 39 Semantic Error
Type ‘BIT’ could not be resolved io_repeater.c /pololu-wixel-sdk-48f7737/apps/io_repeater line 40 Semantic Error

AFAICT, the wixel configurator works fine and I can change parameters and upload the modified app to my wixels. Am I missing a reference or header file somewhere? I’m using the latest source tree (pololu-wixel-sdk-48f7737)

TIA,

Frank

Hello.

I suspect you have configured Eclipse incorrectly.

Did you follow step 7 in our instructions?
pololu.com/docs/0J46/10.c

Could you please post the entire build output from the Console pane here?

–David

David,

Here’s the build log

**** Build of configuration Default for project pololu-wixel-sdk-48f7737 ****

make all
Compiling apps/io_repeater/io_repeater.rel
Linking apps/io_repeater/io_repeater.hex
Packaging apps/io_repeater/io_repeater.wxl
packihx: read 849 lines, wrote 412: OK.

**** Build Finished ****

As you can see, it DID compile correctly, even though I still have complaints in the editor window about unresolved symbols BIT and P2DIR. Any way to resolve these symbols to Eclipse’s satisfaction?

Playing around, I also found that I have to physically File–>Save in order to have ‘make’ take my last modifications into account. Most other IDE’s I use do a silent ‘File -->Save’ when the ‘Build’ command is invoked, but I can’t figure out how to configure Eclipse to do this.

I guess I have been over in the Microsoft Visual Studio world too long - I can no longer figure out how to get ‘make’ to do what I want :wink:.

Frank

PS: I think I’ve noticed that the ‘replies’ counter on the Forum doesn’t update, or doesn’t update very quickly. I have found myself checking back to the forum every few minutes to see if there is a reply, even though the replies counter is still at zero

Yeah, you’ll want to memorize the shortcut keys for saving and building: Ctrl+S, Ctrl+B.

–David

I looked into this more and it turns out the new version of Eclipse, which is called Eclipse Indigo and was released in June, has more advanced code analysis features that provide new warnings when they find something wrong in your code. Of course, these aren’t real problems, because the code compiled fine. I have made several little changes to the Wixel SDK to fix get rid of most of these new warnings. You can get the latest version from our github repository or you can simply disable the warnings in Eclipse by going to Window -> Preferences -> C/C++ -> Code Analysis and then unchecking the appropriate boxes.

–David

Another run at fixing the ‘Can’t resolve BIT and P2DIR’ problem:

I removed Eclipse from my system (no UNinstall, but I was able to confirm that simply removing the ‘eclipse’ directory tree did the trick).

Re-installed Eclipse by unzipping the download into a fresh directory tree.

Created a new ‘eclipse_workspace’ folder and moved 'pololu-wixel-sdk-48f7737 into it

step 3: Launched eclipse and selected the new folder as the workspace. Clicked on the ‘go to workbench’ icon at the welcome screen (step4)

step5: Selected File --> New --> C Project Entered ‘pololu-wixel-sdk-48f7737’ as the project name, and got the ‘Directory exists’ warning.

Step 7: Under project type, selected 'Makefile project --> Empty Project. Selected ‘Cross GCC’ as the toolchain

Step 8: Clicked ‘Finish’: AFAICT, Eclipse did NOT run make or compile the project - instead the project showed two warnings, as follows:

Error launching external scanner info generator (gcc-…)
Program ‘gcc’ is not found in $PATH (because I chose the Cross GCC toolchain?)

Step 10: Navigated to the ‘example_blink_led’ app folder, loaded ‘example_blink_led.c’ into the editor window, and noted that there were 5 errors shown - all were 'Symbol P2DIR could not be resolved errors. There was also a question mark icon by ‘<stdio.h>’ which expanded to say ‘unresolved inclusion’.

Step 11/12: made a change to the code and then saved it - then selected Project --> Build All: example_blink_led was compiled successfully, but the ‘unresolved symbol’ problem remains.

Any other thoughts? I haven’t added ‘load.bat’ for uploading apps from Eclipse directly to the wixel, and I haven’t hidden any of the unused features as suggested in your documentation.

Frank

Please see the post I made a few minutes ago.

–David

David,

I dl’d and installed the new github package, and now the BIT and P2DIR symbol errors are gone - Thanks!!. However there is still an ‘unresolved inclusion’ error associated with <stdio.h>

Regards,

Frank

How obtrusive is the unresolved inclusion error? When I try to reproduce it here, the only symptom of the error is that Eclipse puts a yellow underline on that line of code and if I hover over it I will see the error message. It doesn’t seem to put that message in the Problems pane.

If you want to fix it, go to Project -> Properties -> C/C++ General -> Path and Symbols -> Includes. Click “Add…”. Enter the name of the directory where stdio.h is. This should be “C:\Program Files (x86)\SDCC\include” or “C:\Program Files\SDCC\include” if you installed SDCC in the default location. Check the “Add to all configurations” and “Add to all languages” boxes. Click OK on both dialog boxes. If Eclipse asks you whether you want to rebuild the index, click Yes.

–David