現在、Eclipseでプロジェクトを構築しようとしています。プロジェクト・エクスプローラを以下に示す:cabbie.c
で定義済みの関数への未定義参照
私はエラーを取得し、undefined reference to initialize...
、以下のコードで:
#include <stdio.h>
#include <stdlib.h>
#include "../iotfclient.h"
Iotfclient client;
int rc;
int main() {
/* Setup your example here, code that should run once
*/
rc = initialize(&client, "h7dzt2", "Edison_cabquam", "notwindows95", "token", "Over_9000");
/* Code in this loop will run repeatedly
*/
for (;;) {
}
return 0;
}
機能が既にiotfclient.h
に定義されているヘッダーとして含まれていましたファイル。 ../iotfclient.h
と定義するのは正しいですか?私はMakefileを作るはずですか?このプロジェクトは、bluemix IOTプラットフォームに接続しようとする
int initialize(Iotfclient *client, char *orgId, char *deviceType, char *deviceId, char *authmethod, char *authtoken);
/**
* Function used to initialize the IBM Watson IoT client using the config file which is generated when you register your device
* @param client - Reference to the Iotfclient
* @param configFilePath - File path to the configuration file
*
* @return int return code
* error codes
* CONFIG_FILE_ERROR -3 - Config file not present or not in right format
*/
:iotfclient.h
内の関数のプロトタイプは以下の通りです。
これは** iotfclient.hで**宣言されていますが、どこに定義されていますか**? –
cabbie.cの#include行について警告を受けますか? – ItayB
@ItayB私はそれがちょうど '#include" iotfclient.h "だったときに使いました。それから '' ../iotfclient.h ''に変更しました。 –