How to get output Screen



  • I have to installed QT creator ver 4.8 and i have one project, it developed QT creator ver 4.5 in Linux platform on 2008. Now i want to update some changes for feature enhancement. i had to try to compile and run the project successfully, but i could't get the output screen. the (.pro) file generated only the .exe file only. How can i get the resultant output UI screen, what will i made for that.



  • Hi,

    if you mean print the qDebug() output to the console you should add

    CONFIG += console
    

    to your .pro file



  • Here is the error,

    b77ea000-b77eb000 r--p 002c0000 08:01 1966228 /usr/lib/locale/locale-archive
    b77eb000-b77ed000 rw-p 00000000 00:00 0
    bfaa8000-bfac9000 rw-p 00000000 00:00 0 [stack]
    The program has unexpectedly finished.
    /home/dyansys/Desktop/ECScope/ecg12i-build-desktop-Qt_4_8_1_in_PATH__System__Release/ecg12i exited with code 0

    can you advice me



  • Which plaftorm??



  • @mcosta Linux using C++



  • Compile Output

    18:04:43: Running build steps for project ecg12i...
    18:04:43: Configuration unchanged, skipping qmake step.
    18:04:43: Starting: "/usr/bin/make" -w
    make: Entering directory /home/dyansys/Desktop/ECScope/ecg12i-build-desktop-Qt_4_8_1_in_PATH__System__Release' make: Nothing to be done forfirst'.
    make: Leaving directory `/home/dyansys/Desktop/ECScope/ecg12i-build-desktop-Qt_4_8_1_in_PATH__System__Release'
    18:04:43: The process "/usr/bin/make" exited normally.



  • sorry, I understood you was on Windows (CONFIG += console works on it)

    @Arasu said:

    How can i get the resultant output UI screen, what will i made for that.

    What means??



  • I couldn't get the User Interface screen, but it had to create .exe file direcly



  • i am thinking that, the code which i'm having will be compatible for both windows and Linux(ubuntu). right?



  • Depends on you code?
    Is a 100% Qt code??



  • Actually, to my knowledge, the previous developers have developed the code using QtCreator only. apart from that how can i make sure it is completely Qt COde?


  • Moderators

    @Arasu Looking at this output

    b77ea000-b77eb000 r--p 002c0000 08:01 1966228 /usr/lib/locale/locale-archive
    b77eb000-b77ed000 rw-p 00000000 00:00 0
    bfaa8000-bfac9000 rw-p 00000000 00:00 0 [stack]
    The program has unexpectedly finished.
    /home/dyansys/Desktop/ECScope/ecg12i-build-desktop-Qt_4_8_1_in_PATH__System__Release/ecg12i exited with code 0
    

    The code does compiles properly but seems it crashes at some point during runtime. Something related to locale perhaps. You will need to debug it.



  • Thank you!

    Shall i know how to debug the code in QT creator? Why because previously the project created in QT creator version 4.3, but now i am using version 4.8, this version deprecated some of the default methods.


  • Moderators

    @Arasu Using QtCreator see this and some info here.
    Also if you know which methods are deprecated you can replace them with appropriate one.



  • @p3c0 Can you give some example code for this qDebug() ?


  • Moderators

    @Arasu Its in the docs. Check this link.



  • Thank you!

    Is this for Linux using C++ ah?


  • Moderators

    @Arasu qDebug() will work on all platforms since it is a Qt API.
    And using QtCreator you will have to use valgrind for debugging. It comes for Linux.



  • Now im trying both linux and windows, but both environment i am getting same issue, can you suggest for windows.


  • Moderators

    @Arasu If it is the same issue then if you solve it for one platform then same will be reflected for other platforms too. I would suggest you to solve it for your primary OS i.e Linux.



  • Also shall i know the valgrind?



  • i am working two diff system, one is window other one is linux, which is better understand?


  • Moderators

    @Arasu According to this there is no official port for Windows. Check Qt_creator_windows_debugging for windows. Sorry but I'm not much into Windows.


  • Moderators

    @Arasu Depends upon your experience with the respective OS :)



  • Sure! i will take the better one. If i have any queries i will text you.



  • Hello Friend!

    Now i am working windows platform, got this error

    ..\ecg12i_backup\PatientList.cpp: In function 'void on_Patient_Info_List_Screen_show(PATIENT_LIST*)':
    ..\ecg12i_backup\PatientList.cpp:93:47: error: 'alphasort' was not declared in this scope
    n = scandir(PATIENTINFODIRLOC, &namelist, 0, alphasort); //It scans for files in Directory PATIENTINFODIRLOC and put it in namelist
    ^
    ..\ecg12i_backup\PatientList.cpp:93:56: error: 'scandir' cannot be used as a function
    n = scandir(PATIENTINFODIRLOC, &namelist, 0, alphasort); //It scans for files in Directory PATIENTINFODIRLOC and put it in namelist
    ^
    ..\ecg12i_backup\PatientList.cpp:102:40: error: 'rindex' cannot be used as a function
    ptr = rindex(namelist[n]->d_name, '.');


  • Moderators

    @Arasu these are c specific issue. scandir is a function in dirent.h. Check if it is there for Windows and include it.



  • How can i check this issue? Kindly advice me


  • Moderators

    @Arasu dirent.h usually comes with C Posix Library. Which compiler kit are you using ?
    If msvc then you wont get dirent.h. Find out a way for how to include dirent.h on Windows.



  • Hi,

    seems your projects includes some Linux/UNIX specific code.
    I suggest to understand if you can refactor it in order to be ported also on Windows (for example using Qt classes)



  • Thanks!

    Now i am only using QT creator, none other compiler.


  • Moderators

    @Arasu I think you must start from Qt basics. Qt Creator is not a compiler but an IDE.
    Please first check whether the code can be easily compiled on Windows. What are the required dependencies ? How much effort it would require for compiling ? etc..
    If not easy then better to compile it on Linux as the first hitch (scandir) you came across can easliy be solved on Linux.



  • Hi,

    Qt Creator is only a IDE, to build/run a project it uses the Kit configured for it.



  • I am really sorry, i don't know these kinds of knowledge about QT Creator. Which is the compiler for both windows and linux. Let me know this for my knowledge



  • Hi,

    the standard compiler for Linux is gcc and there is a porting of it for Windows MinGW.
    But this doesn't mean you MUST use it (you're free to choose different compiler for each platform).
    In example in my company release the same product for Windows, Linux and OSX and we use different compiler

    • Windows (Visual Studio)
    • Linux (gcc)
    • OS X (clang)


  • Thanks lot!

    I will try to compile using these things.



  • Hello Friends!

    C:>cd C:\Users\puavs\Desktop\Dont Delete\ecg12i_backup

    C:\Users\puavs\Desktop\Dont Delete\ecg12i_backup>path=c:\windows\system32;C:\Min
    GW\bin

    C:\Users\puavs\Desktop\Dont Delete\ecg12i_backup>gcc main.cpp -o main.cpp
    Main.cpp:2:24: fatal error: QApplication: No such file or directory
    #include <QApplication>
    ^
    compilation terminated.



  • Now i am using minGW 4.6 compiler, Shall i know the commands to compile my .pro file also Qmake ?



  • Error while building project 2.2 (target: Desktop)
    When executing build step 'qmake'
    Error while building project 2.2 (target: Desktop)
    When executing build step 'qmake'

    How to solve this?



  • /home/dyansys/Desktop/PANS_100-build-desktop-Qt_4_8_1_in_PATH__System__Release/../PANS_100/ecg_processing.cpp:9: error: usb.h: No such file or directory

    Shall i know how to resolve this error


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.