私はXCodeを使ってプログラムを書いていました。 Mac上で問題なく動作します。私たちのプロジェクトはLinuxマシンでコンパイルされると言われたので、提出する前にLinux上で動作することを確認したかったのです。私はLinux上でコンパイルしようとしたとき、それは私にいくつかの参照エラーを与えた:OS XからLinuxに移行する際のエラーRed Hat
/tmp/cckwoehj.o: In function `main':
main.cpp:(.text+0x9): undefined reference to `ReadFile()'
/tmp/cckwoehj.o: In function `leftSearch(NODE*, int)':
main.cpp:(.text+0x38b): undefined reference to `conflict(int**)'
main.cpp:(.text+0x3ca): undefined reference to `removeAllRowsWithLiteral(int**, int)'
main.cpp:(.text+0x3ec): undefined reference to `removeAllSpecifiedLiteral(int**, int)'
main.cpp:(.text+0x4ec): undefined reference to `conflict(int**)'
main.cpp:(.text+0x522): undefined reference to `unitPropagation(int**)'
main.cpp:(.text+0x538): undefined reference to `conflict(int**)'
/tmp/cckwoehj.o: In function `rightSearch(NODE*, int)':
main.cpp:(.text+0x992): undefined reference to `conflict(int**)'
main.cpp:(.text+0x9d4): undefined reference to `removeAllRowsWithLiteral(int**, int)'
main.cpp:(.text+0x9f3): undefined reference to `removeAllSpecifiedLiteral(int**, int)'
main.cpp:(.text+0xaf3): undefined reference to `conflict(int**)'
main.cpp:(.text+0xb29): undefined reference to `unitPropagation(int**)'
main.cpp:(.text+0xb3f): undefined reference to `conflict(int**)'
collect2: ld returned 1 exit status
私はオンラインテンプレートに関するすべての交渉を発見したもの。私はテンプレートを使用しません。私はまた、32ビットと64ビットOSの問題について私にはわかりませんでした。
私はヘッダーに宣言されているReadFileという関数を持っています。私はmainからそれを呼び出し、そのヘッダファイルをmainにインクルードします。私は問題が何であるか分かりません。 OS Xがコンパイルされ実行されていて、Linuxがそうでない場合、OS Xが内部的に何かがあると思っていると思っていますが、Linuxはそのように書かれていません。これはリンカのエラーですか?私はOS Xが内部的にそれをするようにプログラムされていると思う。
Linux用のコードをどのように構築していますか? – juanchopanza
あなたのMakefileを投稿してください –