Comments (5)
想我的tbox里面,windows上c++模式编译,所有的接口都是extern "C" 导出的。。强制以c接口方式导出,这样应该是能够正常链接的。。而且更加统一。。在c/c++里面调用都是能够正常链接。。
我不明白为什么你这去掉 extern "C" 反而ok。。
from xmake.
默认不加 extern "C" ,在c++中编译,反而是以c++的命名规则导出接口的。。
from xmake.
嗯...因为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.
了解了 将c自动做为c++编译时 我之后可以考虑加些提示信息
from xmake.
好的
from xmake.
Related Issues (20)
- add_deps不能自动链接 HOT 3
- Cannot install package `tobiaslocker_base64` HOT 3
- win11下编译异常 HOT 63
- includes("**/xmake.lua") 卡死 HOT 40
- The buildenvs function of autoconf.lua has uninitialized table HOT 2
- Inconsistent behavior between target:has_tool and package:has_tool with clang-cl HOT 2
- cudaErrorNoDevice 卡较长时间 HOT 2
- add_deps有性能问题 HOT 2
- Support Verilator target build to static library HOT 4
- How to get the package-name in xmake.lua like $(version) dose. HOT 1
- Support absolute library path of the package when link HOT 14
- `toolchains` configuration option in `add_requires` does not take effect on Windows. HOT 9
- armclang汇编警告 HOT 7
- How to require boost package in header-only mode HOT 2
- MSVC 使用 HOSTX64 工具链 HOT 11
- clang module 编译出现错误 attempt to concatenate a nil value (local 'bmifile') HOT 5
- clang module 编译出现错误 fatal error: 'mm_malloc.h' file not found HOT 8
- cannot import module: lib.luajit.bcsave HOT 10
- Error: 'go get' is no longer supported outside a module. HOT 1
- 安装boost包报错 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xmake.