|
|
Re: No source available for "main() ...can not debug [message #560032 is a reply to message #232878] |
Mon, 20 September 2010 20:25 |
|
David Wegener wrote on Tue, 14 April 2009 04:47 |
Make sure that your compile and link commands include options to include
debug information. Without debug information, the debugger has no way
to associate the executable to source.
|
Hello, I get the same error when trying to debug. If I navigate to Project Properties > C/C++ Build > Settings > Tool Settings, my compiler is already set to Maximum Debug Level (-g3) as shown below. I can't find out how to add a debug options to the MinGW C linker.
Anyone know where I'm going wrong? (Wascana installed on Helios 20100617-1415, but *not* the Wascana SDL)
GCC C Compiler:
command: gcc
options: -O0 -g3 -Wall -c -fmessage-length=0
MinGW C Linker:
command: gcc
options: --nothing--
Thanks in advance, Michelle
~
[Updated on: Tue, 21 September 2010 04:14] Report message to a moderator
|
|
|
|
Re: No source available for "main() ...can not debug [message #560110 is a reply to message #560072] |
Tue, 21 September 2010 08:59 |
|
Axel Mueller wrote on Tue, 21 September 2010 09:01 | Perhaps you debugged the release version (w/o debug info) of your application?
| Hi Axel, thanks for the reply No, I checked my debug configuration and the C/C++ Application is set to "Debug/hellogui.exe"
What is strange is if you take a look at my code below, I can run the debugger if I use the code in (1) but can *not* run the debugger if I comment out (1) and use the code in (2).
Since my true application is started with a WinMain method I need to get (2) working... any ideas?
#include <Windows.h>
#include <stdio.h>
#include <stdlib.h>
//(1)THIS WORKS: If use 'main' directly below (and comment out 'WinMain') then I am able to run the debugger
// int main(void) {
// puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
// return EXIT_SUCCESS;
// }
//(2)THIS DOESN'T: If I make a WinMain application I can not debug it, I get error: No source availible for "main() at 0x401a60"
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) {
int myPlay = 0;
MessageBox(NULL, "Hello: I run fine, I just can't be debugged!!", "WinMain Demo", MB_OK);
myPlay = 99;
return EXIT_SUCCESS;
}
|
|
|
|
Re: No source available for "main() ...can not debug [message #560227 is a reply to message #560159] |
Tue, 21 September 2010 15:27 |
|
Axel Mueller wrote on Tue, 21 September 2010 13:35 | OK, the debugger thinks that main() is the entry point (the default standard). You need the compiler and linker flag -mwindows. The the linker will define WinMain as the entry point.
|
Thanks Axel but that's not it either I'm afraid. I get the same error with the below settings when trying to debug...
**** Rebuild of configuration Debug for project hellogui ****
**** Internal Builder is used for build ****
gcc -O0 -g3 -Wall -c -fmessage-length=0 -mwindows -osrc\hellogui.o ..\src\hellogui.c
gcc -mwindows -ohellogui.exe src\hellogui.o
Build complete for project hellogui
Time consumed: 1910 ms.
any other suggestion I could try that you can think of?
|
|
|
|
Re: No source available for "main() ...can not debug [message #624993 is a reply to message #624804] |
Wed, 22 September 2010 06:57 |
|
That's a first Axel ...after weeks of struggling this is our last step for porting to helios. We have no option but to sort this out. A couple of questions if you don't mind:
1. From what I see below, the GDB automatically comes with the mingw toolset right?
c:\devtools\eclipse\eclipse\mingw\bin>gdb
GNU gdb (GDB) 7.1
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This GDB was configured as "mingw32".
2. If I look, in "About Eclipse Features" the version of 'GDB Common' is 7.0.0 whereas GDB 7.2 is now out. I don't know how to do it, but possibly try get this updated version into helios?
3. Is there another debugger option other than gdb for eclipse?
[Updated on: Wed, 22 September 2010 07:18] Report message to a moderator
|
|
|
|
|
Re: No source available for "main() ...can not debug [message #626165 is a reply to message #625921] |
Wed, 22 September 2010 12:31 |
|
Axel I think we got it.... I CAN NOT BELIEEEEEEVE it took soooooo long for us to figure this out!!!!!!! If I just hit "resume"
it finds WinAPP and debugging works as expected.
...perhaps its that setting that I saw somewhere about automatically always stopping at 'main'? mmm...
thanks Axel for your efforts (again)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07919 seconds