Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildsys: many multiple definition of ... errors due to hp2xx.h defining vars #5

Open
fenugrec opened this issue Jan 16, 2022 · 0 comments

Comments

@fenugrec
Copy link

How did this ever compile on modern gcc ?

hp2xx.h defines a few global vars :

unsigned char pattern[8][256][256];
int pat;
int pw[8];
int ph[8];

but that header is included everywhere, so of course the linker goes crazy with multiple definition of 'pw'; fillpoly.o:/../src/hp2xx.h:328: first defined here ....

The fix is pretty simple : move those definitions to hp2xx.c, and change hp2xx.h to

/** some global vars, defined in hp2xx.c */
extern unsigned char pattern[8][256][256];
extern int pat;
extern int pw[8];
extern int ph[8];

I also have a commit fixing this.

fenugrec added a commit to fenugrec/hp2xx that referenced this issue Jan 16, 2022
Those global vars need to be defined only once in hp2xx.c
Fix dgtlrift#5 on GH
andrewbird pushed a commit to andrewbird/hp2xx that referenced this issue Oct 16, 2024
Those global vars need to be defined only once in hp2xx.c
Fix dgtlrift#5 on GH
andrewbird pushed a commit to andrewbird/hp2xx that referenced this issue Oct 16, 2024
Those global vars need to be defined only once in hp2xx.c
Fix dgtlrift#5 on GH
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

No branches or pull requests

1 participant