Thread: EXE file

  1. #1
    Registered User
    Join Date
    Nov 2019
    Posts
    8

    EXE file

    so im not sure if theres an issue with my code but this same error keeps popping up about the .exe and i have no clue what to do. any help?
    https://cboard.cprogramming.com/imag...AAAElFTkSuQmCC

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,549
    Your link appears to be broken.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Nov 2019
    Posts
    8
    EXE file-exe-jpg
    Last edited by Lu1408; 12-13-2019 at 12:52 AM.

  4. #4
    Registered User
    Join Date
    Dec 2017
    Posts
    862
    Your original link contains 223702 characters. Either you are posting an image incorrectly or there is something wrong with image posting on the site. I notice that it was a "png" image, but the (totally unreadable) image you just posted is a jpg. Maybe there is something wrong with posting png images in particular.

    Here's a test png image (Knossos silver coin, 400bc) :
    EXE file-knossoscoin-png

    Seems to work.

    Anyway, it's kind of useless posting pictures of text. If I remember correctly, you can click on the popup box and press Ctrl-C to copy the text of the message.
    The world hangs on a thin thread, and that is the psyche of man. - Carl Jung

  5. #5
    Registered User
    Join Date
    Nov 2019
    Posts
    8
    it was a screenshot, i posted it again and it seems to work fine now

  6. #6
    Registered User
    Join Date
    Dec 2017
    Posts
    862
    Okay. Whatever. Later.
    The world hangs on a thin thread, and that is the psyche of man. - Carl Jung

  7. #7
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,549
    I think you should post the text of the error message. As it stands, I cannot read the text shown in the image on my phone as it appears too blurred.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  8. #8
    misoturbutc Hodor's Avatar
    Join Date
    Nov 2013
    Posts
    1,742
    Quote Originally Posted by laserlight View Post
    I think you should post the text of the error message. As it stands, I cannot read the text shown in the image on my phone as it appears too blurred.
    What you have to do is zoom in, enhance, rotate, enhance, look around corner, zoom in and then enhance

  9. #9
    Registered User
    Join Date
    Nov 2019
    Posts
    8
    okay well the error says "Unable to start program (directs to file)" however the last file is the .exe file which isnt in my debug folder. then below that it says "The system cannot find the file specified". last time i did a project the .exe file was made autmatically so im not sure why its not there now.

  10. #10
    Registered User
    Join Date
    May 2010
    Posts
    4,496
    . last time i did a project the .exe file was made autmatically so im not sure why its not there now.
    Probably because the build failed.

    Cut and paste the error messages from the IDE, the picture is pretty much unreadable.

    If all else fails cut and paste the complete code, inside code tags in a post.

  11. #11
    Registered User
    Join Date
    Nov 2019
    Posts
    8
    Code:
    #include <iostream>
    
    using namespace std; 
    
    const int g_kiSize = 3;
    char g_acBoard[g_kiSize][g_kiSize] = { { ' ', ' ', ' ' },{ ' ', ' ', ' ' },{ ' ', ' ', ' ' } };
    void resetBoard();
    bool setBoard(int iX, int iY, char cCharValue);
    void displayBoard();
    
    void resetBoard()
    {
        for (int i = 0; i < g_kiSize; i++)
        {
            for (int j = 0; j < g_kiSize; j++)
            {
                g_acBoard[i][j] = ' ';
            }
        }
    }
    
    bool setBoard(int iX, int iY, char cCharValue)
    {
        if (g_acBoard[iX][iY] == ' ')
        {
            g_acBoard[iX][iY] = cCharValue;
            return true;
        }
        else
        {
            return false;
        }
    }
    
    void displayBoard()
    {
        cout << "+---+---+---+" << endl;
        for (int j = 0; j < g_kiSize; j++)
        {
            for (int i = 0; i < g_kiSize; i++)
            {
                cout << "| " << g_acBoard[i][j] << " ";
            }
            cout << "| " << endl;
            cout << "+---+---+---+" << endl;
        }
    }
    in my last post replying to someone i posted the error message by typing it out.

  12. #12
    Registered User
    Join Date
    May 2010
    Posts
    4,496
    in my last post replying to someone i posted the error message by typing it out.
    I'm not talking about that error message. I'm talking about the compiler error messages in your IDE, not the "runtime" message.

    For example the code you supplied gives the following errors in my IDE:

    -------------- Build: Debug in c++homework (compiler: GNU GCC Compiler)---------------

    g++ -Wall -fexceptions -g -c /home/jim/Working/c++homework/main.cpp -o obj/Debug/main.o
    g++ -o bin/Debug/c++homework obj/Debug/main.o
    /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
    (.text+0x20): undefined reference to `main'
    collect2: error: ld returned 1 exit status
    Process terminated with status 1 (0 minute(s), 0 second(s))
    2 error(s), 0 warning(s) (0 minute(s), 0 second(s))
    Where is your main()? Every C++ program must contain a main() function.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 11-21-2017, 10:48 AM
  2. Replies: 6
    Last Post: 12-28-2015, 03:36 AM
  3. Replies: 3
    Last Post: 11-28-2012, 09:16 AM
  4. Replies: 11
    Last Post: 09-25-2011, 12:22 AM
  5. Replies: 4
    Last Post: 07-06-2006, 02:53 AM

Tags for this Thread