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

does not compile #18

Open
setop opened this issue Jul 4, 2022 · 1 comment
Open

does not compile #18

setop opened this issue Jul 4, 2022 · 1 comment

Comments

@setop
Copy link

setop commented Jul 4, 2022

I just tried ./configure && make all but is failed.

cd awka; make
make[1]: Entering directory 'awka'
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o translate.o translate.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o awka.o awka.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o parse.o parse.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o scan.o scan.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o memory.o memory.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o hash.o hash.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o code.o code.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o bi_funct.o bi_funct.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o da.o da.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o error.o error.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o init.o init.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o bi_vars.o bi_vars.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o cast.o cast.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o print.o print.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o kw.o kw.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o jmp.o jmp.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o field.o field.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o re_cmpl.o re_cmpl.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o preprocess.o preprocess.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o zmalloc.o zmalloc.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o msg.o msg.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o scancode.o scancode.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o fcall.o fcall.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\"   -c -o version.o version.c
gcc -O -Dawka_LIBDIR=\"/usr/local/lib\" -Dawka_INCDIR=\"/usr/local/include\" translate.o awka.o parse.o scan.o memory.o hash.o code.o bi_funct.o da.o error.o init.o bi_vars.o cast.o print.o kw.o jmp.o field.o re_cmpl.o preprocess.o zmalloc.o msg.o scancode.o fcall.o version.o -o awka
/usr/bin/ld: code.o:(.bss+0x80): multiple definition of `awak_input_text'; scan.o:(.bss+0x40): first defined here
/usr/bin/ld: bi_funct.o:(.bss+0x0): multiple definition of `awak_input_text'; scan.o:(.bss+0x40): first defined here
/usr/bin/ld: error.o:(.bss+0x8): multiple definition of `line_pos'; scan.o:(.bss+0x48): first defined here
/usr/bin/ld: init.o:(.bss+0x90): multiple definition of `awak_input_text'; scan.o:(.bss+0x40): first defined here
/usr/bin/ld: bi_vars.o:(.bss+0x1f8): multiple definition of `awak_input_text'; scan.o:(.bss+0x40): first defined here
/usr/bin/ld: cast.o:(.bss+0x0): multiple definition of `line_pos'; scan.o:(.bss+0x48): first defined here
/usr/bin/ld: print.o:(.bss+0x0): multiple definition of `line_pos'; scan.o:(.bss+0x48): first defined here
/usr/bin/ld: kw.o:(.bss+0x0): multiple definition of `awak_input_text'; scan.o:(.bss+0x40): first defined here
/usr/bin/ld: jmp.o:(.bss+0x8): multiple definition of `awak_input_text'; scan.o:(.bss+0x40): first defined here
/usr/bin/ld: field.o:(.bss+0x1898): multiple definition of `line_pos'; scan.o:(.bss+0x48): first defined here
/usr/bin/ld: field.o:(.bss+0x18a0): multiple definition of `awak_input_text'; scan.o:(.bss+0x40): first defined here
/usr/bin/ld: re_cmpl.o:(.bss+0x0): multiple definition of `line_pos'; scan.o:(.bss+0x48): first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:44: awka] Error 1
make[1]: Leaving directory '/home/mrloyal/Sync/pawk/awka/awka'
make: *** [Makefile:48: awka_exe] Error 2
@setop
Copy link
Author

setop commented Nov 30, 2022

It seems related to the fact that some elements are declared both in a .h and a .c file, hence conflicting.

I made a quick fix to be able to compile locally:

--- awka/error.c
+++ awka/error.c
@@ -46,6 +46,8 @@
 #define  vfprintf  simple_vfprintf
 #endif
 
+int line_pos = 0 ;
+
 
 /* for run time error messages only */
 unsigned rt_nr , rt_fnr ;
--- awka/init.h
+++ awka/init.h
@@ -52,7 +52,7 @@
 
 extern char *sprintf_buff, *sprintf_limit ;
 
-char *awak_input_text;
+//char *awak_input_text;
 
 
 void  PROTO( initialize, (int, char **) ) ;
--- awka/scan.c
+++ awka/scan.c
@@ -80,7 +80,7 @@
 int _true_re = 0 ;
 
 /* position used for error reporting */
-int line_pos = 0 ;
+extern int line_pos; // = 0 ;
 
 void PROTO(init_extbi, (void)) ;
 
--- awka/scan.h
+++ awka/scan.h
@@ -39,7 +39,7 @@
 #include  "parse.h"
 #endif
 
-int line_pos;
+//int line_pos;
 
 extern  char scan_code[256] ;
 
--- configure
+++ configure
@@ -672,7 +672,7 @@
 fi
 echo "$ac_t""$CPP" 1>&6
 
-test "${CFLAGS+set}" = set || CFLAGS="-O"
+test "${CFLAGS+set}" = set || CFLAGS="-O2"
 
 

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

1 participant