|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
WPILib and Eclipse
I was trying to get WPILib working with Eclipse. Following the instructions here, I installed mingw, c18 compiler, CDT, and the two plugins. However, I can't find the right option to create the project, and am stuck there. What am I doing wrong?
Thanks. |
|
#2
|
|||
|
|||
|
Re: WPILib and Eclipse
You must first make sure you copied the two plugins from the .zip file downloaded from the WPILib page into the Eclipse "plugins" directory and restarted Eclipse so they are registered. Note: you must extract the plugin .jar files from the .zip file provided on the WPILib page.
To create a new project:
You will also have to follow the instructions on the WPILib page concerning search and include paths, as well as the linker file and library order. These can all be checked/adjusted in the Project Properties dialog. (Right-click on the project object in the left-hand "Project Explorer" pane and select "Properties"). HTH. If you have more specific questions beyond that, please post again. |
|
#3
|
|||
|
|||
|
Re: WPILib and Eclipse
Thanks. It works now. I guess I either misssed the option before, or had to relocate the plugins to make it work. Unless it fails to complie or anything like that, I think it should work now.
How exactly do I compile? I found the myriad of options under Project, but I have no idea where they built file goes when I either Build All or define a Make Target. Any idea? Last edited by Guy Davidson : 22-10-2007 at 16:41. |
|
#4
|
|||
|
|||
|
Re: WPILib and Eclipse
Now you're getting more into the specifics of how Eclipse works, and that's pretty well documented (including steps and examples) in the Eclipse "C/C++ Development User Guide". I recommend you check it out.
Your WPILib project will work just like any other Eclipse C/C++ project; just trust the plugins to create the project for you and make all the right property settings. If you create a project and just add a simple WPILib example file, it should compile and link with no changes required to the Project properties. After you compile and link, the generated objects and .hex file will be placed in a subdirectory under your project directory, and will be named based on the toolchain that you chose to use (e.g. mine is called "vEx WPILib Robot"). This allows you to use the same project directory and source files for multiple projects (e.g. a Vex project and an FRC project can use the same code; they just need to be compiled and linked differently). You'll still need to use either the IFI Loader or the one that comes with EasyC to move the .hex file to the robot. Note that you can use the Loader that comes with EasyC (and take advantage of its graphics terminal capability) without actually having an EasyC license on your machine. Just use the graphics terminal routines available in WPILib. HTH. |
|
#5
|
|||
|
|||
|
Re: WPILib and Eclipse
Thanks again for your help. I'm almost getting there. I had to mess around with the path variable and eclipse settings a bit, but I got forward. Right now though, I'm getting another error I haven't been able to figure out by myself:
**** Build of configuration vEx WPILib Robot for project test **** mingw32-make 'Building target: test.hex' 'Invoking: MPLINK Linker' mplink "..\18F8520.lkr" /a INHX32 /w /m FRCMapfile.map /o"test.hex" ./main.o /l"C:\mcc18\lib" ..\Vex_library.lib ..\WPILibVex.lib MPLINK 4.12, Linker Copyright (c) 2007 Microchip Technology Inc. Error - Could not find linker command file '..\18F8520.lkr'. Errors : 1 mingw32-make: *** [test.hex] Error 1 I have no idea how to tell it where said linker file is, and I have four files on my machined named "18F8520.lkr": one in the MPLAB\LKR folder, one in the MCC18 folder, and two others in WPILib folders - one in the \2k5 and another in the \Vex. Although there's no one in the \2k6, and I'm using a pretty new installation of mcc18. Could this be a problem? How do I solve this issue? Thanks again for your help. |
|
#6
|
|||
|
|||
|
Re: WPILib and Eclipse
Oh yeah... I forgot that the project wizard plug-in assumes that your project directory is a subdirectory of one of the toolchain directories under WPILib: \2k5, \2k6, or \Vex. That's why it's looking for "..\18f8520.lkr".
For a Vex project, you want to use the .lkr file in the \Vex directory. To get your project to look for it in the right place, go to: - Project Properties dialog - Left hand tree: C/C++ Build -> Settings - Tool settings tab - Left hand tree: MPLink Linker -> Linker Information - Specify your Linker file pathspec in the top list box - You can also add library search paths in the second box, and don't miss the "Libraries included in Linking" list box at the bottom (you may have to scroll to see it). HTH. |
|
#7
|
|||
|
|||
|
Re: WPILib and Eclipse
It's not really working either. The only way it works as of now is if I have my source files in the WPILIB\Vex folder, and by works I mean this generates a different error. Now, the error is something with the ifi_libraries.o being out of date. I'm pretty sure this is happening because I am usign the mcc18, rather than the older one. I guess I'll have to find one of our CD's with mcc18 v2.4.
|
|
#8
|
|||
|
|||
|
Re: WPILib and Eclipse
Yes - you definitely need to have the 2.40 version of mcc18. Newer versions are incompatible with the IFI-provided libraries (plus they cost real money after the trial period
I think if you poke around in the Eclipse project properties box, you'll eventually figure out how and where to put things. I'm still trying to figure out the best organization for my team (FRC, using Vex for prototyping), so maybe when I settle that I'll try to post my findings (and project files) here. |
|
#9
|
|||
|
|||
|
Re: WPILib and Eclipse
Still no luck. I got my hands on a copy of the c18 compiler, and now tried to build it, and now I'm getting a new error:
**** Build of configuration vEx WPILib Robot for project Vex **** mingw32-make all 'Building target: Vex.hex' 'Invoking: MPLINK Linker' mplink "..\18F8520.lkr" /a INHX32 /w /m FRCMapfile.map /o"Vex.hex" ./main.o /l"C:\mcc18\lib" ..\Vex_library.lib ..\WPILibVex.lib MPLINK 3.90, Linker Copyright (c) 2004 Microchip Technology Inc. Error - Coff file '././main.o' does not appear to be a valid COFF file. Errors : 1 mingw32-make: *** [Vex.hex] Error 1 main.c is my source file. Could this imply a problem with my code? Or what am I looking at? |
|
#10
|
|||
|
|||
|
Re: WPILib and Eclipse
I'm not sure if this is the solution, but try changing the link order of the Vex_library.lib and WPILibVex.lib - I think you have them backwards.
|
|
#11
|
|||
|
|||
|
Re: WPILib and Eclipse
Error - Coff file '././main.o' does not appear to be a valid COFF file.
That last COFF file error might be that the program is being compiled with the new microchip compiler rather than the 2.4 (I think) compiler that comes with the kit. The object file formats are incompatible. |
|
#12
|
|||
|
|||
|
Re: WPILib and Eclipse
Mr. K, I'll try that. If that doesn't work, I might restart the process on another computer, and see if I can get it to work there. Unless I get a different error message.
Bard, I would be surprised if that's it. I removed mcc18 v3.0, completley deleted the folder, and installed v2.4 from the cd that comes in the kit. Any other ideas? |
|
#13
|
|||
|
|||
|
Re: WPILib and Eclipse
I'm stuck in the same place Sumadin & NSolarz were, in their first posts. After installation, and I am about to open my first project, there is no "project type" named "Microchip Embedded Systems" to open. I believe my mistake is also in the "path". Would someone please check these out. Thanks
From "My Computer" C:\ "System Properties" dialog box: "User Variables for Bill" PATH C:\MCC18\mpasm;C:\MCC18\bin;C:\MCC18\mpasm;C:\MCC1 8\bin; TEMP %USERPROFILE%\Local Settings\Temp TMP %USERPROFILE%\Local Settings\Temp "Systems Variables" (I think this is the problem) PATH C:\MCC18\mpasm;C:\MCC18\bin;C:\MCC18\mpasm;C:\MCC1 8\bin;%SystemRoot%\system32;C:\WINDOWS\System32;C: \MinGW\bin I was using the instructions from this White Paper and then added the 2 plug-ins from "WPLib". Also I am using C18 v2.20 and the MPLAB v6.62 Thanks again Bill Last edited by Capt. Quirk : 07-12-2007 at 01:18. |
|
#14
|
|||
|
|||
|
Re: WPILib and Eclipse
Screen Shot
Last edited by Capt. Quirk : 07-12-2007 at 01:34. |
|
#15
|
|||
|
|||
|
Re: WPILib and Eclipse
One more
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Eclipse Development | Astronouth7303 | Programming | 39 | 16-12-2007 02:52 |
| "Full screen mode" in Eclipse/Easy Eclipse | Kelly | Programming | 0 | 15-07-2007 16:37 |
| Direct Control of PWMs and OI in WPILib | CyberWolf_22 | Programming | 7 | 06-02-2006 19:06 |
| using eclipse | dasRatsel | Programming | 82 | 02-01-2006 13:20 |