rkd77 / elinks

Fork of elinks
Other
349 stars 38 forks source link

Cannot link to executable file #85

Closed zubator closed 3 years ago

zubator commented 3 years ago

Hi all. Sorry for my english. I pulled your source code and run compile, but sources compiled with gcc, not g++. I fixed makefile and all files compiled, but in linking process i have a lot of error about utils/string.c

/elinks/src/viewer/text/link.c:1524: undefined reference to add_to_string' /elinks/src/viewer/text/textarea.c:673: undefined reference toinit_string' /elinks/src/viewer/text/form.c:1190: undefined reference to `add_crlf_to_string'

what should I do?

My system is Xubuntu. If you want, I can share config.log

rkd77 commented 3 years ago

hi, could you describe step by step what did you do.( with commands you executed )?

zubator commented 3 years ago

Hi git clone "https://github.com/rkd77/elinks.git" ./autogen.sh ./configure make

after this compile start and I see such warnings

make[2]: Entering directory '/home/zubator/programming/get_advers/myGE/elinks/src/dialogs' [CC] src/dialogs/document.o cc1: warning: command line option ‘-fpermissive’ is valid for C++/ObjC++ but not for C [CC] src/dialogs/download.o cc1: warning: command line option ‘-fpermissive’ is valid for C++/ObjC++ but not for C [CC] src/dialogs/edit.o cc1: warning: command line option ‘-fpermissive’ is valid for C++/ObjC++ but not for C [CC] src/dialogs/info.o

and in the end

In file included from /usr/include/mozjs-52/jsapi.h:19, from ../.././src/ecmascript/ecmascript.h:14, from info.c:22: /usr/include/mozjs-52/mozilla/Variant.h:9:10: fatal error: new: No such file or directory 9 | #include | ^~~~~ compilation terminated. make[2]: [../.././Makefile.lib:133: info.o] Error 1 make[2]: Leaving directory '/home/zubator/programming/get_advers/myGE/elinks/src/dialogs' make[1]: [.././Makefile.lib:268: all-recursive] Error 1 make[1]: Leaving directory '/home/zubator/programming/get_advers/myGE/elinks/src' make: *** [Makefile.lib:268: all-recursive] Error 1

So I rewrite compiler from gcc to g++ in file Makefile.config in root directory CC = gcc -> CC = g++

and after this I can compile app.

In the end link process failes

/usr/bin/ld: lib.o: in function memacpy_u(char*, int, int)': /home/zubator/programming/get_advers/myGE/elinks/src/viewer/text/search.c:493: undefined reference toutf8_to_unicode' /usr/bin/ld: lib.o: in function do_op_right(form_state*, line_info*, int, int)': /home/zubator/programming/get_advers/myGE/elinks/src/viewer/text/textarea.c:1192: undefined reference toutf8_to_unicode' /usr/bin/ld: lib.o: in function format_textutf8(char*, int, form_wrap, int) [clone .constprop.0]': /home/zubator/programming/get_advers/myGE/elinks/src/viewer/text/textarea.c:94: undefined reference toutf8charlen' /usr/bin/ld: lib.o: in function draw_textarea': /home/zubator/programming/get_advers/myGE/elinks/src/viewer/text/textarea.c:371: undefined reference toutf8_to_unicode' /usr/bin/ld: lib.o: in function textarea_edit': /home/zubator/programming/get_advers/myGE/elinks/src/viewer/text/textarea.c:673: undefined reference toinit_string' /usr/bin/ld: lib.o: in function new_pos(form_state*, line_info*, int, int)': /home/zubator/programming/get_advers/myGE/elinks/src/viewer/text/textarea.c:811: undefined reference toutf8_to_unicode' /usr/bin/ld: lib.o: in function copy_to_clipboard': /home/zubator/programming/get_advers/myGE/elinks/src/viewer/text/view.c:990: undefined reference toinit_string' /usr/bin/ld: lib.o: in function copy_to_clipboard2': /home/zubator/programming/get_advers/myGE/elinks/src/viewer/text/view.c:1046: undefined reference toadd_char_to_string' /usr/bin/ld: /home/zubator/programming/get_advers/myGE/elinks/src/viewer/text/view.c:1044: undefined reference to encode_utf8' /usr/bin/ld: /home/zubator/programming/get_advers/myGE/elinks/src/viewer/text/view.c:1044: undefined reference toadd_to_string' /usr/bin/ld: /home/zubator/programming/get_advers/myGE/elinks/src/viewer/text/view.c:1052: undefined reference to add_char_to_string' /usr/bin/ld: /home/zubator/programming/get_advers/myGE/elinks/src/viewer/text/view.c:1056: undefined reference todone_string' /usr/bin/ld: lib.o: in function send_event': /home/zubator/programming/get_advers/myGE/elinks/src/viewer/text/view.c:1655: undefined reference totabs_are_on_top' collect2: error: ld returned 1 exit status make[1]: [Makefile:41: elinks] Error 1 make[1]: Leaving directory '/home/zubator/programming/get_advers/myGE/elinks/src' make: [Makefile.lib:268: all-recursive] Error 1

But file lib.o exist ls -al ./src/lib.o -rw-r--r-- 1 root root 24420184 янв 16 12:03 ./src/lib.o

string sources compiled ls -al ./src/util/string.o -rw-r--r-- 1 root root 78920 янв 16 12:02 ./src/util/string.o

and lib from ./src/util exist

rkd77 commented 3 years ago

Thanks for the report. Now compilation with defaults is possible. If you want js support: ./autogen.sh CC=g++ ./configure --with-spidermonkey

or meson with appropriate options.

zubator commented 3 years ago

Great work, thanks a lot