How to pass multiple commands arguments in visual studio?

元气小坏坏 提交于 2019-12-07 23:17:05

问题


I am working on a compession/decompression project using the LZMA SDK.

The main program contains some arguments that I must use to run the application

To run it from the command line, I use :

./LzmaUtil.exe e input.elf output.elf

I'm using VS 2013 , so i have added e in.elf out.elf to the commands arguments, I rebuild the project (the executable file in generated) but nothing seems to happen when I press RUN.

Note that I have the input.elf in the debug folder were the .exe is present there, and the , the flag e is used to compress the file and output.elf is the compressed file.

The main function contains :

int MY_CDECL main(int numArgs, const char *args[])
{
    char rs[800] = { 0 };
    int res = main2(numArgs, args, rs);
    fputs(rs, stdout);
    return res;
}

The complete source code is available at : http://www.7-zip.org/sdk.html

Debugging :

With no arguments at all I get :

The program '[5284] LzmaUtil.exe' has exited with code 0 (0x0).

With the arguments I have mentionned I get :

The program '[5284] LzmaUtil.exe' has exited with code 1 (0x1).

so something is happenning !!!

With breakpoint at the main I get :

numArgs 4   int
args    0x007eaca8 {0x007eacbc "E:\\1PFE\\LZMA\\LzmaUtil\\Debug\\LzmaUtil.exe"} const char * *

Any help will be appreciated, thanks.


回答1:


The output was empty because i have put the file in the debug folder , it in the same folder of the executable.

But when i put the file at the parent directory (the solution folder) it finally worked .

That's how visual studio works !.



来源:https://stackoverflow.com/questions/35196376/how-to-pass-multiple-commands-arguments-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!