|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I've written some functions in C using MPLab. The modules include both static data and code. How can I use them in an EasyC project?
|
|
#2
|
|||
|
|||
|
Re: Calling C functions from EasyC
Quote:
Regards, DCBrown |
|
#3
|
|||
|
|||
|
Thanks for the hint.
I may have figured out a solution. I don't have access to the RC right now, so I can't test it. It does compile and link successfully. This is what I did: 1. Compile the C code using MPLab. 2. Use mplib.exe to add the .o file to the wpilib.lib in the EasyC folder. 3. Add the header file to EasyC (Options/File Inclusion). |
|
#4
|
|||
|
|||
|
Re: Calling C functions from EasyC
Clever. I hadn't thought about adding additional .o files to the default library. To use to environments where libraries are protected except for read access.
We have a need for something similar, can't wait to try it. Regards, DCBrown |
|
#5
|
|||
|
|||
|
Re: Calling C functions from EasyC
Tried something similar just now...
1. Use MPLab to create .o object files 2. Use command window, use mplib to create .lib file (mplib /c MyTest.lib) 3. Add .o files to my library (mplib /r MyTest.lib MyTest.o) 3. move a copy of my library MyTest.lib to c:\mcc18\lib so it can be found by EasyC during link time 4. update <processor>.lkr file under EasyC in Frc\18F***\ to reference my library, e.g. : FILES clib.lib FILES p18f8520.lib FILES MyTest.lib << added this : 5. Referenced functions/data in MyTest.lib in EasyC... compiled/linked correctly. Regards, DCBrown |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| EasyC Wish List | dcbrown | Programming | 32 | 14-08-2006 09:24 |
| Kickoff easyC workshop integrated into EasyC help file | Dan Larochelle | Programming | 0 | 11-01-2006 06:12 |
| EasyC v. 2.0 - New features, custom user functions, and more! | artdutra04 | FIRST Tech Challenge | 1 | 02-11-2005 13:36 |
| Updated: Serial Port Driver Code | Kevin Watson | Programming | 4 | 05-02-2005 18:39 |