![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Aug 2007
Posts: 3
Rep Power: 0
![]() |
Cannot open output file error
Hey guys,
My friend and I just recently started creating a win32 application in Codeblocks IDE. To start we created the simplest window you can make. It does nothing except draw itself on the screen and wait for someone to close it. Codeblocks lets me compile/run my program only once though. When my program executes I exit properly and codeblocks tells me that the process terminated. The thing is, every time after that when I try to compile it gives me this: Switching to target: default Linking executable: D:\Temp\Win32Test\Win32GUI.exe D:\Apps\CodeBlocks\bin\..\lib\gcc\mingw32\3.4.4\..\..\..\..\mingw32\bin\ld.exe: cannot open output file D:\Temp\Win32Test\Win32GUI.exe: Invalid argument collect2: ld returned 1 exit status Process terminated with status 1 (0 minutes, 0 seconds) 0 errors, 0 warnings It seems as though after one execution of my program windows won't let go of the .exe file. I can't even go to the directory and delete it or anything. It just won't let me touch it. It only let's me compile the program once every time I start my computer..then it acts like I never closed the window and the program is still running. I'd love to be able to make more then one change to my program every time I turn my computer on . Any ideas? |
|
|
|
|
|
#2 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
Closing a window does not force a program to exit.
Firefox exits when all windows are closed. Others exit when the main window is closed. It is up to the programmer to handle the closing of windows appropriately such that the program exits in an expected way. Check for your program in the task manager (ctrl+shift+esc), kill it, correct the code, and recompile.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Aug 2007
Posts: 3
Rep Power: 0
![]() |
I check for the running process all the time and it's never still running according to my task manager.
Sorry, I should have posted the way I handle the exit in the first post. LRESULT CALLBACK WndProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
// if the user wants to close the application
case WM_DESTROY:
{
// then close it
PostQuitMessage(0);
break;
}
default:
// Process the left-over messages
return DefWindowProc(hWnd, Msg, wParam, lParam);
}
// if something was not done, let it go
return 0;
}That's my function that responds to all events. When I click on the X in the upper right hand corner, my understanding is that windows fires a WM_DESTROY event to my program and then I handled it my posting a quit message which would close the program. Even with all this the annoying behavior persists =/ ![]() |
|
|
|
|
|
#4 |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,005
Rep Power: 5
![]() |
When you open up Task Manager, don't look on the 'Applications' tab. This only shows things that have a UI up and running. Look on the 'Processes' tab, and kill your app there.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick |
|
|
|
|
|
#5 |
|
Newbie
Join Date: Aug 2007
Posts: 3
Rep Power: 0
![]() |
Tried it but still no dice.
|
|
|
|
|
|
#6 |
|
Programmer
Join Date: Feb 2006
Location: Ohio
Posts: 93
Rep Power: 3
![]() |
You might try handling the WM_CLOSE message in your WinProc function by calling DestroyWindow() and passing your main window handle to it.
__________________
Neeley.org |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Header file internal errors | kruptof | Coder's Corner Lounge | 2 | Jan 14th, 2007 1:12 PM |
| C# corruption!!! | Kilo | C++ | 32 | May 21st, 2006 8:44 PM |
| Masm | rsnd | Assembly | 4 | May 20th, 2006 9:05 PM |
| libraries | matko | C | 1 | Jan 22nd, 2006 2:12 PM |
| After execution - Error cannot locate /Skin File? | wchar | Visual Basic | 1 | Mar 5th, 2005 9:04 PM |