Archived

This topic is now archived and is closed to further replies.

sQuid

what the?

Recommended Posts

sQuid    149
Can anyone give me a remotely plausible reason as to why this might happen? I have two functions in a dll called Tangle(Matrix) and ITangle(Matrix,int) which both return doubles. If I call either of them in an example program they work fine. If I call one after the other (in either order) or even call the same function twice I get an "example.exe has encountered a problem and needs to close" error dialog. The details list the module name as ntdll.dll Even more bizarrely if I add a line above the return statement in each function like so ...     std::cout << tangle*tangle;     return tangle*tangle; } Then I no longer get the error dialog and everything works fine. Am I going mad?

Share this post


Link to post
Share on other sites
MrOreo    124
This sounds like a threading problem

Go to project->settings->c/c++ tab->change catagory to ''code generation'', and set the run-time library type to "debug multi-threaded", or try "debug multi-threaded dll"

One of these options should work.. This has remedied similar problems like this for me in the past.

-=|Mr.Oreo|=-
Code Monkey, Serpent Engine

Share this post


Link to post
Share on other sites
sQuid    149
Thanks, it was a threading / debug thing and I never would have thought of that.

/MLd for compiling the example and /LDd for the dll seems to work.

[edited by - sQuid on August 12, 2003 8:49:31 PM]

Share this post


Link to post
Share on other sites
sQuid    149
*sigh*

Now it just dies on the 5th attempt at calling either of the two functions. Which, although better than dying on the 2nd attempt, is still completetly weird.

Share this post


Link to post
Share on other sites
sQuid    149
Yeesh. So if I also add the /MDd switch when I am *compiling* the DLL as opposed to just the /LDd switch when linking it everything is fine.

Oh what fun. I''m sure you''re all fascinated.

Share this post


Link to post
Share on other sites