A build problem in Qt creator 1
Hi pals
I just installed Qt on windows XP and to become familiar with the details of Qt creator c++ programming, I wrote this code:
Code:
#include "test.h"
#include <conio.h>
#include <iostream.h>
void main(){
int x;
cin>>x;
cout<<x*x;
getch();}
but when i clicked on build menu,all icons were disabled.I saved the file but there was still no answer.
and one more thing.
in Qt creator code editing page,there is a wavy line under the #include lines.
thanks
Re: A build problem in Qt creator 1
Did you start a new project?
About the wavy lines - hover your mouse cursor over them to see what the problem is (if the line is green, it means the parser can't find the files you are trying to include).
Re: A build problem in Qt creator 1
No there is no project.
and you know,it should be able to find conio.h and iostream.h,shouldn't it?
Re: A build problem in Qt creator 1
no it shouldn't find iostream.h since its been deprecated for more than 10 years iirc. and should be using #include <iostream> and #include <cconio>
Re: A build problem in Qt creator 1
Quote:
Originally Posted by
Dante
No there is no project.
Then start one.
Quote:
and you know,it should be able to find conio.h and iostream.h,shouldn't it?
And how should it know where to look for them if it doesn't even know where the compiler is installed and what compiler you are going to use?
Re: A build problem in Qt creator 1
So you mean it compiles just the files that are part of a project not a single source file?
and could you tell me how to set the compiler ?
and what is the error below:
Quote:
:-1: error: collect2: ld returned 1 exit status
thanks
Re: A build problem in Qt creator 1
Quote:
Originally Posted by
Dante
So you mean it compiles just the files that are part of a project not a single source file?
Creator is not trying to be smarter than its user, how should it know how to compile a standalone file? What if you gave it an SQL file, what should it do with it? What platform should it try to compile it for and using what compiler?
Quote:
and could you tell me how to set the compiler ?
If you start a qmake project, qmake will create a proper Makefile for you. Just start a new project and the wizard will guide you.
Quote:
and what is the error below:
Linker couldn't find some library it wanted to link your application against. Hard to say what the problem was, you'd have to paste the first error message, not the last one.