andmarti1424 / sc-im

sc-im - Spreadsheet Calculator Improvised -- An ncurses spreadsheet program for terminal
Other
4.77k stars 201 forks source link

Compilation error ld: warning: creating DT_TEXTREL in a PIE #857

Closed Gogotron closed 8 months ago

Gogotron commented 8 months ago

I'm attempting to install sc-im. OS: Ubuntu 22.04.3 LTS x86_64

After 2 attempts I have found that I was missing yacc and ncurses, so here is what I have tried.

git clone https://github.com/andmarti1424/sc-im.git
cd sc-im
sudo apt install lib64ncurses6 lib64ncursesw6 bison
make -C src > out.log 2>&1

The make command results in the following output: out.log. Here is a preview of the contents of output.log:

out.log ``` make: Entering directory '/home/inigo/Desktop/sc-im/src' yacc -d gram.y mv y.tab.c gram.c sed -f eres.sed < gram.y > experres.h sed -f sres.sed < gram.y > statres.h cc -Wall -g -DNCURSES -D_XOPEN_SOURCE_EXTENDED -D_GNU_SOURCE -DSNAME=\"sc-im\" -DHELP_PATH=\"/usr/local/share/sc-im\" -DLIBDIR=\"/usr/local/share/doc/sc-im\" -DDFLT_PAGER=\"less\" -DDFLT_EDITOR=\"vim\" -DUSECOLORS -DHISTORY_FILE=\"sc-iminfo\" -DHISTORY_DIR=\".cache\" -DCONFIG_FILE=\"scimrc\" -DCONFIG_DIR=\".config/sc-im\" -DINS_HISTORY_FILE=\"sc-iminfo\" -DUNDO -DMAXROWS=65536 -DUSELOCALE -DMOUSE -DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""xclip -i -selection clipboard <"\" -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""xclip -o -selection clipboard"\" -DDEFAULT_OPEN_FILE_UNDER_CURSOR_CMD=\""scopen"\" -DAUTOBACKUP -DHAVE_PTHREAD -c -o block.o block.c cc -Wall -g -DNCURSES -D_XOPEN_SOURCE_EXTENDED -D_GNU_SOURCE -DSNAME=\"sc-im\" -DHELP_PATH=\"/usr/local/share/sc-im\" -DLIBDIR=\"/usr/local/share/doc/sc-im\" -DDFLT_PAGER=\"less\" -DDFLT_EDITOR=\"vim\" -DUSECOLORS -DHISTORY_FILE=\"sc-iminfo\" -DHISTORY_DIR=\".cache\" -DCONFIG_FILE=\"scimrc\" -DCONFIG_DIR=\".config/sc-im\" -DINS_HISTORY_FILE=\"sc-iminfo\" -DUNDO -DMAXROWS=65536 -DUSELOCALE -DMOUSE -DDEFAULT_COPY_TO_CLIPBOARD_CMD=\""xclip -i -selection clipboard <"\" -DDEFAULT_PASTE_FROM_CLIPBOARD_CMD=\""xclip -o -selection clipboard"\" -DDEFAULT_OPEN_FILE_UNDER_CURSOR_CMD=\""scopen"\" -DAUTOBACKUP -DHAVE_PTHREAD -c -o buffer.o buffer.c [...] /home/inigo/Desktop/sc-im/src/cmds/cmds_edit.c:100: undefined reference to `COLS' /usr/bin/ld: cmds/cmds_insert.o: in function `do_insertmode': /home/inigo/Desktop/sc-im/src/cmds/cmds_insert.c:138: undefined reference to `COLS' /usr/bin/ld: cmds/cmds_normal.o: in function `do_normalmode': /home/inigo/Desktop/sc-im/src/cmds/cmds_normal.c:1012: undefined reference to `COLS' /usr/bin/ld: /home/inigo/Desktop/sc-im/src/cmds/cmds_normal.c:1030: undefined reference to `LINES' /usr/bin/ld: /home/inigo/Desktop/sc-im/src/cmds/cmds_normal.c:1039: undefined reference to `LINES' /usr/bin/ld: /home/inigo/Desktop/sc-im/src/cmds/cmds_normal.c:1049: undefined reference to `LINES' /usr/bin/ld: /home/inigo/Desktop/sc-im/src/cmds/cmds_normal.c:1056: undefined reference to `LINES' /usr/bin/ld: cmds/cmds_visual.o: in function `do_visualmode': /home/inigo/Desktop/sc-im/src/cmds/cmds_visual.c:225: undefined reference to `LINES' /usr/bin/ld: cmds/cmds_visual.o:/home/inigo/Desktop/sc-im/src/cmds/cmds_visual.c:245: more undefined references to `LINES' follow /usr/bin/ld: warning: creating DT_TEXTREL in a PIE collect2: error: ld returned 1 exit status make: *** [Makefile:195: sc-im] Error 1 make: Leaving directory '/home/inigo/Desktop/sc-im/src' ```

It seems that the final problem is ld: warning: creating DT_TEXTREL in a PIE, and looking it up hasn't been very enlightening. I don't know much (or rather anything at all) about linking libraries, but all the undefined references make me suspect that ncurses might not be properly linked.

Any and all help is appreciated. Please ask any questions if I have not included some information that might be of help.

andmarti1424 commented 8 months ago

Seems you dont have ncurses dev files correctly installed. I dont use ubuntu but check you did install the proper ncurses package for this.