2014-11-25 1 views
0

Итак, я пошел к этому website, чтобы загрузить структуру CUnit. Я загрузил папку в папку «Мои загрузки», используя следующие команды. Я получаю много ошибок, показанных ниже. Любая помощь будет большой. Разбей это для меня Я Linux noob.CUnit - Ошибки при попытке создания с использованием make-файла или gcc

tar -xvf CUnit-2.1-3.tar.bz2 

cd CUnit-2.1-3/ 
autoreconf --install 
./configure 
make 
sudo make install 
cd Examples/ 
make ExampleTests 

Тогда я получаю следующие ошибки:

gcc [email protected]@ -Wall -W -pedantic -Wshadow -ansi -I/home/renagade629/Downloads/CUnit-2.1-3/CUnit/Headers -std=c99 -L/home/renagade629/Downloads/CUnit-2.1-3/CUnit/Sources ExampleTests.c -o ExampleTests 
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function `_start': 
(.text+0x18): undefined reference to `main' 
/tmp/ccJcTm0I.o: In function `testSuccess1': 
ExampleTests.c:(.text+0x5e): undefined reference to `CU_assertImplementation' 
/tmp/ccJcTm0I.o: In function `testSuccess2': 
ExampleTests.c:(.text+0x9a): undefined reference to `CU_assertImplementation' 
/tmp/ccJcTm0I.o: In function `testSuccess3': 
ExampleTests.c:(.text+0xd6): undefined reference to `CU_assertImplementation' 
/tmp/ccJcTm0I.o: In function `testSuiteFailure1': 
ExampleTests.c:(.text+0x112): undefined reference to `CU_assertImplementation' 
/tmp/ccJcTm0I.o: In function `testSuiteFailure2': 
ExampleTests.c:(.text+0x14e): undefined reference to `CU_assertImplementation' 
/tmp/ccJcTm0I.o:ExampleTests.c:(.text+0x18a): more undefined references to `CU_assertImplementation' follow 
/tmp/ccJcTm0I.o: In function `AddTests': 
ExampleTests.c:(.text+0x14b9): undefined reference to `CU_get_registry' 
ExampleTests.c:(.text+0x14e6): undefined reference to `CU_is_test_running' 
ExampleTests.c:(.text+0x151a): undefined reference to `CU_register_suites' 
ExampleTests.c:(.text+0x1523): undefined reference to `CU_get_error_msg' 
collect2: error: ld returned 1 exit status 
make: *** [ExampleTests] Error 1 

Я также пытался вручную скомпилировать его с помощью GCC следующим

gcc -Wall -I/Downloads/CUnit-2.1-3/CUnit/Headers ExampleTests.c -o ExampleTests -lcunit 

И это дает мне эту ошибку (не уверен, почему так существует файл .h):

Unit-2.1-3/CUnit/Headers ExampleTests.c -o ExampleTests -lcunit 
ExampleTests.c:26:19: fatal error: CUnit.h: No such file or directory 
#include "CUnit.h" 
       ^
compilation terminated. 

Ниже дерево моего Куните каталога

