Debugging the C executable using the C ++ - CLI library compiled with / clr

I use Visual Studio 2010 to debug an application, mostly written in C. Normally, I can attach the debugger just fine, but I ran into some problems when I link to a library written in C ++ / CLI.

If I compile a library with a flag /clr(which I eventually have to make for this from an unwritten library), I lose all the debugging capabilities of the entire C application, even those parts that have nothing to do with library calls. I get an empty circle with a yellow triangle and an exclamation mark where the red circle of the break point should be. Hovering over it gives me only a hint that says: "At the moment, the breakpoint will not be deleted. There is no executable code associated with this line. Possible reasons include conditional compilation or compiler optimization."

Then, if I link to the same library compiled without a flag /clr, I can debug my application again.

I understand that a visual studio is unlikely to be able to debug a library written in C ++ / CLI, and everything is in order. I just want to keep the ability to debug the rest of the application and at least see the results of my calls to an external library.

Another complicating factor is that this project is not created by a visual studio. It is compiled using an external make system, which uses it cl, so I can configure any commands that should be issued to the compiler this way.

Does anyone know why I cannot debug libraries now the way I want? Any advice how can I?

+3
source share
2 answers

. " " . "" "", . DLL , . , , Debug > Windows > Modules debugger, DLL. , DLL .

++/CLI , "", "" . . , , - . , , .

Debug , EXE . F5, .

+9

! ( , )

- Common Language Runtime Support (/clr), " " "", "" !

, :

1) , CLR ++, , .exe .

2) ++, mylibrary.dll, Common Language Runtime Support, ..exe mylibrary.dll.

Debugger Type, "Auto", , . , CLR-.

, → → → - ""!

+3

All Articles