Results 1 to 20 of 26

Thread: Compiling with Qmake/Make

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2007
    Posts
    209
    Thanks
    34
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compiling with Qmake/Make

    Quote Originally Posted by wysota View Post
    No, I'm not, it's still a C lib...
    You were telling me Win API is C, like as if it is C exclusive. You acted like as if you didn't know what C++ and C difference is, or you were just trying to act smart by pointing out a very stupid and obvious thing. Of course the library is made in C, so what? It can still be used in C++ which I assumed you didn't know since you made such a stupid comment.

    Quote Originally Posted by wysota View Post
    *basically*...They are different languages.
    The only differences between C and C++ are Classes and OOP extensions. Templates, stronger typing, and a bigger standard library. So they are basically the same language, but the advantages of C++ are great which is why we use it, they are not different languages at all. That's like calling a person from another country a different race.

    Quote Originally Posted by wysota View Post
    Q_OBJECT is a macro which expands .....
    Yes obviously. I never said I didn't know what it is, I said that if wxWidgets can make macros without "moc" then Qt should be able to do it too.

    Quote Originally Posted by wysota View Post
    Manually? can't you just compile the file moc spits out?
    Yes it is what i do, but it's awful to remake the moc everytime you wanna test a new slot or changed your program for better slots.

    Quote Originally Posted by wysota View Post
    You're the first person on this forum who complains that "qmake doesn't work".
    I didn't say qmake doesn't work, I said the output of qmake does not work with make, meaning qmake made a wrong output file. Doesn't mean it doesn't work, it means it's buggy.

    Quote Originally Posted by wysota View Post
    Did you actually read it or is this just an assumption? AFAIR the docs clearly...
    How else would you explain me following the documentations exactly and then make not working. IF there is an environment mistake as you say, then why doesn't the docs mention this possibility?

    Quote Originally Posted by wysota View Post
    Ask a specific question and you'll get an answer, either from me or someone else.
    I been asking many times, I posted the qt pro file, did it look wrong? I used mingw32-make as someone mentioned, if mingw32 in devC++ works, but mingw32-make doesn't work, doesn't that mean the makefile generated by qmake is faulty?

    Quote Originally Posted by wysota View Post
    Actually you can use CMake instead of qmake...
    Why waste my time to learn another program, when I can make a project file for DevC++ and use it every time, that automatically adds the moc stuff that is needed. But I guess no one has made a project with DevC++ since no one has even mentioned such a capability.

    Quote Originally Posted by wysota View Post
    Actually we were using signals and slots quite often....
    So you never had to use moc or qmake with slots/signals? Then how did you get Q_OBJECT to work?

    Quote Originally Posted by wysota View Post
    Make is exactly such a button, just "pressed" from the cmdline.....
    I don't like opening cmd and finding my directory and using make everytime. I'd rather just compile every time I change code by pressing a button. If you like to waste time, that's your style, not mine.

    Quote Originally Posted by wysota View Post
    qmake and make don't compile code.....
    You contradicted yourself. You jsut said qmake and make don't compile, then you said that make makes a series of calls to the code reader and linker, which is called compiling and building. So obviously after using make, I should have an exe output ... right? Then that means it does compile.

    Quote Originally Posted by wysota View Post
    I tend to like to know someone means by "doesn't work"...
    I explained it several times, I get a bunch of errors with make, which I don't get with devC++ meaning qmake generates bad files, since make and devC++ both use same compiler.

    Quote Originally Posted by wysota View Post
    Oh yes. "Mr Mechanic, my car is broken because the engine doesn't start!"
    So a mechanic would then look inside the car, to see the environment, or in your position ask the person in need of help things that may result in faulty qmake output. Or ask for the makefile, or link to a qmake tutorial, or do something else that's helpful. Guess what, mechanics always get "my car is broken", because that's their job to figure it out, if they knew what was exactly wrong, why would they need the mechanic? If I knew what was wrong, why would I need to post on this forum?

    Quote Originally Posted by wysota View Post
    My guess about your problem is that you have a faulty environment - ....
    Well I have DevC++ installed. Which has mingw in its bin folder, I have a bunch of files in a project folder, so I used qmake -project, fixed the pro file so that it only includes the files I want to compile, and then typed qmake, then make, and the result was a hundred errors, even though devC++ compiles fine without errors. When you asked for specific information I replied with that specific answer. Scroll up and point out where I have not.

    Quote Originally Posted by wysota View Post
    Did you by any chance think that you might have misconfigured something? I have used that chain and it always worked.
    Probably, but then again, if I made a mistake I would assume a hundred others made the same mistake. And I would assume that people in this forum have probably already found a solution to it, since they probably have seen many topics about not being able to compile with qmake. Although I haven't found one while searching this forum.

    Quote Originally Posted by wysota View Post
    I suggest you actually take a look at a file moc generates....
    I guess the people at wxWidgets are just smarter? I saw what moc generates, it makes it so that the connection is established between objects, but somehow wxWidgets never had to do this, I wonder why.

    Quote Originally Posted by wysota View Post
    No, it was to have a fast and error-safe way of implementing object introspection and signals.
    Fast would be not using an external program on each of your project files.

    Quote Originally Posted by wysota View Post
    There is, it's called make or "visual studio integration" respectively...
    Well where is it.

    Quote Originally Posted by wysota View Post
    Actually you're really the first person complaining about it on this board....
    Odd, maybe because the process isn't simple, that I couldn't figure it out after hours and hours of trying even though I have had experience with many compiling problems. Meaning something went wrong. As for the amount of people complaining perhaps, they all faced the same problems and they switched to something else or gave up because they didn't know about this forum, maybe trolltech would be number 1 if they had only made these few things clear, or had a common problems page or something. Or step by step instructions on using qmake properly, or using DevC++ with qt, or VS with Qt.

    Quote Originally Posted by wysota View Post
    "moc" stands for "meta-object compiler"...
    I knew that, since I had to look it up to know how to use it right? Obviously I have said multiple times that i only use it with Q_OBJECT.

    Quote Originally Posted by wysota View Post
    To be honest I think I called moc ...
    I'm glad your makefiles work out for you. But I have never ever ever compiled successfully with make, even things not involved with qt. That is why I used IDEs that do it for me.

    Quote Originally Posted by wysota View Post
    From what I've seen, you didn't use mingw32-make when starting this thread.
    Yes, now I do, because before it said QMAKESPEC error, and the make was borland or something. Now I use mingw32-make, and now i have hundred errors even though my code is 100% correct. Meaning make doesn't know how to read code or is reading wrong files.

    Quote Originally Posted by wysota View Post
    Nothing is perfect and qmake complies with that statement. Why doesn't it work? Probably because...
    I dont know, all I know is I have mingw installed, and because of wxwidgets I have msys installed, and because of devC++ i have mingw installed again in its bin folder, which is the one I usually use.

    Quote Originally Posted by wysota View Post
    The project file is correct.
    So why wouldn't make work? Maybe if there was docs that fully explained what make does, and how to use it properly...

    Quote Originally Posted by wysota View Post
    First stop using the word "crap". Then call your make with "-v" ...
    Thank you for your helpful advice finally. GNU Make 3.80 is my output. How do I check the mingw32-make package, I thought I just did that?

    Quote Originally Posted by wysota View Post
    How about (defines and include paths omitted for clarity):...
    I'd rather not waste time learning each command line of g++ and let my IDE handle that.

    Quote Originally Posted by wysota View Post
    Why do you blaim qmake then if your development environment lacks some option? ...
    I blame qmake, because there is nothing else to blame. Only when I used qmake did I find the errors, so its either make or qmake's fault. Or maybe its trolltechs fault for not having easy steps to use them properly. My IDE works fine.

    Quote Originally Posted by wysota View Post
    AFAIK DevC++ is an IDE.
    OBviously.
    But I assumed people knew that DevC++ used mingw32.
    Quote Originally Posted by wysota View Post
    It will use whatever you configure it to use.
    Most use it for mingw.. I have never heard of anyone changing the default compiler.

    Quote Originally Posted by wysota View Post
    Either delete it from your system, rename it, put it behind mingw-make in the %PATH% (and rename mingw32-make to make) or call mingw32-make explicitely.
    Yeah I'll do that.

    Quote Originally Posted by wysota View Post
    You used an incorrect tool (Borland make) to build your project.
    No I get errors by using mingw32-make, not using make anymore.

    Quote Originally Posted by wysota View Post
    It probably calls a correct make version or doesn't use make at all (I think there is a plugin for DevC++ that handles Qt projects).
    Where? Also I can make it use make, but I dont see the point.

    BTW this is the first forum that has such fast session timeouts, like as if there is top secret information here or something.

    Look, I answer your questions, but qmake is not working for me, so I'm just gonna use moc manually now...

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Compiling with Qmake/Make

    Quote Originally Posted by VireX View Post
    No I get errors by using mingw32-make, not using make anymore.
    Can you post first few error messages?

    Quote Originally Posted by VireX View Post
    I saw what moc generates, it makes it so that the connection is established between objects, but somehow wxWidgets never had to do this, I wonder why.
    They never had to do this, because MFC and wxWidgets have a static event routing mechanism. They have to know exactly where the event should be directed at the compile time (which also means that you can't change that in the runtime).

    Qt has a generic communication mechanism which allows you to establish and remove connections in the runtime, so you don't know a priori what connections will be made, therefore you can't implement this using just a few macros harcoded in your sources.

    Quote Originally Posted by VireX View Post
    this is the first forum that has such fast session timeouts, like as if there is top secret information here or something.
    I can't remember when I had to log in last time, because I've checked the "remember me" check box and I suggest you to do the same. Anyway I have increased the session timeout to 30 minutes.

    Quote Originally Posted by VireX View Post
    qmake is not working for me
    That's better, at least it isn't crap that doesn't work at all. If we knew something more than "doesn't work" and "gives me errors", we could find the solution.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Compiling with Qmake/Make

    Quote Originally Posted by VireX View Post
    It can still be used in C++ which I assumed you didn't know since you made such a stupid comment
    It is you who brought up WinAPI. WinAPI has nothing to do with C++, that was my point. If I were to be picky I'd say that WinAPI contains graphical routines as well, but I didn't.

    The only differences between C and C++ are Classes and OOP extensions. Templates, stronger typing, and a bigger standard library. So they are basically the same language,
    The difference between C and Objective C is that the latter has objects, but I think noone sane would call them the same language... For me when you need to use a different approach when programming in two languages, they are different. And according to this, C and C++ are completely different.

    That's like calling a person from another country a different race.
    No, it's like calling a gorilla and a homo sapiens different species.

    Yes obviously. I never said I didn't know what it is, I said that if wxWidgets can make macros without "moc" then Qt should be able to do it too.
    Moc uses the macro as a marker, it doesn't do any magic with it. Q_OBJECT gets expanded by the C preprocessor, just like all other macros.

    And you don't have to use Q_OBJECT in your applications. If you don't need new signals/slots and don't have a need to extend a class with introspection abilities, you can omit it. Furthermore you can use signal implementation from Boost library.

    Yes it is what i do, but it's awful to remake the moc everytime you wanna test a new slot or changed your program for better slots.
    That's why you have make to do it for you. It's always tedious to do something manually when it can be automated.

    I didn't say qmake doesn't work,
    That was my impression when you called it crap.

    I said the output of qmake does not work with make, meaning qmake made a wrong output file...
    meaning qmake generates bad files
    It doesn't mean anything like that. It only means that make can't understand what qmake outputs.

    IF there is an environment mistake as you say, then why doesn't the docs mention this possibility?
    Probably because they can't cover every possible situation. Trolltech explicitely states that Borland tools are not supported in Qt4, so I don't see a point having an additional paragraph "When you call make, be sure not to be calling Borland make as it will not work. Furthermore if you implement your own make port, it might not work as well, especially if you don't implement functions GNU make usually has."

    I been asking many times, I posted the qt pro file, did it look wrong?
    As I already said, the project file is fine. The output from qmake is also probably fine. The problem is probably with make, not with qmake.

    I used mingw32-make as someone mentioned, if mingw32 in devC++ works, but mingw32-make doesn't work, doesn't that mean the makefile generated by qmake is faulty?
    No. It means that devC++ may be calling another copy of make than you call. Did you configure the build environment correctly?

    Why waste my time to learn another program, when I can make a project file for DevC++ and use it every time, that automatically adds the moc stuff that is needed.
    To have a choice? You're saying that you have to use qmake. I just told you, that you may use CMake instead.

    So you never had to use moc or qmake with slots/signals?
    I didn't say that. I said we didn't have any trouble with qmake. It worked when buttons failed.

    Then how did you get Q_OBJECT to work?
    Q_OBJECT doesn't "work". Q_OBJECT will get expanded regardless if you use qmake/moc or not. Moc does things like calculating method numbers, provides meta-data for the class, etc.

    You jsut said qmake and make don't compile (...) So obviously after using make, I should have an exe output ... right? Then that means it does compile.
    I said make is used to build the application and it's exactly what it does. It doesn't do anything with the program source on its own, so it doesn't compile. It's exactly the same when I say that the compiler doesn't link your app. It calls the linker to do it.

    I explained it several times, I get a bunch of errors with make,
    So maybe you should present them to us?

    So a mechanic would then look inside the car, to see the environment,
    Yes and after taking the engine apart he'd ask "What happened when you turned the key to start the engine?" and get a response "Oh, you have to turn the key?".

    or in your position ask the person in need of help things that may result in faulty qmake output.
    I can bet pretty good money that if you actually made qmake do anything (meaning you set QMAKESPEC correctly), it gave a correct result.

    Guess what, mechanics always get "my car is broken",
    Yes and then he asks "tell me exactly what happened".

    if they knew what was exactly wrong, why would they need the mechanic?
    Knowing what is wrong doesn't mean you know how to fix it.

    When you asked for specific information I replied with that specific answer. Scroll up and point out where I have not.
    Only a post ago you confirmed to have Borland make installed in your system and it was asked on the very beginning of this thread.

    Probably, but then again, if I made a mistake I would assume a hundred others made the same mistake.
    I think there have been topics about make failing either here or on QtForum (or both). The reason was most often MSYS or incorrect make being used. That's exactly the case here.

    I guess the people at wxWidgets are just smarter?
    Maybe they are. Does wxWidgets have a meta-object system? Could you tell me exactly on how many platforms does wxWidgets work? Does it work on embedded devices?

    I saw what moc generates, it makes it so that the connection is established between objects, but somehow wxWidgets never had to do this, I wonder why.
    Then look again. Moc is not only about signals and slots. To be honest it's just a side effect of object introspection. That's why I told you what "moc" actually means. It's not called "ssc" or "sasc" or "pitaa" but "moc".

    Fast would be not using an external program on each of your project files.
    Fast during execution, not compilation (you compile once, execute multiple times). You have to admit comparing integers is much faster than parsing and comparing strings.

    Or step by step instructions on using qmake properly, or using DevC++ with qt, or VS with Qt.
    http://doc.trolltech.com/4.2/qmake-manual.html
    http://doc.trolltech.com/4.2/tutorial-t1.html

    I don't use DevC++ so I can't give you a link. But I think there is a tutorial about it somewhere. VS Integration surely comes with a manual.

    Yes, now I do, because before it said QMAKESPEC error, and the make was borland or something.
    What did you set QMAKESPEC to? I think in your case it should point to mkspecs/win32-g++ directory in your Qt installation dir.

    Now I use mingw32-make, and now i have hundred errors even though my code is 100% correct.
    Which version? What errors?

    I dont know, all I know is I have mingw installed, and because of wxwidgets I have msys installed,
    Don't use MSYS with Qt. mingw32-make inside MSYS doesn't know how to handle paths generated by qmake. Trolltech has prepared a solution for that so since 4.3 you're able to compile from inside MSYS as well.

    and because of devC++ i have mingw installed again in its bin folder, which is the one I usually use.
    So you have two MinGW installations? Are they in the same version? Maybe they somehow get mixed up?

    So why wouldn't make work?
    qmake relies on some features which are not implemented with all ports of make - you have to use make that is compatible with GNU make. Period. Having workarounds for all possible configurations was too expensive for Trolltech - after all, they are to write code, not to produce workarounds for faulty tools.

    Maybe if there was docs that fully explained what make does, and how to use it properly...
    http://www.gnu.org/software/make/manual/


    Or maybe its trolltechs fault for not having easy steps to use them properly.
    We can go through this over and over. The tool is incorrect, not the way you use it.

    My IDE works fine.
    So why not stick with it?

    No I get errors by using mingw32-make, not using make anymore.
    Did you set QMAKESPEC to point to win32-g++ and rerun qmake? What errors do you get?

    BTW this is the first forum that has such fast session timeouts, like as if there is top secret information here or something.
    Sorry for that, I think Jacek just corrected it. Just please don't start blaiming the forum now We're currently using most time to answer questions, not to maintain the software. There is no top secret information here and you can view all the content even if not logged in, so you're just being picky.

Similar Threads

  1. Flex, Bison and qmake
    By Hydragyrum in forum Qt Programming
    Replies: 5
    Last Post: 2nd May 2011, 15:52
  2. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  3. qmake to build both 32-bit and 64-bit
    By lni in forum Qt Programming
    Replies: 8
    Last Post: 12th December 2006, 19:35
  4. Setting up qmake to run "Hello World"
    By Rolsch in forum Newbie
    Replies: 2
    Last Post: 27th May 2006, 02:37
  5. linking user space and kernel space programs with qmake
    By zielchri in forum Qt Programming
    Replies: 9
    Last Post: 8th March 2006, 23:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.