我正在尝试制作一个简单的脚本来设置我的gcc变量.作为.bat文件.
变量设置如下
$env:Path += ";C:\Users\Brett\Compilers\MinGW\bin"
Run Code Online (Sandbox Code Playgroud)
当我输入/粘贴到电源外壳时运行正常.
但当我粘贴到脚本myscript.bat,并通过powershell运行它时,我收到此错误:
C:\Users\Brett\Compilers>"$env:Path += ";C:\Users\Brett\Compilers\MinGW\bin""
The filename, directory name, or volume label syntax is incorrect.
PS C:\Users\Scruffy\Compilers>
Run Code Online (Sandbox Code Playgroud) 我试图在Win 7上使用gcc编译一个基本的hello word winform应用程序.
代码是这样的:
/*
WINHELLO.C
"Hello, world!", Win32 style.
*/
#include <windows.h>
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
/* WinMain(), our entry point */
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR szCmdLine, int iCmdShow) {
static char szAppName[] = "winhello";
HWND hwnd;
MSG msg;
WNDCLASSEX wndclass;
/* Fill in WNDCLASSEX struct members */
wndclass.cbSize = sizeof(wndclass);
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wndclass.hIconSm …Run Code Online (Sandbox Code Playgroud)