-
Application crashes at launch-time
Hi. I've got a problem. When I try to launch my application, it crashes. It compiled well, everything should be ok, but it isn't. Here's my api:
http://download.yousendit.com/F778F45E2CBBB92B
I really don't know why application sometimes crash at launch-time. Regards:confused:
-
Re: Application crashes at launch-time
Quote:
why application sometimes crash at launch-time
(i read it lunch-time)
maybe it doesn't like whats on the menu :p
just kidding.
-
Re: Application crashes at launch-time
You tried to debug this?! I'd first comment the connects out and see what happens...
-
Re: Application crashes at launch-time
How can I debug it if I don't have configured IDE with Qt, and I'm using it just to making code?
-
Re: Application crashes at launch-time
Quote:
When I try to launch my application
from this it sounds like it is YOUR application, as in, you programmed it.
Is it so, or are you just a user of this program?
-
Re: Application crashes at launch-time
No, I programmed this application.
-
Re: Application crashes at launch-time
Quote:
Originally Posted by
Salazaar
No, I programmed this application.
So where is the problem in debugging it?
If you can build it, you can debug it.
Either with debug messages or with a debuger.
You don't need a Qt configured IDE for that.
-
Re: Application crashes at launch-time
OK, so, how to debug it? I looked at the Assistant and typed make all instead of make, and reached:
C:\Dev-Cpp\bin\...\mingw32\...ld.exe cannot find -lqtmaind
I don't know is it this what you were asking about. If not, how to debug it?
edit:
executable was made - this was problem which appeared after building
-
Re: Application crashes at launch-time
Quote:
Originally Posted by
Salazaar
Please don't use external sites for showing images. Use the attachment feature of the forum. And don't use rar as the compressor but rather use some (g)zip variant if you really have to compress the image.
-
Re: Application crashes at launch-time
Quote:
Please don't use external sites for showing images.
The link was an image??
I thought it was the project...
EDIT:
It is the project.
-
Re: Application crashes at launch-time
Quote:
Originally Posted by
high_flyer
The link was an image??
I thought it was the project...
I don't know, I didn't open it, I hate RAR :) Anyway my comment applies to project files as well.
-
Re: Application crashes at launch-time
does the program crash every time, or just some times - this should crash every time.
Pardon me - this should not even compile!
I see you use 'ui' variable, yet you access GUI elements (which are not declered in the scope of your class) directly.
Look, I don't like answering like that, but you are really an extreme case.
Stop posting such questions.
You don't know C++, which is nothing to be ashamed of, but you can't expect us to waist our time to see the trivial mistakes you are making, and then teach you why they are a mistake.
Lern C++ first, then post your questions here.
This forum is NOT a C++ learning forum, there are many others on the net that do that.
-
Re: Application crashes at launch-time
Quote:
does the program crash every time, or just some times - this should crash every time.
Pardon me - this should not even compile!
I see you use 'ui' variable, yet you access GUI elements (which are not declered in the scope of your class) directly.
Look, I don't like answering like that, but you are really an extreme case.
Stop posting such questions.
You don't know C++, which is nothing to be ashamed of, but you can't expect us to waist our time to see the trivial mistakes you are making, and then teach you why they are a mistake.
Lern C++ first, then post your questions here.
This forum is NOT a C++ learning forum, there are many others on the net that do that.
Syntax error on "waist" - verb expected
Syntax error on "Lern" - unknown token
;)
-
Re: Application crashes at launch-time
hehe... I stand corrected.
But only two typos is not that bad, relative to other posts....
The problem is, that my fingers often type what they want, specially if I type fast.
-
Re: Application crashes at launch-time
Quote:
Originally Posted by
high_flyer
does the program crash every time, or just some times - this should crash every time.
Pardon me - this should not even compile!
I see you use 'ui' variable, yet you access GUI elements (which are not declered in the scope of your class) directly.
?? I've got Dialog class which inherits ui::Dialog, where are those declarations! And the function where are they used is part of this class!:confused:
-
Re: Application crashes at launch-time
Yes you are confused becasue you don't know C++.
But we can't help you with that, or at least, I don't have the time for it.
-
Re: Application crashes at launch-time
So I have to work at classes subject in my book...Maybe I'll understand...
-
Re: Application crashes at launch-time
That is a good way to go about it.
You can ask specifc C++ questions that you don't understand in the General Programming section in this forum.
-
Re: Application crashes at launch-time
And one more thing, in one of examples in C++ GUI Programming book, form was created by designer and one of command was groupBox->hide(); and it worked
-
Re: Application crashes at launch-time
-
Re: Application crashes at launch-time
This is access to GUI element, as you said. My code (subclassing) looks almost the same, and it doesn't work, because I have wrong GUI element access.
p.s.
I changed contents of my main.cpp file (it was wrong code in it) and it works.
edit. I mean that it doesn't crash, window is displayed but with no functionality. If I added ui. prefix in refering to GUI element would it be ok?
-
Re: Application crashes at launch-time
yes - but then you will stumble on the next error, and you wont understand why.
This is no way to learn C++.
Do it properly from the start.
-
Re: Application crashes at launch-time
Sure, I'll read classes chapter in C++ Symphony (Symfonia C++)
-
Re: Application crashes at launch-time
But there still is a problem. I added .ui prefix in every reference to gui element e.g. ui.convertButton->hide(); instead of convertButton->hide(); But it still doesn't have functionality. Did I miss something?
-
Re: Application crashes at launch-time
Quote:
But there still is a problem.
Which is exactlxy what I said in my last post:
Quote:
yes - but then you will stumble on the next error, and you wont understand why.
This is no way to learn C++.
Do it properly from the start.
-
Re: Application crashes at launch-time
;)Of course, you're right:)
-
Re: Application crashes at launch-time
Now I understand why do we have to use .ui prefix. Because in main cpp before creating dialog we define Ui::Dialog ui; where ui is a variable of the class in which is setupUi so that we have to call ui prefix to refer content of setupUi class. Is that right?
-
Re: Application crashes at launch-time
Well, yes and no.
Yes - but its not a "prefix".
Its an object, which has elements, and that is the way you reference elements of objects in C++.
But as you see, once you started reading a bit, things get much clearer.
Continue so.:cool:
You don't have to post here each time you learn a new C++ concept, we know them already ;)
You are welcome to ask specific question in the General Programming sections any time though.
-
Re: Application crashes at launch-time
I read classes chapter of my book and I think that there's something wrong with calling just e.g. hide():
Code:
ui.convertButton->hide();
But I don't know what. ;)
edit:
or maybe no. In docs it was something like this:
Code:
ui.colorDepthCombo->addItem(tr("2 colors (1 bit per pixel)"));
Could you tell me, what's wrong? I understand classes, but don't know why application doesn't have any functionality (the only working thing is exit button which closes dialog. But connection was made in designer)
-
Re: Application crashes at launch-time
provided that 'ui' is a valid member variable, that has accessible member pointer 'convertButton' that has an accessible member function 'hide()' - your code is correct.
With correct syntax your code will compile.
But correct systax is not enough for correct functionality.
Why your program does not function the way you expect it is another question, which has to do with your programs design.
But that is another story, which I suggest you leave at the moment.
Concentrate on C++ first.
Do some simple example programs and learn the concept.
Just readin one chapter in the book, does not make you REALLY know object oriented programming.
-
Re: Application crashes at launch-time
Do you really think that all I know about C++ is how to access class member?? I know C++ quite well, but I didn't use classes in my problem, that's the reason why I didn't understand "accessing GUI elements", and it doesn't mean that I don't know C++. What is wrong in my code? I really don't know... Regards
-
Re: Application crashes at launch-time
Quote:
Originally Posted by
Salazaar
I know C++ quite well, but I didn't use classes in my problem,
If you didn't use classes, what did you use then? Is the code of any of your programs available for download? I'd like to take a look at it.
-
Re: Application crashes at launch-time
I used combination of functions. No, the code isn't availible because as I said once my console programs are histroy. I'll ask you once more, why my application doesn't have functionality? Regards
-
Re: Application crashes at launch-time
Quote:
Originally Posted by
Salazaar
I used combination of functions.
So where was C++ in that? Maybe it was C then?
Quote:
No, the code isn't availible because as I said once my console programs are histroy.
That's a pitty... Were they some school projects or something you did for fun?
Quote:
I'll ask you once more, why my application doesn't have functionality?
Define "functionality". Does it contain widgets? Are they connected using signals and slots? Give us more details (be warned though, we'll still be assuming you know what you're doing regarding C++ syntax and semantics).
-
Re: Application crashes at launch-time
You are being very forceful and expecting the good people on here just to fix your problem.
You have been told to read more on C++ and I believe you should do. The best way to learn and fix your problems is by sitting down and trying to do it yourself first.
I'm sorry to sound hard, but having read lots of your posts, it seems you are just expecting to post your code on here and expect it to be fixed for you.
-
Re: Application crashes at launch-time
Quote:
I'll ask you once more, why my application doesn't have functionality?
We don't even know what functionality you are talking about.
Do you know how to use signals and slots?
-
1 Attachment(s)
Re: Application crashes at launch-time
Quote:
Originally Posted by
high_flyer
We don't even know what functionality you are talking about.
Objects on which I was doing:
Code:
ui.element->hide();
doesn't work, nextStepButton does nothing and so on. Maybe It'll b e better if you can see my code. I'll attach dialog.cpp
Quote:
Originally Posted by
high_flyer
Do you know how to use signals and slots?
Your kidding me?;) Of course, I know.
edit:
The problem isn't that I don't know how to connect signals to slots, I have functions which do something, connected to something and all should work, but it doesn't. Look at my file
-
Re: Application crashes at launch-time
well, settingUp() is a bunch of if() clauses.
Probably none of them gets to be true, so nothing happens.
Put a debug statement in and see if its being printed:
Code:
bool Dialog::settingUp()
{
qDebug()<<"Dialog::settingUp()";
//the rest of your code.
}
In addition make sure you get no signal/slot warnings when you execute the application.
-
Re: Application crashes at launch-time
Quote:
Originally Posted by
high_flyer
well, settingUp() is a bunch of if() clauses.
Probably none of them gets to be true, so nothing happens.
None?? If I, let's say' check checkbox in one group, and second in second grop and if nextStep Button is clicked one if() clause sure returns true and all instructions in if() should be done. But even if is a problem (which I think it isn't a problem) some widgets should be hidden, and we can type any value (even string) to lineEdit, although I have a validator.
Quote:
Originally Posted by
high_flyer
In addition make sure you get no signal/slot warnings when you execute the application.
No, I don't have any signal/slots warning when executing application.
-
Re: Application crashes at launch-time
did you try the code I gave you in the last post?
-
Re: Application crashes at launch-time
Yes, I tried it, application compiled with no errors, and no errors at launching.
-
Re: Application crashes at launch-time
Amm... yes, I expected as much, but the point was to see if you ar getting the debug message...:rolleyes:
EDIT:
you should start the application from the console
-
Re: Application crashes at launch-time
Debug message? What do you mean? I tried to type make all instead of make, and reached message that it cannot find file somename.dll. And if it's not the answer you were expecting, how can I reach debugg message?
-
Re: Application crashes at launch-time
Am... look at the code I gave you.
there is a line:
Code:
qDebug()<<"Dialog::settingUp()";
This will print 'Dialog::settingUp()' in the console if you run the application in the console, and if the slot will get executed.
If the slot will not get executed, the message will not be printed.
This will tell you if the problem is IN the slot, or that the problem is that the slot is not being called.
Just start the program in the console, and see what ouput you get.
No need for 'make all' or any other thing.
-
Re: Application crashes at launch-time
He's using Windows, so adding CONFIG+=console and rerunning qmake is advised.
-
Re: Application crashes at launch-time
I added this, rebuild application, console window opened (and also normal windows application with GUI opened) but the console was clear. What does it mean?
-
Re: Application crashes at launch-time
it means the slot is not being called.
But at the moment I don't have the time to review you code again...
So check every thing that has to do with the signal/slot connection.
-
Re: Application crashes at launch-time
Ok, I'll review it to find what's wrong. But even if the slot is not called, some widgets should be hidden even if there's no connection. Connection look:
Code:
connect(ui.nextStepButton, SIGNAL(clicked()), this, SLOT(settingUp()));
-
Re: Application crashes at launch-time
-
Re: Application crashes at launch-time
You tell us :) Did you come up with anything while reviewing your code? Because as for now you're the only one who saw it...