How do I fix undefined reference to _imp__*?

后端 未结 1 1689
无人及你
无人及你 2021-02-13 23:28

I\'m trying to compile something that depends on gtkspell, which depends on enchant, under MinGW. I\'m getting errors like gtkspell/gtkspell.c:757: undefined reference

1条回答
  •  清歌不尽
    2021-02-13 23:45

    The way to fix my minimal example is to add --libs after --cflags; gcc couldn't find the library to link against.

    I was able to fix the problem that I was running in to with the more complicated code that I was originally trying to compile (gummi (http://dev.midnightcoding.org/projects/gummi)) by passing LDFLAGS="$(pkg-config --cflags --libs gtkspell-2.0 enchant)" CFLAGS="$(pkg-config --cflags --libs gtkspell-2.0 enchant)" to the configure script; the problem seems to have been that the arguments to gcc were passed in the wrong order, and it couldn't find enchant when it was trying to link gtkspell.

    0 讨论(0)
提交回复
热议问题