dilshadmustafa / picat_genutils

General utilities for Picat programming language
Other
1 stars 1 forks source link

Undefined reference to 'p' and 'shell' #1

Closed hakank closed 2 years ago

hakank commented 2 years ago

Hi.

Interesting project!

However, when I compile with

$ cd emu
$ make -f Makefile.linux64

the following errors occur:

cpreds.o: In function `Cboot':
cpreds.c:(.text+0x2ed7): undefined reference to `p'
cpreds.c:(.text+0x2eef): undefined reference to `shell'
collect2: error: ld returned 1 exit status
Makefile.linux64:55: recipe for target 'picat' failed
make: *** [picat] Error 1

There seems to be missing dependencies in the Makefile (or did I miss something else?).

Also, there are a lot of .o files in the repo. Perhaps these should be removed?

hakank commented 2 years ago

Ah, I noticed that there's a Makefile and when using that (instead if Makefile.linux64) it works:

$ make
dilshadmustafa commented 2 years ago

Yes, two more files you need to refer "emu/Makefile" and "emu/cpreds.c" Pls compile as below: $ cd emu $ make -f Makefile

Makefile (file path in git repo: emu/Makefile):-below lines added/modified: GENUTILS_FLAGS = -c -O3 -I. -Igenutils GENUTILS_OBJ = genutils.o picat : $(OBJ) $(ESPRESSO_OBJ) $(GENUTILS_OBJ) $(KISSAT_OBJ)       $(CPP) -o picat $(OBJ) $(ESPRESSO_OBJ) $(GENUTILS_OBJ) $(KISSAT_OBJ) $(LFLAGS)  

genutils.o : genutils/genutils.c     $(CC) $(GENUTILS_FLAGS) -o genutils.o genutils/genutils.c

cpreds.c file (file path in git repo: emu/cpreds.c):-below lines added/modified: // Added extern int p();extern int shell();

    // Added     insert_cpred("p", 2, p);    insert_cpred("shell", 2, shell); regards,Dilshad

On Tuesday, 12 October, 2021, 09:48:42 pm IST, Hakan Kjellerstrand ***@***.***> wrote:  

Hi.

Interesting project!

However, when I compile with $ cd emu $ make -f Makefile.linux64

the following errors occur: cpreds.o: In function Cboot': cpreds.c:(.text+0x2ed7): undefined reference top' cpreds.c:(.text+0x2eef): undefined reference to `shell' collect2: error: ld returned 1 exit status Makefile.linux64:55: recipe for target 'picat' failed make: *** [picat] Error 1

There seems to be missing dependencies in the Makefile (or did I miss something else?).

Also, there are a lot of .o files in the repo. Perhaps these should be removed?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

hakank commented 2 years ago

That's great.

Perhaps you should add this (i.e. how to compile) to the README file. I guess that other Picat users will make the same mistake as I since we are used to compile with those specific Makefile.* files.

/Hakan

dilshadmustafa commented 2 years ago

updated README file with those compile steps. -Dilshad

On Tuesday, 12 October, 2021, 10:29:03 pm IST, Hakan Kjellerstrand ***@***.***> wrote:  

That's great.

Perhaps you should add this (i.e. how to compile) to the README file. I guess that other Picat users will make the same mistake as I since we are used to compile with those specific Makefile.* files.

/Hakan

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.