[Issue 2480] New: extern(C++) does not work with linux

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 30 09:10:58 PST 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2480

           Summary: extern(C++) does not work with linux
           Product: D
           Version: 2.014
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: link-failure
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: jason.james.house at gmail.com


foo.cpp file:
struct board{ void clear(){} };

bar.d file:
extern(C++){ struct board{ void clear(); } }
void main(){
  board b;
  b.clear();
}

build steps:
g++ -c foo.cpp -o foo.o
dmd -c bar.d -ofbar.o
gcc foo.o bar.o -L/usr/local/lib -L/usr/lib/gcc/i486-linux-gcc/4.3 -lstdc++ -l
phobos2 -lpthread

This was tried with Ubuntu 8.10 and dmd 2.014


-- 



More information about the Digitalmars-d-bugs mailing list