Я пытаюсь выполнить найденную программу c здесь .Но когда я пытаюсь построить его в затмении, я получаю многочисленные ошибки о неявном объявлении функций и обращении к регистрам, которые не существуют.Мне было интересно, может ли кто-нибудь запустить этот код и как он его работает (программа, ОС и т. Д.) Я нахожусь на машине с Windows, использующей виртуальную машину Ubuntu с eclipse и gcc, чтобы попытаться выполнить этот код.
Вот список ошибок из Eclipse SDK (я исправил несколько ошибок из исходного кода):
**** Build of configuration Debug for project nearpi ****
make all
Building file: ../src/nearpi.c
Invoking: GCC C Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/nearpi.d" -MT"src/nearpi.d" -o "src/nearpi.o" "../src/nearpi.c"
../src/nearpi.c:465:1: warning: return type defaults to ‘int’ [-Wreturn-type]
../src/nearpi.c: In function ‘main’:
../src/nearpi.c:501:5: warning: implicit declaration of function ‘input’ [-Wimplicit-function-declaration]
../src/nearpi.c:532:9: warning: implicit declaration of function ‘nearPiOver2’ [-Wimplicit-function-declaration]
../src/nearpi.c:540:9: warning: implicit declaration of function ‘dbleCF’ [-Wimplicit-function-declaration]
../src/nearpi.c: At top level:
../src/nearpi.c:590:1: warning: return type defaults to ‘int’ [-Wreturn-type]
../src/nearpi.c:694:1: warning: return type defaults to ‘int’ [-Wreturn-type]
../src/nearpi.c:756:1: warning: return type defaults to ‘int’ [-Wreturn-type]
../src/nearpi.c: In function ‘nearPiOver2’:
Finished building: ../src/nearpi.c
../src/nearpi.c:935:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/nearpi.c: In function ‘input’:
../src/nearpi.c:748:1: warning: control reaches end of non-void function [-Wreturn-type]
Building target: nearpi
../src/nearpi.c: In function ‘main’:
Invoking: GCC C Linker
gcc -o "nearpi" ./src/nearpi.o -lm
../src/nearpi.c:564:1: warning: control reaches end of non-void function [-Wreturn-type]
Завершенная цель здания: nearpi