コンパイラエラー出力:
"/usr/bin/gmake" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
gmake[1]: Entering directory `/home/josh/Projects/Maze/Charon'
"/usr/bin/gmake" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/charon
gmake[2]: Entering directory `/home/josh/Projects/Maze/Charon'
mkdir -p build/Debug/GNU-Linux-x86/sys
rm -f build/Debug/GNU-Linux-x86/sys/charon.o.d
g++ -c -g -MMD -MP -MF build/Debug/GNU-Linux-x86/sys/charon.o.d -o build/Debug/GNU-Linux-x86/sys/charon.o sys/charon.cpp
mkdir -p dist/Debug/GNU-Linux-x86
g++ -o dist/Debug/GNU-Linux-x86/charon build/Debug/GNU-Linux-x86/sys/charon.o build/Debug/GNU-Linux-x86/main.o build/Debug/GNU-Linux-x86/sys/chin.o build/Debug/GNU-Linux-x86/sys/chout.o
build/Debug/GNU-Linux-x86/sys/chin.o: In function `chio::chin_::check()':
これが私が苦労していることです。これらの関数に使用するライブラリを入念にセットアップしているので、何をするのかわかりません。
/home/josh/Projects/Maze/Charon/sys/chin.cpp:28: undefined reference to `kbhit'
/home/josh/Projects/Maze/Charon/sys/chin.cpp:33: undefined reference to `stdscr'
/home/josh/Projects/Maze/Charon/sys/chin.cpp:33: undefined reference to `wgetch'
/home/josh/Projects/Maze/Charon/sys/chin.cpp:35: undefined reference to `kbhit'
collect2: ld returned 1 exit status
gmake[2]: *** [dist/Debug/GNU-Linux-x86/charon] Error 1
gmake[2]: Leaving directory `/home/josh/Projects/Maze/Charon'
gmake[1]: *** [.build-conf] Error 2
gmake[1]: Leaving directory `/home/josh/Projects/Maze/Charon'
gmake: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
これがcppファイルchin.cppです
/*
* File: chin.cpp
* Author: josh
*
* Created on 08 April 2012, 10:00
*/
#include <iostream>
#include <borland/conio.h>
#include <ncurses.h>
#include <deque>
#include "../headers/charon.h"
using namespace std;
using namespace charon;
using namespace chio;
namespace chio
{
chin_::chin_(){}
chin_::chin_(charon_ &handle) {
engine = &handle;
//key_presses = new deque();
}
chin_::~chin_() {
}
bool chin_::check()
{
if(kbhit())
{
while(true)
{
char ch;
ch = getch();
key_presses.push_back(ch);
if(!kbhit())
return true;
}
}
return false;
}
void chin_::update()
{
while(stream_in)
{
check();
}
}
}
そのため、そのファイルの上部に、borland / conio.hが含まれていることがわかります。特定の関数を検索していたときに、それがborlandと関係があるconio.hにあることがわかったときにずっと使用していました。 、私が正しく覚えていればコンパイラ。Windowsにdev-c++bloodshedをインストールし、インクルードディレクトリを取得して、名前をborlandに変更し、Linuxボックスのインクルードディレクトリにポップする必要がありました。
conio自体またはそれが使用したヘッダー内の依存関係について最初に1つのコンパイルエラーが発生しました。正しい場所を指すように変更するだけでした。
コンパイラがそれらすべてを単純に見つけることを期待していたので、一体何が起こっているのかわかりません。ヘッダーファイルが見つかるので、ヘッダーがhppファイルを見つけられない可能性がありますが、仮想のhppファイル内の関数を指定する代わりに、なぜそう言わないのでしょうか。ですから、私はここで架空の状況に陥っているので、明らかに助けが必要です。