Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors while compiling hite.c file #2

Open
priyashmistry opened this issue Jul 13, 2023 · 9 comments
Open

Errors while compiling hite.c file #2

priyashmistry opened this issue Jul 13, 2023 · 9 comments

Comments

@priyashmistry
Copy link

I was trying to run hite.c file in compiler (CodeBlocks, OS: Windows 10), and while compiling I received this error. Can someone please check this out:

||=== Build file: "no target" in "no project" (compiler: unknown) ===|
C:\Users\computer\Downloads\HITE-master\hite.c||In function 'ReadOptions':|
C:\Users\computer\Downloads\HITE-master\hite.c|200|warning: implicit declaration of function 'getline'; did you mean 'GetLine'? [-Wimplicit-function-declaration]|
C:\Users\computer\Downloads\HITE-master\hite.o:hite.c|| undefined reference to `getline'|
||error: ld returned 1 exit status|
||=== Build failed: 2 error(s), 1 warning(s) (0 minute(s), 0 second(s)) ===|

Note: Already tried changing getline with GetLine, nothing worked.

@RoryBarnes
Copy link
Owner

Hi Priyash, Sorry to hear this code gave you some trouble. Can you say a little bit more about how you compiled it? Which OS? I just recloned and ran:

gcc -o hite hite.c -lm

and it worked fine for me.

@priyashmistry
Copy link
Author

I'm using CodeBlocks (https://www.codeblocks.org/) on windows 10 for compilation.

@SarveshVGharat
Copy link

Hello Prof. the command "gcc -o hite hite.c -lm" works fine, but hite earth.in gives an error stating "Command 'hite' not found", seems like hite is been treated as linux command

PS: I am using Linux Mint

@RoryBarnes
Copy link
Owner

Did you try

./hite earth.in

? I haven't used Mint before, but maybe it requires being very clear about the path?

@nurwannn
Copy link

Hello sir, when i run 'hite earth.in" i got some problem like "ERROR: Expected option NumPlanets, found option α↕@.
Line: 66", can you help me with this problem?

@RoryBarnes
Copy link
Owner

It's not obvious to me what the issue is from your comment. The first option in earth.in is NumPlanets, so I don't know why it would be reporting an error on line 66. Did you modify earth.in in some way? Does running 'hite kepler452b.in' produce a similar error?

@nurwannn
Copy link

Yes, running hite kepler452b.in
I following this flow

  1. Download source code in githubg
  2. Install GCC on my windows
  3. Open cmd
  4. Hit "GCC hite.c"
  5. And then hit "a earth.in", or "hite earth.in"
  6. And three is an error like i send before

Please tell me if i forget some step to use your code, i hope you can help me for this problem, thankyou before

Best regard

@nurwannn
Copy link

For note, i use originaly file from your file .tar

@RoryBarnes
Copy link
Owner

It looks like you're running from a Windows prompt, which is something I haven't tried before. For scientific computing I strongly recommend using the freely available Windows Subsystem for Linux. From there, you may need to install gcc. Once you've confirmed gcc is installed, the commands should be

tar xvfz HITE.tar.gz
gcc -o hite hite.c -lm
./hite earth.in

(I think.) Let me know if that works for you and if so, I will update the README. Thanks for your interest in this code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants