How to link C# and C++ assemblies into a single executable?

前端 未结 3 2078
情深已故
情深已故 2020-12-08 11:54

I have VS2008 solution containg a project that generates a C# executable that references a project that generates a dll containing both C++/CLI and unmanaged C++.

I

3条回答
  •  佛祖请我去吃肉
    2020-12-08 12:46

    The following is a Nant build-script that does exactly what you (and me) wanted (if I read your wanting right that is xD).

    Some of it is missing (like some variables, that aren't really needed), but it turned out to actually be fairly easy to achieve.

    This shows the cl/csc and linker-flags you need to be able to merge a mixed and a managed assembly. Also, as an added "bonus" all internal classes/methods/fields etc. is visible within the entire new assembly, meaning that they cross the boundary of the project.

        
        
            
                
                    
                
            
            
                
            
        
    
        
            
                
                
                
            
        
    
        
            
                
            
            
            
                
            
        
    
        
            
                
                
                
            
            
        
    

提交回复
热议问题