Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] LNK1104: cannot open file 'debug\Project1.exe'

[Solved] LNK1104: cannot open file 'debug\Project1.exe'

Scheduled Pinned Locked Moved General and Desktop
10 Posts 5 Posters 29.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    silep
    wrote on last edited by
    #1

    Hello,

    I try to make work a small program with qt in visual basic. I've already tried to show only a small button and it worked, then Qt is well installed. But with my new program the compiling gives the message: @LINK : fatal error LNK1104: cannot open file 'debug\Project1.exe' @

    I don't know from where it comes, maybe an error in my lines, but there are quite simple.. I give the code from main.cpp, MaFenetre.cpp and MaFenetre.h

    main.cpp

    @#include <iostream>
    #include "maFenetre.h"

    int main (int argc, char *argv[])
    {

    QApplication app(argc, argv);
    MaFenetre window;
    window.show();

    return app.exec();
    }@

    MaFenetre.h

    @#ifndef DEF_MAFENETRE
    #define DEF_MAFENETRE

    #include <QtGui>
    #include <QApplication>
    #include <QtWidgets>
    #include <QPushButton>

    class MaFenetre: public QWidget
    {
    public:
    MaFenetre();
    ~MaFenetre();
    void show();

    private:
    QPushButton *bouton;
    QProgressBar *barre;

    };

    #endif@

    MaFenetre.cpp

    @#include "maFenetre.h"

    MaFenetre::MaFenetre(): QWidget()
    {
    setFixedSize(200,100);

    bouton = new QPushButton("Hey");
    bouton->setText("Salut!");
    bouton->setFont(QFont("Lucida Handwriting",20));

    barre = new QProgressBar;
    barre->move(200,300);

    }

    MaFenetre::~MaFenetre()
    {
    delete bouton;
    delete barre;

    }

    void MaFenetre::show()
    {
    bouton->show();
    barre->show();
    }@

    1 Reply Last reply
    0
    • C Offline
      C Offline
      clochydd
      wrote on last edited by
      #2

      Hi,
      is that the only error message or are there some more?
      Should "project1.exe" be the name of your executable?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        silep
        wrote on last edited by
        #3

        Hi, thank you for your reply. The global error message is

        @LINK : fatal error LNK1104: cannot open file 'debug\Project1.exe'
        1>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64\link.EXE"' : return code '0x450'
        1> Stop.
        1>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\nmake.exe"' : return code '0x2'
        1> Stop.
        1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "qmake && nmake debug" exited with code 2.@

        Yes, the project1.exe is the name of my executable

        1 Reply Last reply
        0
        • mranger90M Offline
          mranger90M Offline
          mranger90
          wrote on last edited by
          #4

          Is "Project1.exe" currently executing ?
          The times I've seen this error is because the application
          is currently active. Check you process list, or in your
          case the task manager.

          1 Reply Last reply
          0
          • C Offline
            C Offline
            clochydd
            wrote on last edited by
            #5

            I agree with mranger90: project1.exe must be running yet, kill the process and you will be able to continue

            1 Reply Last reply
            0
            • S Offline
              S Offline
              silep
              wrote on last edited by
              #6

              It was the problem, the last time I executed the program there was nothing to show so that I couldn't quit the executable.

              Thank you very much!

              1 Reply Last reply
              0
              • EddyE Offline
                EddyE Offline
                Eddy
                wrote on last edited by
                #7

                bq. I try to make work a small program with qt in visual basic.

                Are you using Qt Creator? The code your are using is C++ by the way.

                bq. the last time I executed the program there was nothing to show so that I couldn’t quit the executable.

                Using Qt Creator it's possible to stop a running executable using the "Application Output" pane by clicking the red button there.

                There is a good tutorial "on the wiki":http://qt-project.org/wiki/Basic_Qt_Programming_Tutorial
                which shows the things you want to achieve.

                Do you realy want to make a program which shows a button and a progresbar in a separate window?
                Normally we put widgets like that in a layout together in one window.

                Qt Certified Specialist
                www.edalsolutions.be

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  silep
                  wrote on last edited by
                  #8

                  Yeah, I'm training myself with visual because I must create a software with it and using Qt. So I try not to use Qt Creator except for Qt Designer.

                  Thanks for the tutorial I will read that. I have seen for the separate windows, I created a QWidget and I included his name in the different QWidgets to obtain just one window at the end with the included elements.

                  Is a layout very usefull if I always want the same window size? Why should I use it?

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    clochydd
                    wrote on last edited by
                    #9

                    If you always have the same window size you will probably not need a layout. With a layout you are more flexible and smart if the size can be changed by the user.

                    1 Reply Last reply
                    0
                    • Chris KawaC Offline
                      Chris KawaC Offline
                      Chris Kawa
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Layouts make your ui style independent.
                      What I mean by that is different users will have different system styles applied. boxes and buttons will differ in size, borders, font etc.
                      Things like barre->move(200,300) will look like you intended only on your (and some amount of other) computers. It might well be that someone will set larger font or different DPI settings and it will result in overlapping ui elements. Layouts take care of that for you so you don't have to figure out those exact numbers for all possible system configurations out there.

                      Also, it's a better idea not to manage destruction of the ui elements yourself. It's just too easy to forget one and leak. Instead of explicit delete bouton in the destructor just give it a parent in the constructor: bouton = new QPushButton("Hey", this); Then you don't have to think about it again since parent will delete all of its children when it's time.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved