When I make a plasma simulation project, the linker reports this error:
../libpsc/.libs/libpsc.a(push_part_1vb_mix.o):(.rodata+0x38): undefined reference to `psc_push_particles_1vb_ps2_ops'
Actually, the problem is obvious. The c file ../libpsc/FOLDER_A/push_part_1vb_mix.c (call it A.c) refers to a
struct psc_push_particles_ops psc_push_particles_1vb_ps2_ops = { //definition
defined in ../libpsc/FOLDER_B/psc_push_particles_ps.c (call it B.c). The A.c includes a header file (located in ../include/) which contains
extern struct psc_push_particles_ops psc_push_particles_1vb_ps2_ops;
However, the linker report this error anyway. So how can I fix this problem? Is this caused by the makefile? I don't know how the linker solves references and any suggestion will be appreciated. Thanks in advance!