Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mingw编译的自定义控件移植到msvc报链接错误 #903

Open
Tracker647 opened this issue Sep 25, 2024 · 1 comment
Open

mingw编译的自定义控件移植到msvc报链接错误 #903

Tracker647 opened this issue Sep 25, 2024 · 1 comment

Comments

@Tracker647
Copy link

项目用到一个自定义控件,用到个dll,自己对dll做了一个SDK封装,SDK封装的文件夹名为mySDK,和控件都放在src文件夹下,windows_main有引用到mySDK的函数,mingw编译的时候能够正常通过。
后面想用windows上的VS集成好的调试和性能监测工具,就打算改到msvc,但是发现msvc直接编译的话windows_main没办法把mySDK的obj文件链接过来,而mingw就能自动寻找。
找到了半天解决方法,以下是我试过的:
把mySDK抽出来单独编译成库链接给windows_main,和dll一同使用,但是由于业务设计原因我的控件和SDK已经相互依赖了,根本抽不开,要改就相当于重构;
把src下SConstruct的env.SharedLibrary改成env.Library,能正常编译运行,但是这样出来的是静态库,而项目导入控件是要控件的动态库的,这样导入又会有问题;
请问还有什么编译trick,能在不改动大量代码的情况下能让msvc通过编译呢?
项目抽象:
awtk-widget-msvc-link-repo.zip

谢谢

@Tracker647
Copy link
Author

Tracker647 commented Sep 26, 2024

解决了,原来是要对mySDK的函数根据awtk规范注释,这样scons才会把它们写进控件def里面,这样window_main才会接受

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant