Go command freezes

11 views
Skip to first unread message

deuhon

unread,
Oct 24, 2009, 5:54:31 PM10/24/09
to scite-interest
I'm using Windows XP and I have MinGW and msys installed. I am trying
to compile a C++ program and when I select Go in Tools I get this as
output:

>g++ -pedantic -Os main.cpp -o main -mwindows
>Exit code: 0
>./main

and then it freezes so I have to select Stop Executing

>Process failed to respond; forcing abrupt termination...
>Exit code: 1

if I run main.exe regularly it works fine, but can anyone explain to
me why it freezes? Thanks

Philippe Lhoste

unread,
Oct 25, 2009, 4:23:56 AM10/25/09
to scite-i...@googlegroups.com
On 24/10/2009 23:54, deuhon wrote:
> if I run main.exe regularly it works fine, but can anyone explain to
> me why it freezes? Thanks

You first have to explain what your program does... Does your program
have a GUI? Does it expect stdin input? Etc.

--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --

deuhon

unread,
Oct 25, 2009, 12:16:55 PM10/25/09
to scite-interest
It only creates a window with the win32 API. This is my program:

#define _WIN32_WINNT 0x0501
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
lParam);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
lpCmdLine, int iCmdShow)
{
WNDCLASSEX wc;
HWND hWnd;
MSG msg;

wc.cbSize = sizeof(WNDCLASSEX);
wc.style = 0;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wc.lpszMenuName = NULL;
wc.lpszClassName = TEXT("Main Window");
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

if(!RegisterClassEx(&wc))
return 0;

if(!(hWnd = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("Main Window"), TEXT
("Project ZENNOU"),
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 640, 480,
NULL, NULL, hInstance, NULL)))
return 0;

ShowWindow(hWnd, iCmdShow);
UpdateWindow(hWnd);

while(GetMessage(&msg, NULL, 0, 0) > 0)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}

return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
lParam)
{
switch(msg)
{
case WM_CLOSE:
DestroyWindow(hWnd);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
default:
return DefWindowProc(hWnd, msg, wParam, lParam);
}
}

math mhb

unread,
Oct 25, 2009, 8:51:22 PM10/25/09
to scite-i...@googlegroups.com
Your program is a GUI application, not a console application. SciTE can only capture the output of console application.
To run a GUI application in SciTE, you may use "start main.exe" as the command line.

2009/10/26 deuhon <yoon...@gmail.com>

deuhon

unread,
Oct 25, 2009, 9:14:05 PM10/25/09
to scite-interest
This is a section of my cpp.properties:

command.compile.$(file.patterns.cplusplus)=$(cc)
command.build.$(file.patterns.cplusplus)=$(make.command)
command.go.$(file.patterns.cplusplus)=start C:\Projects\main.exe
command.go.needs.$(file.patterns.cplusplus)=g++ $(ccopts) $
(FileNameExt) -o $(FileName)

The output when I do go:

>start C:\Projects\main.exe
>The system cannot find the file specified.

( This also happens with command.go.$(file.patterns.cplusplus)=start $
(FileName) and
command.go.$(file.patterns.cplusplus)=start $(FileName).exe )

I've triple checked that it's the correct directory, and it works in
cmd.

I tried:

command.go.$(file.patterns.cplusplus)=C:\Projects\main.exe

output:

>C:\Projects\main.exe

*freezes just like the original problem*

I would greatly appreciate if someone could tell me the proper way

On Oct 25, 8:51 pm, math mhb <math...@gmail.com> wrote:
> Your program is a GUI application, not a console application. SciTE can only
> capture the output of console application.
> To run a GUI application in SciTE, you may use "start main.exe" as the
> command line.
>
> 2009/10/26 deuhon <yoonk...@gmail.com>
> --
> Best regards,
>
> Hongbin Ma

Leledumbo

unread,
Oct 25, 2009, 10:54:31 PM10/25/09
to scite-interest
> To run a GUI application in SciTE, you may use "start main.exe" as the
> command line.

or you can use command.go.subsystem.$(file.patterns.cplusplus)=1
(Windowed) # or 2 (ShellExecute)

math mhb

unread,
Oct 25, 2009, 11:41:54 PM10/25/09
to scite-i...@googlegroups.com
Two approaches:
1. Use "cmd /c start main.exe" to start a GUI application without changing the default go.subsystem.
2. Use "main.exe" to start it directly but you need to set command.go.subsystem.$(file.patterns.cplusplus)=1 or 2.

2009/10/26 Leledumbo <leledum...@yahoo.co.id>

deuhon

unread,
Oct 26, 2009, 3:07:45 PM10/26/09
to scite-interest
Problem resolved, thanks everyone.

On Oct 25, 11:41 pm, math mhb <math...@gmail.com> wrote:
> Two approaches:
> 1. Use "cmd /c start main.exe" to start a GUI application without changing
> the default go.subsystem.
> 2. Use "main.exe" to start it directly but you need to set
> command.go.subsystem.$(file.patterns.cplusplus)=1 or 2.
>
> 2009/10/26 Leledumbo <leledumbo_c...@yahoo.co.id>
>
>
>
> > > To run a GUI application in SciTE, you may use "start main.exe" as the
> > > command line.
>
> > or you can use command.go.subsystem.$(file.patterns.cplusplus)=1
> > (Windowed) # or 2 (ShellExecute)
>
Reply all
Reply to author
Forward
0 new messages