https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99695

            Bug ID: 99695
           Summary: Cannot static compile with C++ module
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: unlvsur at live dot com
  Target Milestone: ---

Hello.cc
module;
// legacy includes go here – not part of this module
import <iostream>;
import <string_view>;
export module Hello;
// the module purview starts here
// provide a function to users by exporting it
export inline void SayHello(std::string_view name)
{
        std::cout << "Hello " << name << "!\n";
}

main.cc
import Hello;

int main()
{
        SayHello("sdgsdg");
}


g++ -o main hello.o main.o -Ofast -std=c++20  -fmodules-ts -static
D:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/11.0.1/../../../../x86_64-w64-mingw32/bin/ld.exe:
D:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/11.0.1/../../../../lib\libstdc++.a(cxx11-locale-inst.o):(.rdata$_ZTVNSt7__cxx118numpunctIcEE[_ZTVNSt7__cxx118numpunctIcEE]+0x0):
multiple definition of `vtable for std::__cxx11::numpunct<char>';
main.o:main.cc:(.rdata+0x3a0): first defined here

bunch of errors

Reply via email to