私のパーソナルプロジェクト用に2つのコンストラクタを使用するArduinoライブラリを作成していますが、何らかの理由で型に固有のエラーが発生しています。C++ライブラリのテスト中にエラーが発生しました
が、これはヘッダファイルです:ので、ここで私のファイルである
#ifndef iGA_H
#define iGA_H
class iGA {
public:
getParameters(int soundA[], int soundB[], int parentId[]);
private:
int _soundA[];
int _soundB[];
int _parentId[];
}
のcppファイル:
#include <iGA.h>
iGA::getParameters(int soundA[], int soundB[], int parentId[])
{
_soundA = soundA;
_soundB = soundB;
_parentId = parentId;
}
そして、これはかなりの範囲内で、スケッチでコンストラクタを呼び出す方法イムですセットアップ()関数:
#include <iGA>
iGA iga;
void setup() {
iga.getParameters(r, r1 , r2);
}
、ここではエラーです:
In file included from /home/bargros/Dropbox/iGA__NewBild/iGA__NewBild.ino:34:0:/home/bargros/Arduino/libraries/iGA/iGA.h:10:58: error: ISO C++ forbids declaration of 'getParameters' with no type [-fpermissive]getParameters(int soundA[], int soundB[], int parentId[]);
私はエラーが引数の型で行うか、多分間違ってコンストラクタを呼び出すイムするために何かを持って知っているが、私はまた、このようにそれを呼び出してみました:Cへの比較的新しい
iGA iga = getParameters(etc,etc,etc);
イム++と少し無知イムこのエラーが私に何を伝えているかについて。誰にもこれがどうして起こるのか、何らかのアイデアがありますか?
getParametersは何かを返す必要があります。**ヒント**:** iGA :: getParametersの前に何かがあるはずです – Incomputable
'getParameters(int soundA []、int soundB []、int parentId []);'少なくともgetParameters(int soundA []、int soundB []、int parentId []); '。 –
voidを追加しようとしましたが、同じエラーが表示されます。@ FirstStepが提案した内容を試してみます。 – Bargros