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

[C++] 记录几个编写动态链接库遇到的问题 #37

Open
yangruihan opened this issue Feb 6, 2021 · 0 comments
Open

[C++] 记录几个编写动态链接库遇到的问题 #37

yangruihan opened this issue Feb 6, 2021 · 0 comments

Comments

@yangruihan
Copy link
Owner

记录几个编写动态链接库遇到的问题

  1. Windows 平台下使用 CMake 构建项目,VS Build 结果只有 dll,没有 lib,导致依赖此库的可执行文件报错找不到该库,可能是没有加 __declspec(dllexport) 和 __declspec(dllimport)
  2. 要注意 DLL 和 EXE 全局变量会有两个实例,参考:https://stackoverflow.com/questions/63625272/how-to-use-glad-in-dll-and-exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant