新しいモジュールを作成し、次の行を使用してメイン クラスにリンクしようとするたびに(Estudiant.o)
:
g++ -o red1.exe red1.o %OBJETOS_CPP%\Estudiant.o
次のエラーが表示されます。
red1.o:red1.cpp:(.text+0xd):
Estudiant::consultar_DNI() const' red1.o:red1.cpp:(.text+0x18): undefined reference to
Estudiant::Estudiant(int) への未定義の参照' red1.o:red1.cpp:(.text+0x25):Estudiant::consultar_nota() const' red1.o:red1.cpp:(.text+0x74): undefined reference to
Estudiant::afegir_nota(doubleへの未定義の参照)' red1.o:red1.cpp:(.text+0x83):Estudiant::~Estudiant()' red1.o:red1.cpp:(.text+0xa3): undefined reference to
Estudiant への未定義の参照::consultar_nota() const' red1.o:red1.cpp:(.text+0xe5): Estudiant への未定義の参照Estudiant::modificar_nota(double)' red1.o:red1.cpp:(.text+0x10b): undefined reference to
::Estudiant ()' red1.o:red1.cpp:(.text+0x13a):Estudiant::llegir_estudiant()' red1.o:red1.cpp:(.text+0x144): undefined reference to
Estudiant への未定義の参照::te_nota() const' red1.o:red1.cpp:(.text+0x182):Estudiant::escriure_estudiant() const' red1.o:red1.cpp:(.text+0x18c): undefined reference to
Estudiant への未定義の参照:: ~Estudiant()' red1.o:red1.cpp:(.text+0x19f):Estudiant::~Estudiant()' c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: red1.o: bad reloc address 0x0 in section
.ctors' collect2.exe への未定義の参照: エラー: ld が 1 つの終了ステータスを返しました
また、元の Estudiant.cpp を持っていないので、コンパイルとリンクに異なるコンパイラが使用された可能性があると考えましたが、MinGW を再インストールしましたが、まだこのエラーが発生しています。また、すべてのファイルを置き換えようとしましたが、うまくいきませんでした。