### Xmake 版本 2.7.2 ### 操作系统版本和架构 Windows 10 amd64 ### 描述问题 使用XMake先编译动态库,然后把动态库改成静态库,MSVC报找不到符号,必须把构建目录全删了重新来才行。 源码:https://github.com/SineStriker/xmake-examples 编译器版本:MSVC 2019 ### 完整复现方式 + 设置编译动态库 + 修改`libshared/xmake.lua`第九行为 ```lua set_config("libshared_build_static", "off") ```` + 第一次构建 ```sh PS > xmake f2 checking for architecture ... x64 checking for Microsoft Visual Studio (x64) version ... 2019 create ok! PS > xmake b [ 25%]: cache compiling.release libshared\src\shared.cpp [ 25%]: cache compiling.release main.c [ 50%]: linking.release libshared.dll [ 75%]: linking.release main.exe [100%]: build ok! PS > xmake r plugin_func v0 ```` + 设置编译动态库 + 修改`libshared/xmake.lua`第九行为 ```lua set_config("libshared_build_static", "on") ```` + 第二次构建 ```sh PS > xmake f2 checking for Microsoft Visual Studio (x64) version ... 2019 create ok! PS > xmake b [ 25%]: cache compiling.release libshared\src\shared.cpp [ 50%]: archiving.release libshared.lib [ 75%]: linking.release main.exe error: main.c.obj : error LNK2019: 无法解析的外部符号 __imp_plugin_func,函数 main 中引用了该符号 build\windows\x64\release\main.exe : fatal error LNK1120: 1 个无法解析的外部命令 ```` + 此时必须将`build`目录删掉,重新配置编译,才会成功,否则一直是以上的错。 ### 期待的结果 ... ### 工程配置 ... ### 附加信息和错误日志 ...
Xmake 版本
2.7.2
操作系统版本和架构
Windows 10 amd64
描述问题
使用XMake先编译动态库,然后把动态库改成静态库,MSVC报找不到符号,必须把构建目录全删了重新来才行。
源码:https://github.com/SineStriker/xmake-examples
编译器版本:MSVC 2019
完整复现方式
设置编译动态库
libshared/xmake.lua第九行为第一次构建
设置编译动态库
libshared/xmake.lua第九行为第二次构建
此时必须将
build目录删掉,重新配置编译,才会成功,否则一直是以上的错。期待的结果
...
工程配置
...
附加信息和错误日志
...