Giter VIP home page Giter VIP logo

Comments (5)

waruqi avatar waruqi commented on May 22, 2024

想我的tbox里面,windows上c++模式编译,所有的接口都是extern "C" 导出的。。强制以c接口方式导出,这样应该是能够正常链接的。。而且更加统一。。在c/c++里面调用都是能够正常链接。。

我不明白为什么你这去掉 extern "C" 反而ok。。

from xmake.

waruqi avatar waruqi commented on May 22, 2024

默认不加 extern "C" ,在c++中编译,反而是以c++的命名规则导出接口的。。

from xmake.

baisai avatar baisai commented on May 22, 2024

嗯...因为C库的头文件里并没有extern "C",而是提供了一个C++的头文件lua.hpp这个头文件里有extern "C",所以导致了,C库的接口导出为C++模式的,而C++包含了lua.hpp,期望的是C模式的...所以我去掉了lua.hpp里的extern "C",这样所有的都是C++模式,所以就没有问题了....

当然,也可以把所有的C库的头文件加上#ifdef __cplusplus extern "C"......不过文件太多,所以我选择了更简单快捷的方法啦

from xmake.

waruqi avatar waruqi commented on May 22, 2024

了解了 将c自动做为c++编译时 我之后可以考虑加些提示信息

from xmake.

baisai avatar baisai commented on May 22, 2024

好的

from xmake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.