tom2tom / emelfm2

paned file manager for gtk2/3
Other
14 stars 7 forks source link

Fail compile source on Debian 12 #9

Open jaxson5 opened 1 year ago

jaxson5 commented 1 year ago

make fails with the following error: collect2: error: ld returned 1 exit status make: *** [Makefile:439: emelfm2] Error 1

There are also a heap of other (not important?) errors:

In file included from src/emelfm2.h:638, from src/e2_bookmark.h:23, from src/e2_bookmark.c:25: src/e2_window.h:54:13: warning: inline function ‘e2_window_show_status_message’ declared but never defined 54 | inline void e2_window_show_status_message (const gchar *message

and

/usr/bin/ld: objs/src/e2_context_menu.o:(.bss+0x1a0): multiple definition of `app'; objs/src/e2_bookmark.o:(.bss+0xe0): first defined here

I'll see if I can do some more debugging, but my c days are long ago..

https://dpaste.com/5EYV9NGUQ

jax

jaxson5 commented 1 year ago

make -d attached too emelfm2_make.txt

12sunflowers commented 4 months ago

same error at building here at Devuan 5 Dadelaus (Debian 12 based)

compiling 'src/e2_bookmark.c'
In file included from src/utils/e2_hook.h:23,
                 from src/emelfm2.h:628,
                 from src/e2_bookmark.h:23,
                 from src/e2_bookmark.c:25:
src/utils/e2_utils.h:25:11: fatal error: magic.h: No such file or directory
   25 | # include <magic.h>
      |           ^~~~~~~~~
compilation terminated.
make: *** [Makefile:446: objs/src/e2_bookmark.o] Error 1
freeartist-devuan@home:~/Downloads/ranger_vifm_mc_emelfm/emelfm2-master$ 
12sunflowers commented 4 months ago

install libmagic-dev but

multiple definition of `file'
collect2: error: ld returned 1 exit status

build when add this at 438 line makefile <------>@$(CC) $(LDFLAGS) -Wl,-allow-multiple-definition $(OBJECTS) -o $(TARGET) -Wl,--as-needed $(lLIBS) original was <------>@$(CC) $(LDFLAGS) $(OBJECTS) -o $(TARGET) -Wl,--as-needed $(lLIBS) after launch emelfm2 its look strange

Screenshot_2024-07-28_00-08-13

debug log https://pastebin.com/raw/2Bi4MiKP

berkley4 commented 3 months ago

@12sunflowers if you're using bfd as your linker, you could try using gold instead of adding '-Wl,-allow-multiple-definition'.

12sunflowers commented 3 months ago

@berkley4 i am not coder or programmer, i am just whant try this FM, but i see its buggy, abandoned or dead. i do not know what is linker? i google "(LDFLAGS) -Wl,-allow-multiple-definition" for errors at building, i not know what is mean, but i am see that is all not working.

berkley4 commented 3 months ago

The linker is whatever /usr/bin/ld points at, ie it's one or more symlinks to either bfd, gold or lld. It basically puts all the compiled objects together to make the program binary.

The gold linker sometimes works where bfd doesn't, and vice-versa. The lld linker is normally used with the clang compiler. Emelfm2 seems to compile most easily with the gcc/gold combination.

Anything in /usr/local/bin will take precedence over the same in /usr/bin, so an easy way to switch to the gold linker (part of binutils) is to put an ld symlink in /usr/local/bin .....

cd /usr/local/bin
ln -sf ../../bin/x86_64-linux-gnu-ld.gold ld

If you want to return to where you started (ie go back to the bfd default)... rm -f /usr/local/bin/ld.

I've just built emelfm2, and despite it being effectively abandoned, it's still functional. You might need the following patch to fix a couple of compile errors...

--- a/Makefile
+++ b/Makefile
@@ -447,7 +447,7 @@

 $(LIBS_OBJECTS): $(OBJECTS_DIR)/%.so: %.c src/emelfm2.h src/e2_plugins.h
    @echo "compiling '$*.c'"
-   @$(CC) $(lCFLAGS) $(lLIBS_CFLAGS) $(LDFLAGS) -o $@ $*.c
+   @$(CC) $(lCFLAGS) $(lLIBS_CFLAGS) $(LDFLAGS) -o $@ $*.c -shared
 ifneq ($(STRIP),0)
    @strip -g $@
 endif
@@ -468,7 +468,7 @@

 $(ACL_OBJECTS): $(OBJECTS_DIR)/%.so: %.c src/emelfm2.h src/e2_plugins.h
    @echo "compiling '$*.c'"
-   @$(CC) $(lCFLAGS) $(lLIBS_CFLAGS) $(ACL_FLAGS) $(LDFLAGS) -o $@ $*.c -Wl,--as-needed $(ACL_LIBS)
+   @$(CC) $(lCFLAGS) $(lLIBS_CFLAGS) $(ACL_FLAGS) $(LDFLAGS) -o $@ $*.c -shared -Wl,--as-needed $(ACL_LIBS)
 ifneq ($(STRIP),0)
    @strip -g $@
 endif
12sunflowers commented 3 months ago

Hello, thanks for reply and attention. Apologize me for irritating tone. Because i am not professional programmer i was tried make this at Makefile.config CC ?= gcc -fuse-ld=gold but its not help, i have same multiple definitions and error,

i will try your variant with linker and patch, and report here about results

12sunflowers commented 3 months ago

@berkley4 same error

/usr/bin/ld: objs/src/e2_bookmark.o: previous definition here
/usr/bin/ld: error: objs/src/utils/e2_widget.o: multiple definition of 'toggles_hash'
/usr/bin/ld: objs/src/e2_bookmark.o: previous definition here
collect2: error: ld returned 1 exit status
make: *** [Makefile:438: emelfm2] Error 1
freeartist-devuan@home:~/Downloads/ranger_vifm_mc_emelfm/emelfm2-master$ 

Screenshot_2024-08-04_16-53-49 Screenshot_2024-08-04_16-55-17

berkley4 commented 3 months ago

No problem, I'm not a programmer either. I've just looked at some notes that I've made when compiling emelfm2 on previous occasions. The -fcommon option needs to be added to CFLAGS, eg CFLAGS='-fcommon' make ... or export CFLAGS='-fcommon'.

12sunflowers commented 3 months ago

Thanks. CFLAGS='-fcommon' make Build ok but it looks same weird, no icons, folders and files

Screenshot_2024-08-04_18-48-47

12sunflowers commented 3 months ago

also try with gtk2

In file included from /usr/include/gtk-2.0/gtk/gtk.h:203:
/usr/include/gtk-2.0/gtk/gtktreestore.h:106:62: note: expected ‘GtkTreeIter *’ {aka ‘struct _GtkTreeIter *’} but argument is of type ‘int’
  106 |                                                GtkTreeIter  *parent,
      |                                                ~~~~~~~~~~~~~~^~~~~~
src/e2_plugins.c:829:25: error: too few arguments to function ‘gtk_tree_store_insert’
  829 |                         gtk_tree_store_insert (GTK_TREE_STORE (data->model), &iter, -1);
      |                         ^~~~~~~~~~~~~~~~~~~~~
/usr/include/gtk-2.0/gtk/gtktreestore.h:104:15: note: declared here
  104 | void          gtk_tree_store_insert           (GtkTreeStore *tree_store,
      |               ^~~~~~~~~~~~~~~~~~~~~
In file included from src/emelfm2.h:638:
src/e2_window.h: At top level:
src/e2_window.h:54:13: warning: inline function ‘e2_window_show_status_message’ declared but never defined
   54 | inline void e2_window_show_status_message (const gchar *message
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:446: objs/src/e2_plugins.o] Error 1
freeartist-devuan@home:~/Downloads/ranger_vifm_mc_emelfm/emelfm2-master$ 
berkley4 commented 3 months ago

GTK3 support was not as mature as GTK2, so the latter it probably better than the former. Have you got libglib2.0-dev and libgtk2.0-dev installed?

Also, are you building a deb package? It's possible that the icons aren't installed properly if they're not showing up.

12sunflowers commented 3 months ago

@berkley4

Have you got libglib2.0-dev and libgtk2.0-dev installed?

root@home:/home/freeartist-devuan# apt install libglib2.0-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libglib2.0-dev is already the newest version (2.74.6-2+deb12u3).
0 upgraded, 0 newly installed, 0 to remove and 131 not upgraded.
root@home:/home/freeartist-devuan# apt install libgtk2.0-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libgtk2.0-dev is already the newest version (2.24.33-2).
0 upgraded, 0 newly installed, 0 to remove and 131 not upgraded.
root@home:/home/freeartist-devuan# 

Also, are you building a deb package?

What is mean? After 'make' i have bin emelfm2

that not only for me https://github.com/tom2tom/emelfm2/issues/7

berkley4 commented 3 months ago

A deb package is a file that you can use to install a program on debian-based distros. The debian-unofficial directory would be renamed to debian and you would run eg dpkg-buildpackage -rfakeroot -uc -us -j4 -b to build the deb files.

Are you running make install? If not then you need to run that as root after running make, so that all the icons and other files get installed. By default the files will go into folders within /usr/local.

12sunflowers commented 3 months ago

@berkley4 Thanks after 'make install' is better but emelfm2 is very raw and unpolished at have many issues. But ideas is good.

files-dir no shown at right panel files-dir no shown at right panel

crash crash

no icons at panel but seen at settings no icons at panel but seen at settings

files-dir column files-dir column

berkley4 commented 3 months ago

You were trying to add an icons directory when it crashed, so perhaps there is a permissions or path bug?

For configuration I use: WITH_KERNELFAM=1 NEW_COMMAND=1 WITH_LATEST=1 WITH_GTK2=1 WITH_ACL=1 WITH_OUTPUTSTYLES=1 XDG_INTEGRATION=0.

EmelFM2 is normally quite reliable, and I only enable a few things and turn off XDG integration to try and keep it stable. You can look at Makefile.config to see what is enabled or disabled by default.

12sunflowers commented 3 months ago

For configuration I use: WITH_KERNELFAM=1 NEW_COMMAND=1 WITH_LATEST=1 WITH_GTK2=1 WITH_ACL=1 WITH_OUTPUTSTYLES=1 XDG_INTEGRATION=0. make uninstall, make clean, with yours configuration error at building


In file included from /usr/include/gtk-2.0/gtk/gtk.h:203:
/usr/include/gtk-2.0/gtk/gtktreestore.h:106:62: note: expected ‘GtkTreeIter *’ {aka ‘struct _GtkTreeIter *’} but argument is of type ‘int’
106 |                                                GtkTreeIter  *parent,
|                                                ~~~~~~~~~~~~~~^~~~~~
src/e2_plugins.c:829:25: error: too few arguments to function ‘gtk_tree_store_insert’
829 |                         gtk_tree_store_insert (GTK_TREE_STORE (data->model), &iter, -1);
|                         ^~~~~~~~~~~~~~~~~~~~~

plugins/optional/e2p_acl.c:72:11: fatal error: acl/libacl.h: No such file or directory 72 | # include <acl/libacl.h> | ^~~~~~ compilation terminated. make: *** [Makefile:471: objs/plugins/optional/e2p_acl.so] Error 1 freeartist-devuan@home:~/Downloads/ranger_vifm_mc_emelfm/emelfm2-master$

berkley4 commented 3 months ago

The first error might be due to the second. The libacl.h file can be installed by installing libacl1-dev.

12sunflowers commented 3 months ago

@berkley4 Thanks a lot. After installing libacl1-dev. and yours configuration WITH_KERNELFAM=1 NEW_COMMAND=1 WITH_LATEST=1 WITH_GTK2=1 WITH_ACL=1 WITH_OUTPUTSTYLES=1 XDG_INTEGRATION=0 and CFLAGS='-fcommon' make no errors at building) looks better ps Can i ask why you so love this filemanager? Not mc or doublecommander? Screenshot_2024-08-08_22-19-25

berkley4 commented 3 months ago

I have used xfe in the past, but come back to emelfm2 as it's quite small and relatively simple.

12sunflowers commented 3 months ago

Thanks. But why exactly xfe and emelfm2 this both not support anymore by devs? Or this two you mentioned is completed and nothing to improve here?

ps why you not use mainstream soft like midnight commander or double commander?