tree 
. 
├── aclocal.m4 
├── AUTHORS 
├── autom4te.cache 
│   ├── output.0 
│   ├── output.1 
│   ├── output.2 
│   ├── output.3 
│   ├── requests 
│   ├── traces.0 
│   ├── traces.1 
│   ├── traces.2 
│   └── traces.3 
├── bootstrap 
├── ChangeLog 
├── compile 
├── config.guess 
├── config.h 
├── config.h.in 
├── config.h.in~ 
├── config.log 
├── config.status 
├── config.sub 
├── configure 
├── configure.in 
├── COPYING 
├── CUnit 
│   ├── CUnit.dsp 
│   ├── Headers 
│   │   ├── Automated.h 
│   │   ├── Basic.h 
│   │   ├── Console.h 
│   │   ├── CUCurses.h 
│   │   ├── CUError.h 
│   │   ├── CUnit.h 
│   │   ├── CUnit.h.in 
│   │   ├── CUnit_intl.h 
│   │   ├── Jamfile 
│   │   ├── Makefile 
│   │   ├── Makefile.am 
│   │   ├── Makefile.in 
│   │   ├── MyMem.h 
│   │   ├── TestDB.h 
│   │   ├── TestRun.h 
│   │   ├── Util.h 
│   │   └── wxWidget.h 
│   ├── Jamfile 
│   ├── Makefile 
│   ├── Makefile.am 
│   ├── Makefile.in 
│   └── Sources 
│    ├── Automated 
│    │   ├── Automated.c 
│    │   ├── Automated.lo 
│    │   ├── Automated.o 
│    │   ├── libcunitautomated.la 
│    │   ├── Makefile 
│    │   ├── Makefile.am 
│    │   └── Makefile.in 
│    ├── Basic 
│    │   ├── Basic.c 
│    │   ├── Basic.lo 
│    │   ├── Basic.o 
│    │   ├── libcunitbasic.la 
│    │   ├── Makefile 
│    │   ├── Makefile.am 
│    │   └── Makefile.in 
│    ├── Console 
│    │   ├── Console.c 
│    │   ├── Console.lo 
│    │   ├── Console.o 
│    │   ├── libcunitconsole.la 
│    │   ├── Makefile 
│    │   ├── Makefile.am 
│    │   └── Makefile.in 
│    ├── Curses 
│    │   ├── Curses.c 
│    │   ├── Makefile 
│    │   ├── Makefile.am 
│    │   └── Makefile.in 
│    ├── Framework 
│    │   ├── CUError.c 
│    │   ├── CUError.lo 
│    │   ├── CUError.o 
│    │   ├── libcunitfmk.la 
│    │   ├── Makefile 
│    │   ├── Makefile.am 
│    │   ├── Makefile.in 
│    │   ├── MyMem.c 
│    │   ├── MyMem.lo 
│    │   ├── MyMem.o 
│    │   ├── TestDB.c 
│    │   ├── TestDB.lo 
│    │   ├── TestDB.o 
│    │   ├── TestRun.c 
│    │   ├── TestRun.lo 
│    │   ├── TestRun.o 
│    │   ├── Util.c 
│    │   ├── Util.lo 
│    │   └── Util.o 
│    ├── libcunit.la 
│    ├── Makefile 
│    ├── Makefile.am 
│    ├── Makefile.in 
│    ├── Test 
│    │   ├── Jamfile 
│    │   ├── Makefile 
│    │   ├── Makefile.am 
│    │   ├── Makefile.in 
│    │   ├── test_cunit.c 
│    │   └── test_cunit.h 
│    ├── Win 
│    │   ├── resource.h 
│    │   ├── Win.c 
│    │   └── Win.h 
│    └── wxWidget 
│     ├── icon_suite_active_open.xpm 
│     ├── icon_suite_active.xpm 
│     ├── icon_suite_inactive_open.xpm 
│     ├── icon_suite_inactive.xpm 
│     ├── icon_test_active_suite_inactive.xpm 
│     ├── icon_test_active.xpm 
│     ├── icon_test_inactive_suite_inactive.xpm 
│     ├── icon_test_inactive.xpm 
│     ├── Makefile.am 
│     └── wxWidget.cpp 
├── CUnit.dsw 
├── cunit.pc 
├── cunit.pc.in 
├── CUnit.spec 
├── CUnit.spec.in 
├── depcomp 
├── doc 
│   ├── CUnit_doc.css 
│   ├── error_handling.html 
│   ├── fdl.html 
│   ├── headers 
│   │   ├── Automated.h 
│   │   ├── Basic.h 
│   │   ├── Console.h 
│   │   ├── CUCurses.h 
│   │   ├── CUError.h 
│   │   ├── CUnit.h 
│   │   ├── CUnit_intl.h 
│   │   ├── Jamfile 
│   │   ├── Makefile 
│   │   ├── Makefile.am 
│   │   ├── Makefile.in 
│   │   ├── MyMem.h 
│   │   ├── TestDB.h 
│   │   ├── TestRun.h 
│   │   ├── Util.h 
│   │   ├── Win.h 
│   │   └── wxWidget.h 
│   ├── index.html 
│   ├── introduction.html 
│   ├── Jamfile 
│   ├── Makefile 
│   ├── Makefile.am 
│   ├── Makefile.in 
│   ├── managing_tests.html 
│   ├── running_tests.html 
│   ├── test_registry.html 
│   └── writing_tests.html 
├── Doxyfile 
├── Examples 
│   ├── AutomatedTest 
│   │   ├── AutomatedTest.c 
│   │   ├── AutomatedTest.dsp 
│   │   ├── AutomatedTest_v1.c 
│   │   ├── Jamfile 
│   │   ├── Makefile 
│   │   ├── Makefile.am 
│   │   ├── Makefile.in 
│   │   └── README 
│   ├── BasicTest 
│   │   ├── BasicTest.c 
│   │   ├── BasicTest.dsp 
│   │   ├── Jamfile 
│   │   ├── Makefile 
│   │   ├── Makefile.am 
│   │   ├── Makefile.in 
│   │   └── README 
│   ├── ConsoleTest 
│   │   ├── ConsoleTest.c 
│   │   ├── ConsoleTest.dsp 
│   │   ├── ConsoleTest_v1.c 
│   │   ├── Jamfile 
│   │   ├── Makefile 
│   │   ├── Makefile.am 
│   │   ├── Makefile.in 
│   │   └── README 
│   ├── CursesTest 
│   │   ├── CursesTest.c 
│   │   ├── CursesTest_v1.c 
│   │   ├── Jamfile 
│   │   ├── Makefile 
│   │   ├── Makefile.am 
│   │   ├── Makefile.in 
│   │   └── README 
│   ├── Demo_fprintf 
│   │   └── CUnitExample.c 
│   ├── ExampleTests.c 
│   ├── ExampleTests.h 
│   ├── Jamfile 
│   ├── Makefile 
│   ├── Makefile.am 
│   ├── Makefile.in 
│   ├── WinTest 
│   │   ├── Jamfile 
│   │   ├── ReadMe.txt 
│   │   ├── StdAfx.cpp 
│   │   ├── StdAfx.h 
│   │   ├── WinTest.cpp 
│   │   ├── WinTest.dsp 
│   │   └── WinTest_v1.cpp 
│   └── wxWidgetsTest 
│    ├── Makefile.am 
│    ├── README 
│    ├── wxWidgetsTest.c 
│    └── wxWidgetsTest.rc 
├── INSTALL 
├── install-sh 
├── Jambase 
├── Jamfile 
├── Jamrules 
├── Jamrules.in 
├── libcunit_dll.def 
├── libtool 
├── ltmain.sh 
├── Makefile 
├── Makefile.am 
├── Makefile.in 
├── Man 
│   ├── Jamfile 
│   ├── Makefile 
│   ├── Makefile.am 
│   ├── Makefile.in 
│   └── man3 
│    ├── CUnit.3 
│    ├── Jamfile 
│    ├── Makefile 
│    ├── Makefile.am 
│    └── Makefile.in 
├── missing 
├── mkinstalldirs 
├── NEWS 
├── PACKAGE 
├── README 
├── Share 
│   ├── CUnit-List.dtd 
│   ├── CUnit-List.xsl 
│   ├── CUnit-Run.dtd 
│   ├── CUnit-Run.xsl 
│   ├── Jamfile 
│   ├── Makefile 
│   ├── Makefile.am 
│   ├── Makefile.in 
│   ├── md2xml.pl 
│   ├── Memory-Dump.dtd 
│   └── Memory-Dump.xsl 
├── stamp-h1 
├── stamp-h.in 
├── TODO 
├── VC7 
│   ├── AutomatedTest 
│   │   └── AutomatedTest.vcproj 
│   ├── AutomatedTest_v1 
│   │   └── AutomatedTest_v1.vcproj 
│   ├── BasicTest 
│   │   └── BasicTest.vcproj 
│   ├── ConsoleTest 
│   │   └── ConsoleTest.vcproj 
│   ├── ConsoleTest_v1 
│   │   └── ConsoleTest_v1.vcproj 
│   ├── CUnit.sln 
│   ├── CUnit.suo 
│   ├── libcunit 
│   │   └── libcunit.vcproj 
│   ├── Readme.txt 
│   └── test_cunit 
│    └── test_cunit.vcproj 
├── VC8 
│   ├── AutomatedTest_v1.vcproj 
│   ├── AutomatedTest.vcproj 
│   ├── BasicTest.vcproj 
│   ├── ConsoleTest_v1.vcproj 
│   ├── ConsoleTest.vcproj 
│   ├── CUnit.sln 
│   ├── CUnit.suo 
│   ├── libcunit.vcproj 
│   ├── Readme.txt 
│   ├── test_cunit.vcproj 
│   └── wxWidgetsTest.vcproj 
├── VC9 
│   ├── AutomatedTest.vcproj 
│   ├── BasicTest.vcproj 
│   ├── ConsoleTest.vcproj 
│   ├── CUnit.sln 
│   ├── CUnit.sln.cache 
│   ├── CUnit.suo 
│   ├── libcunit.vcproj 
│   ├── Readme.txt 
│   └── test_cunit.vcproj 
└── VERSION 
+0

Вы печатали 'Headers' в своем ручном режиме, путь не является' CUnit/Headeders'. Исходная проблема - проблема связывания, и '-lcunit' вполне может быть решением. Я не знаю, почему сборка была бы ошибочной, если она плохо написана. '-DRELEASE = @ RELEASE @' также озадачивает. –

+0

@ Ethan Я попытался исправить мою попытку gcc с правильной орфографией, но у меня такая же ошибка. Я исправлю это на своем посту. спасибо. – user1945925

+0

Как выглядит строка '# include' в этом' .c' файле? –

ответ

0

Руководство команды не удается, потому что вы не используете правильный -I флаг. Вы потеряли префикс /home/renagade629, когда вы транскрибировали вывод make.