小编Snu*_*vie的帖子

powershell命令没有在.bat文件中运行?

我正在尝试制作一个简单的脚本来设置我的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)

shell powershell path

4
推荐指数
1
解决办法
2863
查看次数

使用gcc编译win32项目时如何链接到库?

我试图在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)

c windows winapi gcc

1
推荐指数
1
解决办法
5205
查看次数

标签 统计

c ×1

gcc ×1

path ×1

powershell ×1

shell ×1

winapi ×1

windows ×1