Menu

#30 2-2-3 for unix won't compile, globals defined in multiple locations

v1.0_(example)
open
nobody
None
1
2025-05-07
2025-05-07
ptb
No

change the four char * FOO declarations in eqn.h to extern char * FOO, like this:

extern char eqn_start_inline;
extern char
eqn_end_inline;
extern char eqn_start_display;
extern char
eqn_end_display;

Then put the (no extern!) char * FOO declarations in main.c. That defines the global variable containing the pointer in ONE place, not one zillion. One can fix this with compile flags too, but don't!

What you had defined the same global variables in each .c file in which eqn.h was included. Bad karma.

Discussion

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB