-1

I am trying to compile the gjh solver - written in C - into an executable file in windows. It is available on netlib

I downloaded the c file and am using gcc compiler via WinGW on windows' command prompt. Trying to compile the gjh.c file directly gave me an error that says:

gjh.c:33:21: fatal error: getstub.h: No such file or directory
 #include "getstub.h"
compilation terminated.

I assumed that compiling gjh.c requires the dependency getstub.h.

getstub.h is not the only dependency required, there are other dependencies, namely: arith.h, asl.h, funcadd.h, and stdio1.h. All of these files are available on the same link where I found getstub.h. However, arith.h0 and stdio1.h0 are available instead of arith.h and stdio1.h.

Are these files the same? I tried to rename the .h0 files to .h and tried to compile gjh.c, but I got this error:

collect2.exe: error: ld returned 1 exit status

Are the two files the same? If not, is there any way for me to compile the gjh solver successfully into an .exe?

Graham
  • 7,431
  • 18
  • 59
  • 84
Ken
  • 66
  • 6
  • There's a makefile for Microsoft Visual C++. I would go that route instead of struggling with GNU stuff in Microsoft environment. – Janne Tuukkanen Feb 27 '18 at 14:01
  • Nice open source goo. You need to find the documentation listing what all modules do and how they depend on each other. Or if such documentation isn't available, prompt the "programmer" to finish their work on the project. – Lundin Feb 27 '18 at 14:38

1 Answers1

0

If that's the only problem in compiling, try using the -I switch in gcc:

gcc -I/my/path/to/include/files -o gjh gjh.c

the -I switch hints to gcc where to find your #include files.

I am not sure about the stdio1.h. I think your approach to rename is OK but that reference to external functions such as Sprintf. You need to link with a library defining that. If you know where it comes from, use the -L and -l switch in gcc for that:

gcc -I/my/path/to/include/files -L/my/path/to/library -lnameoflibrary \
    -o gjh gjh.c
adrtam
  • 6,991
  • 2
  • 12
  • 27