![]() |
Calling C functions from EasyC
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?
|
Re: Calling C functions from EasyC
Quote:
Regards, DCBrown |
Re: Calling C functions from EasyC
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). |
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 |
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 |
| All times are GMT -5. The time now is 16:19. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi