cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Raistmer
Adept II

App crashes when brook DLLs rebuild with /MT option used

What could be the reason, help, please

I used brook.sln "Release" config to rebuild Brook DLLs not to use C runtime DLLs.
But when trying to use them with my app it crashes. It work OK with prebuilt DLLs provided with Brook 1.4 SDK.

What could be wrong with those rebuild DLLs ?
Used VC++ 2005 for rebuilding.
0 Likes
4 Replies
gaurav_garg
Adept I

/MT flag uses static C runtime libraries. Microsoft says using /MT flag is not recommended if you pass STL objects across dll interfcae (and it causes various heap corruption errors). You can search in MSDN for more details. Brook+ runtime has a different dll for CAL backend and brook.dll and brook_cal.dll contain STL objects in their exported interfaces.

You can build source with Release_CRTDLL configuration and it should work fine.

0 Likes

Originally posted by: gaurav.garg

/MT flag uses static C runtime libraries. Microsoft says using /MT flag is not recommended if you pass STL objects across dll interfcae (and it causes various heap corruption errors). You can search in MSDN for more details. Brook+ runtime has a different dll for CAL backend and brook.dll and brook_cal.dll contain STL objects in their exported interfaces.




You can build source with Release_CRTDLL configuration and it should work fine.



It will require to include CRT DLLs with app binary....
Well, at least your post indicates it could be considered as M$ bug 😕
0 Likes

Should it be possible to link brook runtime statically to app itself, that is, w/o any brook*.dll at all ?
0 Likes

Yes, it should be possible. But, then you have to change brook_cal.dll also to static library. Also, Brook+ runtime loads this dll at runtime, you need to change that code.

0 Likes