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++ 版 DLL #182

Open
lriki opened this issue Feb 4, 2021 · 0 comments
Open

C++ 版 DLL #182

lriki opened this issue Feb 4, 2021 · 0 comments

Comments

@lriki
Copy link
Collaborator

lriki commented Feb 4, 2021

動機

現状は StaticLib としての配布のみであるが、サイズが非常に大きくなっている。

対策として DLL 配布できないか検討したい。

技術的課題

シンボルのエクスポート

外部に公開するクラスや関数を __declspec(dllexport) 等で修飾する必要がある。
コンパイラの差を吸収するため LN_API マクロが定義されているので、これを使う。

ビルド時とリンク時で同じバージョンのコンパイラが必要

これは StaticLib と同じ運用となる。

STL の制約

エクスポートするクラスは、ベースクラスやメンバ変数に STL のクラスを持ってはならない。

自分でコンテナクラスを作成したとき、そのクラスが std::vector を継承していたり、メンバ変数に内包していたりするとアウト。(VisualC++ で警告が出てくる)
あるいは PImpl の実装にする必要がある。

2021/2/4 時点の方針

上記の通り STL を使っている個所を何とかしないと進めることはできない。

ひとまず見送り。

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