When compiling ngspice-32 with --enable-xspice --enable-oldapps, ngnutmeg binary fails to compile:
gcc -DHAVE_CONFIG_H -I. -I. -I../src/include -I../src/include -I../src/spicelib/devices -I/usr/include/freetype2 -DUSE_INTERP_RESULT -static -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/include/blt -fopenmp -MT ngnutmeg-main.o -MD -MP -MF .deps/ngnutmeg-main.Tpo -c -o ngnutmeg-main.o `test -f 'main.c' || echo './'`main.c
main.c:424:1: error: conflicting types for 'load_opus'
424 | load_opus(char *name)
| ^~~~~~~~~
In file included from main.c:38:
spicelib/devices/dev.h:11:5: note: previous declaration of 'load_opus' was here
11 | int load_opus(const char *);
| ^~~~~~~~~
make[2]: *** [Makefile:1324: ngnutmeg-main.o] Error 1
int load_opus(const char *), final linking fails as:/bin/ld: frontend/.libs/libfte.a(vectors.o): in function `plot_setcur':
/home/mtasaka/rpmbuild/fedora-specific/ngspice/master/ngspice-32/src/frontend/vectors.c:1175: undefined reference to `EVTswitch_plot'
/bin/ld: /home/mtasaka/rpmbuild/fedora-specific/ngspice/master/ngspice-32/src/frontend/vectors.c:1143: undefined reference to `EVTswitch_plot'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:1163: ngnutmeg] Error 1
I am trying to fix this error, however it seems the latter linking issue is a bit harder.
Note that there are some other issues with gcc10, which defaults to "-fno-common", so there are some "multiple definition of foo" messages, however I cannot submit patches for the issue unless the above linkage error issue is resolved.
In main.c, where you have just added the missing 'const', place a
close by.
Last edit: Holger Vogt 2020-05-05
Confirmed that this issue is fixed by db91e19e36822432156029d240ed272f56cac010 . Thank you.
fix uploaded to master branch