Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

how to import .net dll libraries in project



  • Hi,

    i need to inlcude dll files that usually are used with Visual C++ or c++/cli or similiar, these dll comes with ".tlb" files, and i tried to include these, but i get an error. I wrote in my include.h file:

    #import "mydll.tlb" no_namespace
    

    and i got following error message:

    mydll.tlb:1:1: error: unknown type name 'MSFT'

    why can t read and import .tlb file?? Anyone has same issue?

    Ty



  • Hi, make sure you're using an MSVC compiler (and not the MinGW)
    Try putting the #import statement in one of your .cpp files instead of an .h file. Also try it without the no_namespace suffix



  • Also make sure you are compiling with the /clr option on


Log in to reply