orbitalquark / textadept

Textadept is a fast, minimalist, and remarkably extensible cross-platform text editor for programmers.
https://orbitalquark.github.io/textadept
MIT License
640 stars 38 forks source link

Can't compile nightly on current Ubuntu LTS #286

Closed paaguti closed 1 year ago

paaguti commented 1 year ago

Hi,

on a VM:

student@juju:~/textadept$ uname -a
Linux juju 5.15.0-39-generic #42-Ubuntu SMP Thu Jun 9 23:42:32 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

I get the following compilation error:

-latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -ldl
/usr/bin/ld: textadept_gtk.o:(.bss+0x48): multiple definition of `command_entry'; textadept.o:(.bss+0x50): first defined here
/usr/bin/ld: textadept_gtk.o:(.bss+0x0): multiple definition of `lua'; textadept.o:(.bss+0x8): first defined here
/usr/bin/ld: textadept_gtk.o:(.bss+0x50): multiple definition of `focused_view'; textadept.o:(.bss+0x58): first defined here
/usr/bin/ld: textadept_gtk.o:(.bss+0x30): multiple definition of `replace'; textadept.o:(.bss+0x38): first defined here
/usr/bin/ld: textadept_gtk.o:(.bss+0x40): multiple definition of `find_next'; textadept.o:(.bss+0x48): first defined here
/usr/bin/ld: textadept_gtk.o:(.bss+0x28): multiple definition of `replace_all'; textadept.o:(.bss+0x30): first defined here
/usr/bin/ld: textadept_gtk.o:(.bss+0x38): multiple definition of `find_prev'; textadept.o:(.bss+0x40): first defined here
/usr/bin/ld: textadept_gtk.o:(.bss+0x20): multiple definition of `match_case'; textadept.o:(.bss+0x28): first defined here
/usr/bin/ld: textadept_gtk.o:(.bss+0x18): multiple definition of `whole_word'; textadept.o:(.bss+0x20): first defined here
/usr/bin/ld: textadept_gtk.o:(.bss+0x10): multiple definition of `regex'; textadept.o:(.bss+0x18): first defined here
/usr/bin/ld: textadept_gtk.o:(.bss+0x8): multiple definition of `in_files'; textadept.o:(.bss+0x10): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:235: ../textadept] Error 1

after I clone and compile with:

git clone https://github.com/orbitalquark/textadept.git
cd textadept/
make -C src deps NIGHTLY=1
make -C src

I have installed the dependencies as follows:

sudo apt update
sudo apt install libgtk-3-dev libgtkmm-3.0-dev 
sudo apt install make gcc g++ libncursesw5-dev unzip

The full offending command is

g++ -Os -std=c++17 -o ../textadept textadept.o AutoComplete.o CallTip.o CaseConvert.o CaseFolder.o CellBuffer.o ChangeHistory.o CharClassify.o CharacterCategoryMap.o CharacterType.o ContractionState.o DBCS.o Decoration.o Document.o EditModel.o EditView.o Editor.o Geometry.o Indicator.o KeyMap.o LineMarker.o MarginView.o PerLine.o PositionCache.o RESearch.o RunStyles.o ScintillaBase.o Selection.o Style.o UniConversion.o UniqueString.o ViewStyle.o XPM.o Accessor.o CharacterCategory.o CharacterSet.o DefaultLexer.o LexerBase.o LexerModule.o LexerNoExceptions.o LexerSimple.o PropSetSimple.o StyleContext.o WordList.o Scintillua.o lapi.o lauxlib.o lbaselib.o lcode.o lcorolib.o lctype.o ldblib.o ldebug.o ldo.o ldump.o lfunc.o lgc.o linit.o liolib.o llex.o lmathlib.o lmem.o loadlib.o lobject.o lopcodes.o loslib.o lparser.o lstate.o lstring.o lstrlib.o ltable.o ltablib.o ltm.o lundump.o lutf8lib.o lvm.o lzio.o lfs.o lpcap.o lpcode.o lpprint.o lptree.o lpvm.o textadept_gtk.o PlatGTK.o ScintillaGTK.o ScintillaGTKAccessible.o scintilla-marshal.o -rdynamic -Wl,--retain-symbols-file -Wl,/home/student/textadept/src/lua.sym -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -ldl

This doesn't happen on a Ubuntu 20.04LTS VM (or Docker image)

orbitalquark commented 1 year ago

Thanks for the report. Hopefully this is fixed via https://github.com/orbitalquark/textadept/commit/84916c60faaa00df9f35cb17f9ac368bdd90c089

Weird that it happens on some systems, but not others...

paaguti commented 1 year ago

Fixed for the gtk compile process, for Ubuntu jammy and Kali Linux rolling. Now facing problems with the curses version

In file included from scintilla/curses/PlatCurses.cxx:25:
scintilla/src/Platform.h:312:14: error: 'optional' in namespace 'std' does not name a template type
  312 |         std::optional<ColourRGBA> fore;
      |              ^~~~~~~~
scintilla/src/Platform.h:1:1: note: 'std::optional' is defined in header '<optional>'; did you forget to '#include <optional>'?
  +++ |+#include <optional>

will report after more in-depth analysis

orbitalquark commented 1 year ago

Between lines 11 and 12 of PlatCurses.cxx, try inserting '#include '. You'll probably have to do the same for ScintillaCurses.cxx (in the same directory) between lines 12 and 13.

paaguti commented 1 year ago

OK, will try later... I have the GUI running and that's what I was looking for. (BTW a Docker infra producing specific deb packages for different Debian-derived Linuxes)...

/PA

On Wed, 26 Oct 2022 at 15:07, orbitalquark @.***> wrote:

Between lines 11 and 12 of PlatCurses.cxx, try inserting '#include

'. You'll probably have to do the same for ScintillaCurses.cxx (in the same directory) between lines 12 and 13. — Reply to this email directly, view it on GitHub , or unsubscribe . You are receiving this because you authored the thread.Message ID: ***@***.***>

-- Fragen sind nicht da um beantwortet zu werden, Fragen sind da um gestellt zu werden Georg Kreisler

Headaches with a Juju log: unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run a leader-deposed hook here, but we can't yet

kbarni commented 1 year ago

Had the same problem.

Other than adding #include <optional> in PlatCurses.cxx and ScintillaCurses.cxx, I also had to include <stdexcept> in scintilla/src/Document.h. It is needed by std::runtime_error in line 204.

Now it builds without other errors.

orbitalquark commented 1 year ago

Thanks for following up. I have added the missing includes to Scinterm: https://github.com/orbitalquark/scinterm/commit/83e70e024cfd1edbd336b707119e9063cf2f5ffb and https://github.com/orbitalquark/scinterm/commit/a5e99d89396613dd18db846231b119695ba6bbaa