Skip to content

Undefined reference for pocoNetworkInitializer with MinGW #5087

@MayaPosch

Description

@MayaPosch

Describe the bug
While recompiling some existing projects that use Poco (libnymphcast library and C binding) I got the error undefined reference to pocoNetworkInitializer'`. I did not change anything about the code or Makefiles. I am compiling this in MSYS2 (UCRT) with current GCC and Poco libraries as available (1.14.2-1).

As a workaround I have added explicit network init in the C binding example and compile it with -DPOCO_NO_AUTOMATIC_LIB_INIT, in which case the project builds, links and runs fine.

To Reproduce
Running make on the main Makefile for the library (static and dynamic) or the C binding's example results in the linker failing with the above error.

Expected behavior
I would expect the code to link as it used to do a few Poco versions ago.

Logs
Feel free to suggest more information I can add.

Screenshots
Console output screenshots can be added as needed.

Please add relevant environment information:

  • OS: Windows 10, MSYS2 UCRT environment.
  • POCO Version: as above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions