Commandline arguments
-
Dear,
I've just released my app, and in Qt creator everything works even with the command line args. But when in release mode and I go to my CMD and type something like test.exe 1 1 the program doesn't do anything...
This is the way I get the args:
@int main(int argc, char *argv[]) @Can someone help me?
Kind regards,
-
[quote author="browser90" date="1357154070"]I go to my CMD and type something like test.exe 1 1 the program doesn't do anything...
This is the way I get the args:
@int main(int argc, char *argv[]) @
[/quote]This is just a declaration of the main method. Please post more source code form your app. What do you do with the arguments that are passed from the command line?
-
I use them in a thread and then I show a QLabel were I put some QImages on and that's it.
When I run my app in QT everything works like a charm. It's just when I make a release exe or debug exe that I want to start from the cmd that it doesn't show my QLabel.. I've got every DLL that I need...
-
How can you use main(int argc, char *argv[]) in a thread?
The main function is the entry point of your app and what the "main" thread will execute first.
If you create additional threads, they won't start from the "main" function!!
Instead whatever API you use to create the thread will ask for a pointer to the thread "start" function.
BUT: None of the thread API's I know (Win32, pthreads, QThread) has this signature for the "start" function:
@int (*main)(int argc, char *argv[])@Instead it's usually something like:
@void* (*start)(void *param)@So how do the values of argc and argv get into your thread's start function?