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)
- 引用外部库时如何使用预编译头文件的功能 HOT 5
- 解决rc文件不会重新编译的问题 HOT 15
- 升级 xmake 后,包构建失败:package(nlohmann-json): links not found! HOT 4
- Linux系统编译多出-framework选项 HOT 34
- Cannot create static library providing C++ module HOT 14
- 多target的项目中,使用add_shflags("/NOENTRY")的纯资源动态库项目会对其它shared项目产生影响 HOT 3
- 本地定义的 package 无法替换掉间接依赖 HOT 27
- 无法安装依赖 HOT 7
- compile_commands.json 中的 ifc 文件相对路径无法被 VS Code IntelliSense 识别 HOT 8
- Qt deploy with MinGW is not working in release mode HOT 9
- set_warnings 隔离 nvcc 和 cxx HOT 15
- cannot build shared memory with MSVC module HOT 2
- Add bindirs for package HOT 2
- Add `utils.binary.rpath` native implemetion
- Windows平台上os.run()与shell执行结果不匹配 HOT 7
- mingw方式编译qt.quickapp工程失败 HOT 10
- 在windows vs2022上无法启用ASan HOT 7
- add_rules("protobuf.cpp") 应该以 host 方式编译 并使用 protoc HOT 3
- Make binary target the startup project in vsxmake generator if possible HOT 3
- arm64 (鲲鹏920) 下执行立即返回 wait events in poller failed! HOT 4
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.