i3 icon indicating copy to clipboard operation
i3 copied to clipboard

Wont Compile

Open mybigman opened this issue 4 years ago • 6 comments

I'm submitting a…

[x] Bug
[ ] Feature Request
[ ] Documentation Request
[ ] Other (Please describe in detail)

Current Behavior

wont compile

Expected Behavior

to compile

Note

Downloading the original i3 repo compiles without issues.

Issue

Spews out a pages of this

...
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_NET_SUPPORTED.xmacro:31: multiple definition of `A__NET_DESKTOP_NAMES'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_NET_SUPPORTED.xmacro:31: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_NET_SUPPORTED.xmacro:32: multiple definition of `A__NET_DESKTOP_VIEWPORT'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_NET_SUPPORTED.xmacro:32: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_NET_SUPPORTED.xmacro:33: multiple definition of `A__NET_ACTIVE_WINDOW'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_NET_SUPPORTED.xmacro:33: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_NET_SUPPORTED.xmacro:34: multiple definition of `A__NET_CLOSE_WINDOW'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_NET_SUPPORTED.xmacro:34: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_NET_SUPPORTED.xmacro:35: multiple definition of `A__NET_MOVERESIZE_WINDOW'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_NET_SUPPORTED.xmacro:35: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:1: multiple definition of `A__NET_WM_USER_TIME'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:1: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:2: multiple definition of `A__NET_STARTUP_ID'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:2: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:3: multiple definition of `A__NET_WORKAREA'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:3: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:4: multiple definition of `A_WM_PROTOCOLS'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:4: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:5: multiple definition of `A_WM_DELETE_WINDOW'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:5: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:6: multiple definition of `A_UTF8_STRING'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:6: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:7: multiple definition of `A_WM_STATE'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:7: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:8: multiple definition of `A_WM_CLIENT_LEADER'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:8: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:9: multiple definition of `A_WM_TAKE_FOCUS'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:9: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:10: multiple definition of `A_WM_WINDOW_ROLE'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:10: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:11: multiple definition of `A_I3_SOCKET_PATH'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:11: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:12: multiple definition of `A_I3_CONFIG_PATH'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:12: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:13: multiple definition of `A_I3_SYNC'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:13: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:14: multiple definition of `A_I3_SHMLOG_PATH'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:14: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:15: multiple definition of `A_I3_PID'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:15: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:16: multiple definition of `A_I3_FLOATING_WINDOW'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:16: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:17: multiple definition of `A__NET_REQUEST_FRAME_EXTENTS'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:17: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:18: multiple definition of `A__NET_FRAME_EXTENTS'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:18: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:19: multiple definition of `A__MOTIF_WM_HINTS'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:19: first defined here
/usr/bin/ld: src/i3-xinerama.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:20: multiple definition of `A_WM_CHANGE_STATE'; src/i3-assignments.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/include/atoms_rest.xmacro:20: first defined here
/usr/bin/ld: ./libi3.a(a-draw_util.o):/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/libi3/draw_util.c:19: multiple definition of `visual_type'; src/i3-main.o:/home/champ/downloads/i3/x86_64-pc-linux-gnu/../../i3/src/main.c:63: first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:1587: i3] Error 1
make[1]: Leaving directory '/home/champ/downloads/i3/x86_64-pc-linux-gnu'
make: *** [Makefile:1332: all] Error 2

Environment

- Linux Distribution & Version: Fedora 32

mybigman avatar Apr 09 '20 12:04 mybigman

I've been struggling with this issue on my arch system. My workaround was to use Clang as the compiler instead of GCC and then everything built and installed fine.

I don't really know much C so I really have no idea why this would be the case. Maybe it has something to do with GCC not fully supporting the C99 standard, but don't quote me on that.

Anyways the way I did this just to install clang, then change my environment variables:

export CC=/usr/bin/clang
export CXX=/usr/bin/clang++

and then build from source as you would normally with i3.

Hope this helps.

deionizedoatmeal avatar May 17 '20 17:05 deionizedoatmeal

Same problem, can't build.

@deionizedoatmeal Unfortunately your suggestion doesn't work as I get:

configure: error: C compiler cannot create executables

dunestorm333 avatar Jun 03 '20 11:06 dunestorm333

Same problem :/ As @dunestorm333 The workaround don't work for me, get this export CXX=/usr/bin/clang++

Syycorax avatar Nov 15 '20 16:11 Syycorax

same problem however when i use clang i get "linker command failed with exit code 1" if anyone has a solution pls msg me

Nycz-lab avatar Dec 06 '20 13:12 Nycz-lab

Setting GCC environment variables as such solved it for me:

export CPPFLAGS="-U_FORTIFY_SOURCE"
export CFLAGS=" -fcommon"

pellizzetti avatar Jan 03 '21 05:01 pellizzetti

Setting GCC environment variables as such solved it for me:

export CPPFLAGS="-U_FORTIFY_SOURCE"
export CFLAGS=" -fcommon"

Works for me ^^

misss13 avatar Aug 09 '21 11:08 misss13