Main Content

macOS でヘッダー ファイルの解析中に発生するエラー

関数 clibgen.generateLibraryDefinition と関数 clibgen.buildInterface は、macOS プラットフォームで一部のヘッダー ファイルを解析するときに失敗します。

2 つのヘッダー ファイルがあるとします。ヘッダー ファイル simple1.hpp には、vector などの標準ヘッダーが含まれます。

#ifndef SIMPLE1_HPP 
#define SIMPLE1_HPP 

#include <vector> 

// class definitions
// functions
#endif

ヘッダー ファイル simple2.hpp には simple1.hpp が含まれます。

#include "simple1.hpp"

// class definitions based on simple1.hpp content
// other functionality

この clibgen.generateLibraryDefinition の呼び出しによって、macOS でヘッダー ファイルの解析中にエラーが発生します。

clibgen.generateLibraryDefinition(["simple1.hpp","simple2.hpp"],"InterfaceName","simple")

この内容をライブラリに含めるには、simple1.hppsimple2.hpp の内容でラッパーのヘッダー ファイルを作成します。たとえば、これらのステートメントで wrapsimple.hpp を作成します。

#ifndef SIMPLE1_HPP 
#define SIMPLE1_HPP 

#include <vector> 

// class definitions
// functions
#endif

// Start of simple2.hpp content. Do not add the include simple1.hpp statement.

// class definitions based on simple1.hpp content
// other functionality

ラッパー ヘッダー ファイルを使用して、ライブラリ定義 definesimple.m を作成します。

clibgen.generateLibraryDefinition("wrapsimple.hpp","InterfaceName","simple")

参考

|