Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7597317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:07:43+00:00 2026-05-30T22:07:43+00:00

I am trying to execute the c program found here . But when I

  • 0

I am trying to execute the c program found here. But when I try to build it in eclipse I get numerous errors about functions being implicitly declared and registers being accessed that don’t exist. I was wondering if anybody can get this code to run and how they got it to work (program, OS, etc.) I am on a windows machine using an ubuntu virtual machine with eclipse and gcc to try and execute this code.

Here is a list of errors from Eclipse SDK (I have fixed a few bugs from the original code):

**** 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]

Finished building target: nearpi

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:07:44+00:00Added an answer on May 30, 2026 at 10:07 pm

    That code has bugs in it, when compiled on a modern compiler[*]. If I were you, I’d contact whomever licensed it, and ask for my money back.

    Some of the bugs are:

    • Missing #include <stdio.h>, #include <math.h>
    • It uses the register keyword inccorrectly. Delete that keyword everywhere it appears.
    • It uses “%E” when it should have used “%lE”.
    • It uses “%08x” when it should have used “%08lx”.
    • It uses “1.0E” when it should have used “1.0”.

    If you fix all of those bugs, it runs. I don’t know if it produces the correct answer, but it does run.

    *That code was written in 1983, when the prevailing standard for C was the first edition of K&R. There have been three international standards for C published since then, and that code was never updated. Most of the bugs and warnings are a result of being very old.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to execute a program from the Java code. Here is my
I'm trying to execute an external program from inside my Linux C++ program. I'm
For my java program I'm using Rhino to execute JS scripts. Now I'm trying
While trying to execute the following lines only the last two statements are displayed(Here
I am trying to execute this but cant see any result: <script> function init()
I'm trying to execute a program (convert from ImageMagick, to be specific) whose parent
I am trying to organize my program into functions and have ran into this,
When I am trying to execute the program I am getting an error like
I'm getting an error when trying to execute python program that uses multiprocessing package:
I'm trying to do a simple fork -> execute another program -> say hello

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.