XcodeでC++のダイナミックリンクライブラリを作成しているとき、
'__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
のエラーメッセージが表示された。
対策は、プロジェクトの以下の設定を行う。
- 「PROJECT」を選択する
- 「Build Settings」を選択する。
- 「ALL」を選択する。
- 「Apple LLVM 9.0 – Custom Compiler Flags」の「Other C++ Flags」に「-fdeclspec」を追加する。