blezz
blezz copied to clipboard
fix build
you were declaring static variables inside a header and then including that header in multiple source files, that caused a "multiple definition" error preventing me for building the project
Error log
gcc -c -g -Wall src/main.c -lxcb -o src/main.o
gcc -c -g -Wall src/errors.c -lxcb -o src/errors.o
gcc -c -g -Wall src/data.c -lxcb -o src/data.o
gcc -c -g -Wall src/file.c -lxcb -o src/file.o
gcc -c -g -Wall src/gui.c -lxcb -o src/gui.o
gcc -c -g -Wall src/argpass.c -lxcb -o src/argpass.o
gcc -c -g -Wall src/keys.c -lxcb -o src/keys.o
gcc -c -g -Wall src/mutex.c -lxcb -o src/mutex.o
gcc ./src/main.o ./src/errors.o ./src/data.o ./src/file.o ./src/gui.o ./src/argpass.o ./src/keys.o ./src/mutex.o -lxcb -o blezz
/usr/bin/ld: ./src/data.o:/home/alpheratz/blezz/src/file.h:6: multiple definition of `configLines'; ./src/main.o:/home/alpheratz/blezz/src/file.h:6: first defined here
/usr/bin/ld: ./src/data.o:/home/alpheratz/blezz/src/file.h:7: multiple definition of `contentLines'; ./src/main.o:/home/alpheratz/blezz/src/file.h:7: first defined here
/usr/bin/ld: ./src/data.o:/home/alpheratz/blezz/src/data.h:27: multiple definition of `savedDirs'; ./src/main.o:/home/alpheratz/blezz/src/data.h:27: first defined here
/usr/bin/ld: ./src/data.o:/home/alpheratz/blezz/src/data.h:28: multiple definition of `savedActs'; ./src/main.o:/home/alpheratz/blezz/src/data.h:28: first defined here
/usr/bin/ld: ./src/data.o:/home/alpheratz/blezz/src/data.h:29: multiple definition of `allDirs'; ./src/main.o:/home/alpheratz/blezz/src/data.h:29: first defined here
/usr/bin/ld: ./src/data.o:/home/alpheratz/blezz/src/data.h:30: multiple definition of `allActs'; ./src/main.o:/home/alpheratz/blezz/src/data.h:30: first defined here
/usr/bin/ld: ./src/data.o:/home/alpheratz/blezz/src/data.h:32: multiple definition of `dirStackTop'; ./src/main.o:/home/alpheratz/blezz/src/data.h:32: first defined here
/usr/bin/ld: ./src/data.o:/home/alpheratz/blezz/src/data.h:33: multiple definition of `dirStack'; ./src/main.o:/home/alpheratz/blezz/src/data.h:33: first defined here
/usr/bin/ld: ./src/data.o:/home/alpheratz/blezz/src/data.h:35: multiple definition of `startDir'; ./src/main.o:/home/alpheratz/blezz/src/data.h:35: first defined here
/usr/bin/ld: ./src/data.o:/home/alpheratz/blezz/src/argpass.h:22: multiple definition of `arguments'; ./src/main.o:/home/alpheratz/blezz/src/argpass.h:22: first defined here
/usr/bin/ld: ./src/file.o:/home/alpheratz/blezz/src/file.h:6: multiple definition of `configLines'; ./src/main.o:/home/alpheratz/blezz/src/file.h:6: first defined here
/usr/bin/ld: ./src/file.o:/home/alpheratz/blezz/src/file.h:7: multiple definition of `contentLines'; ./src/main.o:/home/alpheratz/blezz/src/file.h:7: first defined here
/usr/bin/ld: ./src/file.o:/home/alpheratz/blezz/src/argpass.h:22: multiple definition of `arguments'; ./src/main.o:/home/alpheratz/blezz/src/argpass.h:22: first defined here
/usr/bin/ld: ./src/file.o:/home/alpheratz/blezz/src/data.h:27: multiple definition of `savedDirs'; ./src/main.o:/home/alpheratz/blezz/src/data.h:27: first defined here
/usr/bin/ld: ./src/file.o:/home/alpheratz/blezz/src/data.h:28: multiple definition of `savedActs'; ./src/main.o:/home/alpheratz/blezz/src/data.h:28: first defined here
/usr/bin/ld: ./src/file.o:/home/alpheratz/blezz/src/data.h:29: multiple definition of `allDirs'; ./src/main.o:/home/alpheratz/blezz/src/data.h:29: first defined here
/usr/bin/ld: ./src/file.o:/home/alpheratz/blezz/src/data.h:30: multiple definition of `allActs'; ./src/main.o:/home/alpheratz/blezz/src/data.h:30: first defined here
/usr/bin/ld: ./src/file.o:/home/alpheratz/blezz/src/data.h:32: multiple definition of `dirStackTop'; ./src/main.o:/home/alpheratz/blezz/src/data.h:32: first defined here
/usr/bin/ld: ./src/file.o:/home/alpheratz/blezz/src/data.h:33: multiple definition of `dirStack'; ./src/main.o:/home/alpheratz/blezz/src/data.h:33: first defined here
/usr/bin/ld: ./src/file.o:/home/alpheratz/blezz/src/data.h:35: multiple definition of `startDir'; ./src/main.o:/home/alpheratz/blezz/src/data.h:35: first defined here
/usr/bin/ld: ./src/gui.o:/home/alpheratz/blezz/src/data.h:27: multiple definition of `savedDirs'; ./src/main.o:/home/alpheratz/blezz/src/data.h:27: first defined here
/usr/bin/ld: ./src/gui.o:/home/alpheratz/blezz/src/data.h:28: multiple definition of `savedActs'; ./src/main.o:/home/alpheratz/blezz/src/data.h:28: first defined here
/usr/bin/ld: ./src/gui.o:/home/alpheratz/blezz/src/data.h:29: multiple definition of `allDirs'; ./src/main.o:/home/alpheratz/blezz/src/data.h:29: first defined here
/usr/bin/ld: ./src/gui.o:/home/alpheratz/blezz/src/data.h:30: multiple definition of `allActs'; ./src/main.o:/home/alpheratz/blezz/src/data.h:30: first defined here
/usr/bin/ld: ./src/gui.o:/home/alpheratz/blezz/src/data.h:32: multiple definition of `dirStackTop'; ./src/main.o:/home/alpheratz/blezz/src/data.h:32: first defined here
/usr/bin/ld: ./src/gui.o:/home/alpheratz/blezz/src/data.h:33: multiple definition of `dirStack'; ./src/main.o:/home/alpheratz/blezz/src/data.h:33: first defined here
/usr/bin/ld: ./src/gui.o:/home/alpheratz/blezz/src/data.h:35: multiple definition of `startDir'; ./src/main.o:/home/alpheratz/blezz/src/data.h:35: first defined here
/usr/bin/ld: ./src/gui.o:/home/alpheratz/blezz/src/argpass.h:22: multiple definition of `arguments'; ./src/main.o:/home/alpheratz/blezz/src/argpass.h:22: first defined here
/usr/bin/ld: ./src/argpass.o:/home/alpheratz/blezz/src/argpass.h:22: multiple definition of `arguments'; ./src/main.o:/home/alpheratz/blezz/src/argpass.h:22: first defined here
collect2: error: ld returned 1 exit status
make: *** [makefile:13: blezz] Error 1
Thanks, @alpheratz0 - your fix helped me to keep using blezz.