Je ne suis pas sûr de comprendre la référence indéfinie que je reçois.Lorsque j'exécute cxxtest, j'obtiens une erreur de référence indéfinie
./cxxtest/cxxtestgen.py -o tests.cpp --error-printer DrawTestSuite.h
g++ -I./cxxtest/ -c tests.cpp
g++ -o tests tests.o Color.o
tests.o: In function `DrawTestSuite::testLinewidthOne()':
tests.cpp:(.text._ZN13DrawTestSuite16t… undefined reference to `Linewidth::Linewidth(double)'
tests.cpp:(.text._ZN13DrawTestSuite16t… undefined reference to `Linewidth::draw(std::basic_ostream<char… std::char_traits<char> >&)'
collect2: ld returned 1 exit status
make: *** [tests] Error 1// DrawTestSuite.h
DrawTestSuite.h contient l'unité-test et la fonction de test fait appel à Linewidth.h pour exécuter la fonction constructer et membre tirage.
J'ai #include "Linewidth.h"
dans DrawTestSuite.h.
+1. La troisième ligne devrait être 'g ++ -o tests tests.o Color.o Linewidth.o' –
@Draco: Cela fait apparaître la commande en cours d'exécution, et le makefile pourrait être généré. (Si ce n'est pas le cas, ajoutez simplement la règle "tests: Linewidth.o" appropriée, qui ajoute "Linewidth.o" comme dépendance.) –
Je sais que c'est makefile :) –