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. I'm having issues with my compiler after reinstalling it several times, already. Qt can't find the main.o path directory file.
Forum Updated to NodeBB v4.3 + New Features

I'm having issues with my compiler after reinstalling it several times, already. Qt can't find the main.o path directory file.

Scheduled Pinned Locked Moved Unsolved General and Desktop
30 Posts 7 Posters 8.1k Views 3 Watching
  • 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.
  • mrjjM Offline
    mrjjM Offline
    mrjj
    Lifetime Qt Champion
    wrote on last edited by mrjj
    #15

    Hi
    I get same red lines if i add a "make clean step" to the project
    alt text

    Check you didnt add such step. To be sure.
    Close Creator. delete the .user file in project folder.
    set Compiler again. Rebuild.

    R 1 Reply Last reply
    0
    • Vinod KuntojiV Vinod Kuntoji

      @RedDot ,

      Delete the build folder and user files. Try Clean, qmake and build your project and run it.

      R Offline
      R Offline
      RedDot
      wrote on last edited by RedDot
      #16

      @Vinod-Kuntoji When I deleted the build folder and left everything else remainding such as the main.cpp and the .pro file.
      I rebuild the project and it seem to work?
      0_1501517260913_Untitled.png

      However, I added another output statement. Cleaned it and I received the same red message, I also rebuild it and got this below.
      0_1501517402011_Untitled.png

      1 Reply Last reply
      0
      • Vinod KuntojiV Offline
        Vinod KuntojiV Offline
        Vinod Kuntoji
        wrote on last edited by
        #17

        @RedDot ,

        Please show your pro file

        C++, Qt, Qt Quick Developer,
        PthinkS, Bangalore

        1 Reply Last reply
        0
        • mrjjM mrjj

          Hi
          I get same red lines if i add a "make clean step" to the project
          alt text

          Check you didnt add such step. To be sure.
          Close Creator. delete the .user file in project folder.
          set Compiler again. Rebuild.

          R Offline
          R Offline
          RedDot
          wrote on last edited by RedDot
          #18

          @mrjj Okay, so here's what I came to conclusion, first off, I've did what you you ask me to do. I closed the creator by this I closed the project, as well as closed all. I deleted the .user file in the project folder. I was asked to set the compiler again, so here's the configuration below.
          0_1501518163626_Untitled1.png
          I rebuild it and received this message below.
          0_1501518189158_Untitled2.png
          Now, to not received the message above I deleted the .user file as well as the builder folder. Rebuild it and it look like it works. That being said do I need to continue to do this process every time I want to rebuild the project?

          1 Reply Last reply
          0
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #19

            Hi
            Ok. not a make clean step then.
            Im out of ideas.

            You can safely ignore the red lines.

            1 Reply Last reply
            0
            • R Offline
              R Offline
              RedDot
              wrote on last edited by
              #20

              I decided to create a new QT account because maybe the issue is because it's retrieving meta information from remote repository. It does it when I installed it, since I have an account already with this IDE. So, I decide to create a new one instead, to avoid doing that. Also, after trying almost everything, I decided to reset my pc to factory settings, this deletes all the files, and apps.

              I'm going to reinstall QT Creator, as well as VS again. Could the problem be cause by VS as well, I had this installed way before I decide to try out the QT Creator IDE? I've notice it's conflicting with QT creator, what I mean by this whenever I created a project in QT, it would also create one for VS automatically?

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #21

                Hi,

                Unless I'm mistaken, isn't your main function signature wrong ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                R 1 Reply Last reply
                0
                • R RedDot

                  @sanojsubran
                  I've gave that a try and I received to messages one when I ran the qmake and the other when rebuild it afterwards.

                  When I manaully ran qmake once.

                  0_1501516036694_Untitled.png

                  When I try to rebuild the project afterwards. I did this vice versa, show the same thing, red message, once again appeared.
                  0_1501516065952_Untitled3.png

                  When I build it though I do not see the message and it works perfectly.
                  0_1501516286094_Untitled33.png

                  However when I either rebuild it or clean all project it does appear, again.
                  0_1501516423459_Untitle333d.png

                  A Offline
                  A Offline
                  ambershark
                  wrote on last edited by ambershark
                  #22

                  @RedDot The messages in red are because it is calling del main.o and main.o doesn't exist at that path. Before you rebuild or clean, go check that path (after a build) and see if main.o exists where it is supposed to. Also make sure the permissions are set properly.

                  The reason I suggest this is because I see mixing of Release/Debug in the paths. So it will be something like *-MinGW-Debug/release/main.o. That leads me to believe it is trying to remove something that isn't there and was never created.

                  You can ignore these lines, but it's interesting that you have MinGW-Debug and -Release but then debug/release inside each of those. That seems like a configuration issue to me.

                  My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

                  R 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Hi,

                    Unless I'm mistaken, isn't your main function signature wrong ?

                    R Offline
                    R Offline
                    RedDot
                    wrote on last edited by
                    #23

                    @SGaist Hi,
                    It's not wrong, that's how you write the main function in C++, I'm assuming you are referring to the int main ()? Ff so, it's not wrong. Also after resetting my entire pc to factory settings, deleting all the files/apps. I'm still having the same problem, that being said. The compiler does in fact compiles, and I'm able to run an .exe inside the IDE. Although, at this point, I've given up and decide to ignore the red message that consist of the main.o.

                    A 1 Reply Last reply
                    0
                    • R RedDot

                      @SGaist Hi,
                      It's not wrong, that's how you write the main function in C++, I'm assuming you are referring to the int main ()? Ff so, it's not wrong. Also after resetting my entire pc to factory settings, deleting all the files/apps. I'm still having the same problem, that being said. The compiler does in fact compiles, and I'm able to run an .exe inside the IDE. Although, at this point, I've given up and decide to ignore the red message that consist of the main.o.

                      A Offline
                      A Offline
                      ambershark
                      wrote on last edited by
                      #24

                      @RedDot said in I'm having issues with my compiler after reinstalling it several times, already. Qt can't find the main.o path directory file.:

                      It's not wrong

                      Well technically it is wrong. It works, and I do it like that for quick lazy test apps like this one. You can also do void main().

                      However @SGaist is right, the actual function signature for a c/c++ main entry point is int main(int, char**), i.e. int main(int argc, char *argv[]).

                      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

                      R 1 Reply Last reply
                      1
                      • A ambershark

                        @RedDot The messages in red are because it is calling del main.o and main.o doesn't exist at that path. Before you rebuild or clean, go check that path (after a build) and see if main.o exists where it is supposed to. Also make sure the permissions are set properly.

                        The reason I suggest this is because I see mixing of Release/Debug in the paths. So it will be something like *-MinGW-Debug/release/main.o. That leads me to believe it is trying to remove something that isn't there and was never created.

                        You can ignore these lines, but it's interesting that you have MinGW-Debug and -Release but then debug/release inside each of those. That seems like a configuration issue to me.

                        R Offline
                        R Offline
                        RedDot
                        wrote on last edited by
                        #25

                        @ambershark Hi, I just saw this before I submitted my reply to SGaist. In other words I should look for that specific directory you've written in red? The main.o is currently in this directory. Also how can I tell if the permissions are set properly? Or how I do where it should be set to?

                        C:\Users\gian_\Documents\build-untitled-Desktop_Qt_5_9_1_MinGW_32bit-Debug
                        
                        A 1 Reply Last reply
                        0
                        • R RedDot

                          @ambershark Hi, I just saw this before I submitted my reply to SGaist. In other words I should look for that specific directory you've written in red? The main.o is currently in this directory. Also how can I tell if the permissions are set properly? Or how I do where it should be set to?

                          C:\Users\gian_\Documents\build-untitled-Desktop_Qt_5_9_1_MinGW_32bit-Debug
                          
                          A Offline
                          A Offline
                          ambershark
                          wrote on last edited by
                          #26

                          @RedDot Run the attrib command will show permissions. Or if you are a gui user right click->properties, should be a permissions tab in there.

                          I'm not much of a windows user these days, just for video games mostly and testing my windows versions of my software. So I may be off a bit on right click filename->properties. :)

                          And those files from red in your screen shot are for sure there in that directory? Then when you run make clean or rebuild it says it can't find them?

                          Also can I see your *.pro file?

                          My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

                          1 Reply Last reply
                          0
                          • A ambershark

                            @RedDot said in I'm having issues with my compiler after reinstalling it several times, already. Qt can't find the main.o path directory file.:

                            It's not wrong

                            Well technically it is wrong. It works, and I do it like that for quick lazy test apps like this one. You can also do void main().

                            However @SGaist is right, the actual function signature for a c/c++ main entry point is int main(int, char**), i.e. int main(int argc, char *argv[]).

                            R Offline
                            R Offline
                            RedDot
                            wrote on last edited by
                            #27

                            @ambershark It was written this way when I created a plain C++ project, however I changed it to the actual way it's taught in books and universities. That's why I've written it as int main(), I've noticed though that in Visual Studio, it would create your basic hello world program, but with the same function signature as I have it. So, maybe it depends on the IDE?
                            When I ran the attrib.exe command it gave me a messages that I am not familiar with. Also when I right click on the project fileName -> properties I could not see the permission tab in there.
                            .pro file below.
                            0_1501550283507_Untitled.png

                            A J.HilkJ 2 Replies Last reply
                            0
                            • sanojsubranS Offline
                              sanojsubranS Offline
                              sanojsubran
                              wrote on last edited by
                              #28

                              @RedDot

                              Hi,

                              I would suggest you don't worry about the messages in red in the 'Compile Output' pane. If you get errors in the 'Issues' pane, do resolve it.

                              According to my understanding, what is happening is that when you are trying to do rebuild, the make is trying to delete the object files in both the 'debug' and 'release' folders. And since you have only build the project in the 'Debug' mode, it is not able to able to find the object file in the release folder. So this message is fine.

                              Possible scenarios where this message appear would be,

                              1. Manually when run 'clean' on the project and then do a rebuild, which in turn again will try to clean the project.
                              2. When you build the code in the debug only and do a rebuild. In this case, from the screenshots, I can see that some how it is trying to delete the object files in release folder also, which has never existed.

                              Regards,
                              San

                              1 Reply Last reply
                              1
                              • R RedDot

                                @ambershark It was written this way when I created a plain C++ project, however I changed it to the actual way it's taught in books and universities. That's why I've written it as int main(), I've noticed though that in Visual Studio, it would create your basic hello world program, but with the same function signature as I have it. So, maybe it depends on the IDE?
                                When I ran the attrib.exe command it gave me a messages that I am not familiar with. Also when I right click on the project fileName -> properties I could not see the permission tab in there.
                                .pro file below.
                                0_1501550283507_Untitled.png

                                A Offline
                                A Offline
                                ambershark
                                wrote on last edited by
                                #29

                                @RedDot said in I'm having issues with my compiler after reinstalling it several times, already. Qt can't find the main.o path directory file.:

                                It was written this way when I created a plain C++ project, however I changed it to the actual way it's taught in books and universities. That's why I've written it as int main(), I've noticed though that in Visual Studio, it would create your basic hello world program, but with the same function signature as I have it. So, maybe it depends on the IDE?

                                Yea it's the main entry point for c++, which is not affected by IDE at all. C++ is just plain text files which you can write and compile with no IDE at all.

                                The correct way is int main(int, char **). You can also ignore return value with void main or ignore parameters with int main(). All these will work, but the actual function signature is the first one. With void main you can't return a run code to the OS which is bad. With int main() you don't get the command line arguments, which can be bad or neutral if your app never uses them.

                                So the int main() that you are using will work just fine, however it is not technically correct. :) And of course has the limitations I listed above. But that really has nothing to do with your issues.

                                I would recommend just ignoring the reds for now since they aren't causing any issues.

                                And finally, if you want help with permissions (although I'm sure they are fine) you can post the output of attrib here and I'll interpret for you. ;)

                                My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

                                1 Reply Last reply
                                0
                                • R RedDot

                                  @ambershark It was written this way when I created a plain C++ project, however I changed it to the actual way it's taught in books and universities. That's why I've written it as int main(), I've noticed though that in Visual Studio, it would create your basic hello world program, but with the same function signature as I have it. So, maybe it depends on the IDE?
                                  When I ran the attrib.exe command it gave me a messages that I am not familiar with. Also when I right click on the project fileName -> properties I could not see the permission tab in there.
                                  .pro file below.
                                  0_1501550283507_Untitled.png

                                  J.HilkJ Offline
                                  J.HilkJ Offline
                                  J.Hilk
                                  Moderators
                                  wrote on last edited by
                                  #30

                                  @RedDot
                                  you mentioned earlier, that you also have visualstudio installed, at least before your factory reset. I would suggest that you use the MSVC (2015 or 2017) compiler and try it with that. Maybe its one of Windows many quirks :-)

                                  I personally prefere that compiler over MinGw, at least for pure windows projects.


                                  Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                                  Q: What's that?
                                  A: It's blue light.
                                  Q: What does it do?
                                  A: It turns blue.

                                  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