Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Recommended Posts

I created (with much help of this forum's members) a quick Chook to save files as STLs. This worked fine in VS2003 and X MR2. Now when I compile it with VS2005 it gives me a warning that "fopen is deprecated". It says I should use fopen_s instead. It still compiled so I tried it with Mastercam, but it crashed as soon as I ran it. Here is a snippet:

 

FILE * f=0;

f = fopen("C:mcamxRPSTLstl_1.stl", "wt");

wr_stl(0.01, f, "", 0, true, true);

fclose (f);

 

Since I didn't have this fopen_s warning before when it was working fine, I'm assuming my crash might have something to do with this warning.

 

Any ideas are appreciated.

Link to comment
Share on other sites

If you want you can turn these warning messages off by defining "_CRT_SECURE_NO_DEPRECATE" in your preprocessor definitions but if you are concerned about security(hackers, crackers exploiting buffer overflows in your code) and otherwise too if you want your code to be robust you should use the more secure versions of these functions.

Link to comment
Share on other sites

Thanks both of you. I saw the message to turn off the warning messages, but I don't understand like you mention, what bag that would open up. So I'll try to debug it elsewhere.

 

Roger. I put the mastercam.exe debug version in my VS 2005 setup for this project. I have the X2 SDK too. But when I start the debugger it says:

 

"Debugging information for 'Mastercam.exe' cannot be found or does not match. No symbols loaded."

 

I also put mcamx as my working directory for debugging.

 

Are there any other settings I need?

Link to comment
Share on other sites

I'm sorry, but I don't see how my error is the same as his. The only solution presented there, that seemed to work, is to install the SDK directly under the hard drive, and not under mcamxsdk which is the default. Anyway, I didn't reinstall the SDK. I tried copying up the SDK folder-> C:sdk, and then changed my project properties to reflect the new path. So the debug application would be

 

C:sdkdebugMastercam.exe

 

But I got the same error that I mentioned before. Then as described in the link, I changed it to lowercase "mastercam.exe" as prescribed there. But that didn't work (besides, it is an uppercase in the folder). Then I put two instead of just one . But still I get the same error.

Link to comment
Share on other sites

I'm not sure what you mean markov? I'm' trying to debug a chook that I've written. I'd like to use the debug version of mastercam located mcamxsdkdebug. But when I start debugging in VS 2005, this debugger gives me the error I mention. Then if I click yes, and try to coninue past it, I would expect the version of Mastercam to come up. Then I would run my chook, and it should stop at my breakpoint back over in VS. But the Mastercam debugger does not start for me.

Link to comment
Share on other sites

Are you saying that Mastercam does not start no matter what you press on that dialog box? If I remember correctly, it asks if you still want to continue debugging even though the executable does not have debug information. If you answer that you want to go on, it should start Mastercam and let you start your C-hook. If you put a break point in it, it will stop then.

 

If this is not happening, I do not know what else to suggest.

Link to comment
Share on other sites

arrener,

 

You've recompiled in 2005. It occurs to me that you may have missed something.

 

If you:

compile with the XMR2 sdk

in VS2003

you should:

run in XMR2

 

If you:

compile with the X2 sdk

in VS2005

you should:

run in X2

 

you should not:

compile with the XMR2 sdk

in VS2005

 

nor should you:

compile with the X2 sdk

in VS2003

 

nor:

compile with the XMR2 sdk

but run in X2

 

etc. etc. etc.

Link to comment
Share on other sites

I finally got the debugger to work. One of the problems is that you must set the Linker->Debugging settings:

 

Generate Debug Info -> Yes(/DEBUG)

Generate Map File -> Yes(/MAP)

 

After I set those, for some reason, the debug version of Mastercam finally started for my project. Then I am able to debug my chook.

 

Unfortunately, when I got the debug version to run, I see that there aren't any errors in my code. Yet when I run it in the release version of Mastercam it crashes. So I am back to where I started. If anyone can try my chook on there machine and see if it does it for them, I'd appreciate it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...