简体   繁体   中英

Adding a library in Keil as a facade to use C++ inside C project

Because I wanna use some C++ library that I wrote inside my C project I found the facade pattern as a solution for that in another question asked on SO.

I compiled my project containing calculateSensors.h/cpp and facade.h/cpp as a library and included it into my main project. It's just doing some rand function and returning it from a cpp class to test whether this approach is working.

Now the problem is that after including the library I'm not sure how to include and call my functions. I just tried to include facade.h inside the main function (library and main function are in same folder) but the header file is not found. What am I doing wrong? Screenshot attached to better show my problem.

我的问题的屏幕截图

You must add the folder in which your facade.h resides in to your include path.

In your uVision project configuration in the tab C/C++ , modify the field Include Paths to contain said folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM