RT,下面一段代码:
char tmpPath[MAX_PATH] ;
_getcwd(tmpPath, MAX_PATH);
std::string path = tmpPath ;
BinCommand = "g++.exe \"" + Next + "\" -o\"student.exe\" -m32 -I\"..\\x86_64-w64-mingw32\\include\" -L\"..\\x86_64-w64-mingw32\\lib32\" -static-libgcc -lgdi32 -lcomdlg32 -m32" + " & move student.exe " + path + "\\" ;
printf("%s\n", BinCommand.c_str()) ;
然后path一直是
C:\Users\Administrator\Desktop\
输出则是
g++.exe "D:\Hadus\apb-test.cpp" -o "student.exe" -m32 -I"..\x86_64-w64-mingw32\include" -L"..\x86_64-w64-mingw32\lib32" -static-libgcc -lgdi32 -lcomdlg32 -m32 & move student.exe C:\Users\Administrator\Desktop\
求教大佬,我的程序路径不是桌面啊???