Skip to content

struct should be declared extern#37

Open
abe-101 wants to merge 4 commits into
fordea:masterfrom
abe-101:master
Open

struct should be declared extern#37
abe-101 wants to merge 4 commits into
fordea:masterfrom
abe-101:master

Conversation

@abe-101

@abe-101 abe-101 commented Dec 9, 2021

Copy link
Copy Markdown

When the struct is initialized in the header file each time the file gets included it gets initialized result in the following errer

/usr/bin/ld: quicksort.o:(.bss+0x0): multiple definition of `inventory'; inventory.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:5: inventory] Error 1

the solution is to use extern and only initialize it once in inventory.c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant