×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Apr 2009
    Location
    Kuala Lumpur
    Posts
    98

    Question why this simple program doesn't run?

    Hi, I've written this simple program but it doesn't run. it doesn't show error but after build and run only shows "exited with code 0" instead of some strings whixh i've written in main body.

    PHP Code:
    #ifndef mainwindow_H
    #define mainwindow_H

    class mainwindow
    {
    private:
            
    double a;
            
    double b;

    public:
            
    mainwindow()
            {
                
    0.0;
                
    0.0;
            }

            
    mainwindow(double xdouble y)
            {
                
    x;
                
    y;
            }

            
    void setA(double x)
            {
                
    x;
            }

            
    void setB(double y)
            {
                
    y;
            }

            
    double getA()
            {
                return 
    a;
            }

            
    double getB()
            {
                return 
    b;
            }

            
    void add(double xdouble y)
            {
                
    y;
            }

            
    void sub(double xdouble y)
            {
                
    y;
            }

            
    void mul(double xdouble y)
            {
                
    y;
            }

            
    void div(double xdouble y)
            {
                
    y;
            }
    };

    #endif 
    PHP Code:
    #include <iostream>
    #include "mainwindow.h"

    int main()
    {
        
    std::cout << "Program starts. . ." << std::endl;

        
    mainwindow test1;
        
    mainwindow test2(0.6660.875);

        
    std::cout << "A = " << test1.getA() << std::endl;
        
    std::cout << "B = " << test2.getB() << std::endl;

        
    test1.setB(test2.getB());
        
    test2.setA(test1.getA());

        
    std::cout << "A = " << test1.getA() << std::endl;
        
    std::cout << "B = " << test2.getB() << std::endl;

        return 
    0;



  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: why this simple program doesn't run?

    This is not really Qt application, but it works fine.
    Code:
    $ qmake-qt4 -project
    QFileInfo::absolutePath: Constructed with empty filename
    $ qmake-qt4 
    $ make
    g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. -o main.o main.cpp
    g++ -Wl,-O1 -o nonqt main.o     -lQtGui -lQtCore -lpthread 
    $ ./nonqt 
    Program starts. . .
    A = 0
    B = 0.875
    A = 0
    B = 0.875

Similar Threads

  1. Any program to run textshell on the phone?
    By ahe in forum Symbian Tools & SDKs
    Replies: 10
    Last Post: 2010-11-16, 13:10
  2. java program cannot run on nokia 81
    By nikornluang in forum Mobile Java General
    Replies: 3
    Last Post: 2009-04-20, 05:49
  3. how can i run my program automaticlly several times??
    By bs.bs in forum Mobile Java General
    Replies: 3
    Last Post: 2009-01-28, 08:13
  4. problems to run simple java application
    By Kaysc in forum Mobile Java General
    Replies: 3
    Last Post: 2005-10-04, 01:39
  5. Replies: 0
    Last Post: 2003-03-20, 09:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •