![](/img/trans.png)
[英]openCV program compile error “libopencv_core.so.2.4: cannot open shared object file: No such file or directory” in ubuntu 12.04
[英]“No such file or directory” error in ubuntu 12.04 eclipse
大家,當我嘗試構建項目並在以下代碼中發生錯誤時,我還是C ++的新手:
#ifndef GAMEPLAYEREX_H_
#define GAMEPLAYEREX_H_
#include "GamePlayer.h"
class GamePlayerEx : virtual public GamePlayer
{
public:
GamePlayerEx(int = 0);
virtual ~GamePlayerEx(void);
......
錯誤信息是:
In file included from ../GameEngine/GameMoudle/GamePlayerEx.cpp:8:0:
../GameEngine/GameMoudle/GamePlayerEx.h:11:24: fatal error: GamePlayer.h: No such file or directory
compilation terminated.
我的項目目錄如下圖所示,我不希望使用#include "../GamePlayer.h"
。
因此,有人知道如何在項目中進行配置並使其工作嗎? 謝謝!
如果您使用的是gcc(或大多數其他命令行編譯器),則可以設置include路徑以包含任意目錄,例如:
gcc -I.. myfile.cpp
這將在那些目錄中搜索包含文件。
如果您使用的是IDE,將可以修改IDE或項目設置。 例如,Eclipse Galileo CDT的此鏈接顯示了如何為給定項目設置包含路徑。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.