|
From: Robert H. <Rob...@gm...> - 2011-12-08 11:35:22
|
Hi there,
How is it possible to compile/create a native win32 console program with
MinGW's gcc / g++ runnable in cmd.exe so that the program
can accept a parameter * without interpreting is as current directory
content.
//Testcode
#include<stdlib.h>
#include<stdio.h>
int main(int argc, char* argv[]){
printf("Arguments: %i \n", argc);
{
int i=-1;
for(i=0; i< argc; i++){
printf("%s \t", argv[i]);
}
}
return 0;
}
//END Testcode
If I compile this code with with MinGW gcc (GCC) 4.5.2,
gcc argtest.c -o argtest.exe
I can run the exe like this and got:
c:\test>argtest.exe *
Arguments: 3
argtest.exe argtest.c argtest.exe
But I want that the MinGW compilation behaves for the user
like the MS VS2005 compilation
c:\test>argtest.exe *
Arguments: 2
argtest.exe *
If you wish I can write down the MS VC compiler , linker and manifest
tool options.
Best regards,
Robert Hartmann
|