https://bugs.llvm.org/show_bug.cgi?id=42516

            Bug ID: 42516
           Summary: "duplicate symbol" when using
                    "-fprofile-instr-generate" and "using namespace std;"
                    is used in two .cpp files
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangb...@nondot.org
          Reporter: alorb...@adiscon.com
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@metafoo.co.uk

So I am trying to do coverage with -fprofile-instr-generate and
-fcoverage-mapping on Windows with clang-8 (confirmed that devel clang 9 has
the same problem).

So if have a library porject that have two .cpp files in your project which use
this on top: 

using namespace std;

Once the compiled library is linked, you will get this error: 

Error           duplicate symbol: __profn_??_G_Facet_base@std@@UEAAPEAXI@Z in
project.lib(code1.obj) and in project.lib(code2.obj)

I could nail the problem down the namespace std, if you remove it from one if
the code files it will link.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to