manderson5192
29-12-2008, 01:41
Hey guys,
I'm setup to program in C++ with WindRiver workbench and I'm able to get all the example programs to compile just fine. I just got started on a new project today, though, trying to modify the WPIlib source files RobotDrive.cpp and RobotDrive.h in my project. I have copied them from the WPIlib project (downloadable from the WPI website) into my project, which is a SimpleRobot.
From reading the C Programming Guide, I assume that one is able to do just this, make modifications to the added WPIlib files, and then everything will magically compile (see page 76 in the guide). Clearly, though, this is not the case (at least in my case :yikes: ).
As far as I can tell, there are no syntactical errors that would keep my code from compiling, and yet I am still getting errors when I go to build the project. There are four functions that each generate two errors in what appears to be the link step (I may be wrong on that one) and the errors, in essence, say that I have multiple definitions of these four functions. Coincidentally, these are the four functions that I didn't comment out from the original WPIlib files. Their definitions in the .h file did not change, either, to accommodate my modifications.
So here's what I think is happening: I think that my project is somehow trying to link in the pre-compiled RobotDrive files and throwing me errors where ever it finds conflicts between the ones in my project and the ones in WPIlib.
Finally my question: Has anyone tried to modify parts of WPIlib in a new project to any success? What was your secret? I am kinda stumped right now...
Maybe I just need to sleep on it, but if you guys could think of any solution, I would be hugely appreciative.
Thanks!
-Matt
I'm setup to program in C++ with WindRiver workbench and I'm able to get all the example programs to compile just fine. I just got started on a new project today, though, trying to modify the WPIlib source files RobotDrive.cpp and RobotDrive.h in my project. I have copied them from the WPIlib project (downloadable from the WPI website) into my project, which is a SimpleRobot.
From reading the C Programming Guide, I assume that one is able to do just this, make modifications to the added WPIlib files, and then everything will magically compile (see page 76 in the guide). Clearly, though, this is not the case (at least in my case :yikes: ).
As far as I can tell, there are no syntactical errors that would keep my code from compiling, and yet I am still getting errors when I go to build the project. There are four functions that each generate two errors in what appears to be the link step (I may be wrong on that one) and the errors, in essence, say that I have multiple definitions of these four functions. Coincidentally, these are the four functions that I didn't comment out from the original WPIlib files. Their definitions in the .h file did not change, either, to accommodate my modifications.
So here's what I think is happening: I think that my project is somehow trying to link in the pre-compiled RobotDrive files and throwing me errors where ever it finds conflicts between the ones in my project and the ones in WPIlib.
Finally my question: Has anyone tried to modify parts of WPIlib in a new project to any success? What was your secret? I am kinda stumped right now...
Maybe I just need to sleep on it, but if you guys could think of any solution, I would be hugely appreciative.
Thanks!
-Matt