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

建议封装成动态库 #51

Open
sanphone opened this issue May 8, 2017 · 2 comments
Open

建议封装成动态库 #51

sanphone opened this issue May 8, 2017 · 2 comments

Comments

@sanphone
Copy link

sanphone commented May 8, 2017

单例模式,如果在跨库的使用过程当中(如 DLL库A依赖ILog4zManager,而exe同样依赖ILog4zManager)容易产生两个实例,这样就需要初始化两次(虽然在linux下可以使用rdynamic导出所有符号,确保整个进程中只有一个ILog4zManager符号,但是在windows还没找到解决办法),目前我ILog4zManager改成了动态库,确保在调用工程中只有一个实例在使用

@zsummer
Copy link
Owner

zsummer commented May 9, 2017

动态库下跨库使用本来就是要这样的 和log4z没关系. log4z只是没提供动态库的solution文件. 暂时不会加.

@zsummer
Copy link
Owner

zsummer commented Aug 26, 2017

如果是跨库 必须使用动态库. 设计上接口和实现是完全解耦的. 因此你只需要加上dll的接口修饰手动编译下就好了.

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

2 participants