Noob question about Debugging



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 16/02/2011 at 15:38, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   12 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    Prepare to be noobed.🙂

    When I try to use an API method that I've never used before. I rely on Visual Studio's intellisense to tell me if I've got the syntax right.
    But the problem is. Very often V.S. says I've got it written correctly. But the code doesn't actually work because I'm constructing the syntax the wrong way.
    In addition to this. The C4D console that I also use with Coffee. Almost never spits out any errors to help me figure out what I did wrong either.

    It's very rare when the console doesn't give me an error if I make a mistake with Coffee. Which is very helpful in tracking down where I made a mistake.
    But with C++. The console seems to be on vacation most of the time. Producing no errors, even when the code doesn't work.
    So I was wondering if there was some other way I'm supposed to use with C++ to check for errors?

    -ScottA



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 17/02/2011 at 01:50, xxxxxxxx wrote:

    If you want stuff printed to the console (such a variable value) you need to do it yourself - use GePrint() to do that. If it really is a syntax error that should be picked up by the compiler and you'll get compiler errors. That's the C++ equivalent of the COFFEE interpreter printing errors to the console.

    The best way of debugging is to step through the code line by line until you hit the problem. You do this by getting the project properties and in the 'Command' parameter, enter the path to the C4D executable.

    Now, when you hit F5 in VS, VS will use C4D as a debugger, allowing you to set breakpoints and step through the code. Works really well.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 17/02/2011 at 08:42, xxxxxxxx wrote:

    OK thanks.

    I just wanted to be sure that there wasn't something else besides those things you mentioned. That I didn't know about.

    -ScottA


Log in to reply