microsoft / jericho

A learning environment for man-made Interactive Fiction games.
GNU General Public License v2.0
253 stars 42 forks source link

linker issue: multiple definition of - first defined here #44

Closed MathieuTuli closed 3 years ago

MathieuTuli commented 3 years ago

I'm having difficulty installing jericho, a dependency I need for TextWorld. Specifically, I'm having trouble building that frotz library. cd-ing into the frotz directory and running make library -j4 gives this linker error:

    /usr/bin/ranlib src/ztools.a
    /usr/bin/ld: src/dumb/dumb_input.o:(.bss+0xa8): multiple definition of `do_more_prompts'; src/dumb/dumb_init.o:(.bss+0xa8): first defined here
    /usr/bin/ld: src/dumb/dumb_input.o:(.bss+0x0): multiple definition of `f_setup'; src/dumb/dumb_init.o:(.bss+0x0): first defined here
    /usr/bin/ld: src/dumb/dumb_output.o:(.bss+0x0): multiple definition of `f_setup'; src/dumb/dumb_init.o:(.bss+0x0): first defined here
    /usr/bin/ld: src/dumb/dumb_output.o:(.bss+0xa8): multiple definition of `do_more_prompts'; src/dumb/dumb_init.o:(.bss+0xa8): first defined here
    /usr/bin/ld: src/dumb/dumb_pic.o:(.bss+0x0): multiple definition of `f_setup'; src/dumb/dumb_init.o:(.bss+0x0): first defined here
    /usr/bin/ld: src/dumb/dumb_pic.o:(.bss+0xa8): multiple definition of `do_more_prompts'; src/dumb/dumb_init.o:(.bss+0xa8): first defined here
    /usr/bin/ld: src/dumb/dumb_blorb.o:(.bss+0x40): multiple definition of `f_setup'; src/dumb/dumb_init.o:(.bss+0x0): first defined here
    /usr/bin/ld: src/dumb/dumb_blorb.o:(.bss+0xe8): multiple definition of `do_more_prompts'; src/dumb/dumb_init.o:(.bss+0xa8): first defined here

For reference:

I have attempted to do the following in an attempt to resolve this:

Is this an issue that others have encountered or is there something about my system that is causing this that I can fix?

Thanks

mhauskn commented 3 years ago

Since much of the code in Jericho is built on an older version of the Frotz engine, I'm curious if you can download Frotz (https://gitlab.com/DavidGriffith/frotz) and run "make dumb". If this works than perhaps comparing files that caused the linker error may give some insight.

MathieuTuli commented 3 years ago

oh I didn't realize frotz was a seperate package, I'll try that thanks!

MathieuTuli commented 3 years ago

okay I've fixed the issue, I was on track earlier, it had to do with missing extern decorators, although I initially added one too many. I've corrected that according to the update frotz code you sent me. I'm happy to make a PR.

mhauskn commented 3 years ago

Awesome! Please send a PR.