1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Compiler problem in Visual C++

Discussion in 'Programming & Webmastering' started by Aleksander, Aug 27, 2011.

  1. Aleksander

    Joined:
    Dec 2, 2009
    Messages:
    3,259 (1.70/day)
    Thanks Received:
    305
    Hi guys!
    I am trying to compile in microsoft visual c++ 2008 in a windows application,
    but i cannot compile anything. It always says unable to start program,
    the system cannot find the file specified
    Pls help me!
     
  2. ctrain New Member

    Joined:
    Jan 12, 2010
    Messages:
    393 (0.21/day)
    Thanks Received:
    72
    the express version of visual studio does not come with the windows platform SDK, need to manually download it.
     
  3. Kreij

    Kreij Senior Monkey Moderator Staff Member

    Joined:
    Feb 6, 2007
    Messages:
    13,881 (4.71/day)
    Thanks Received:
    5,622
    Location:
    Cheeseland (Wisconsin, USA)
    Aleks;
    I'm not sure, but I thinkthe way you are using the main method should end you up with a stack overflow. Eveytime main recursively calls itself it will push a pointer to itself onto the stack.

    Probably be better to do something like
    Code:
    int main()
    {
        universe = 0/0; // <- doesn't this throw a divide by zero exception?
        while (true)
        {
             // don't do anything
        }
    }
    
    It's also not good programming practice to not have a way to exit a loop cleanly.
    Especially for debugging.
     
  4. Aleksander

    Joined:
    Dec 2, 2009
    Messages:
    3,259 (1.70/day)
    Thanks Received:
    305
    Lol I put that for fun, that has nothing to do with the question :)
    It is just a funny signature!
     
  5. Kreij

    Kreij Senior Monkey Moderator Staff Member

    Joined:
    Feb 6, 2007
    Messages:
    13,881 (4.71/day)
    Thanks Received:
    5,622
    Location:
    Cheeseland (Wisconsin, USA)
    Oh ... rolf
    I just saw code and my natural instinct was to debug it. :laugh:
     
    Last edited: Aug 27, 2011
    streetfighter 2 says thanks.
  6. streetfighter 2

    streetfighter 2 New Member

    Joined:
    Jul 26, 2010
    Messages:
    1,658 (0.99/day)
    Thanks Received:
    732
    Location:
    Philly
    If the program is very simple try compiling it with the Visual Studio Command Prompt.

    Something like:
    Code:
    cl /EHsc helloworld.cpp
     
  7. ctrain New Member

    Joined:
    Jan 12, 2010
    Messages:
    393 (0.21/day)
    Thanks Received:
    72
    yup it will overflow, but recursive main() is illegal anyway
     

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)

Share This Page