undefined reference to stricmp

后端 未结 2 973
挽巷
挽巷 2021-01-02 03:50

I am trying to create a method that finds and replaces a string within a string but I seem to have some error at compile time with it. Could I get some help into figuring ou

相关标签:
2条回答
  • 2021-01-02 04:14

    Actually, the error is at link time and NOT at compile time. Your code got compiled to an object file expecting to find implementation of stricmp while linking with other object files which it couldn't find. Hence the error: "undefined reference to stricmp". As bmargulies pointed out, the implementation is available in only on Windows libraries. You can switch to strcasecmp() if you are on POSIX compliant systems.

    0 讨论(0)
  • 2021-01-02 04:28

    stricmp is Windows-specific. If you're not on Windows, strcasecmp.

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