Build but no executable [message #1712421] |
Fri, 23 October 2015 21:50  |
Eclipse User |
|
|
|
[Linux]
When I build the program below the build is successful but I don't see an executable in the project's debug directory.
#include <SDL/SDL.h>
int main(int argc, char* argv[])
{
if(SDL_INIT_EVERYTHING < 0)
{
printf("SDL failed to initialize!");
SDL_Quit();
return 0;
}
SDL_SetVideoMode(800, 600, 32, SDL_SWSURFACE);
SDL_WM_SetCaption("SDL!!!", NULL);
SDL_Delay(3000);
SDL_Quit();
return 1;
}
20:46:47 **** Incremental Build of configuration Debug for project Listing2.1-A_Blank_Window ****
make all
make: Nothing to be done for `all'.
20:46:48 Build Finished (took 88ms)
And here's what I get when I run ls in the project's Debug directory.
garrett@mint-desktop ~/projects/EclipseProjects/Listing2.1-A_Blank_Window/Debug $ ls
Listing2.1-A_Blank_Window main.d main.o makefile objects.mk sources.mk subdir.mk
And I get the error 'Launch failed. Binary not found' when I click on run. Any ideas? Thanks.
|
|
|
|
|
|
|
|
|
|
Re: Build but no executable [message #1712622 is a reply to message #1712578] |
Mon, 26 October 2015 17:24  |
Eclipse User |
|
|
|
In case your Linux (?) shows no executable:
* Did you look in the right directory?
* Is the created binary actually have executable permissions? (chmod +ux)
* Did it actually build?
If the Binary is not build?
* Did you save your files before building? There are general Eclipse
Workspace options, for building, which might be set to default values
suitable for Java or other languages, but not for C/C++.
Check the Eclipse Preferences -> General -> Workspace -> "Save
automatically before build", which will save all opened and not saved
yet files, before starting to build. Btw., I usually also have "Refresh
on Access" enabled, in case some external program changes a file, like
if the compiler creates besides an .elf file also the .map file, or a
post-process script updates the resource consumption files.
* Check the build console output. I prefer the build console, to
check the build status and if there are any failures (compile and/or
link errors). And I usually go from top to bottom. Why, because the
Problems View might sort them in different order, and sometimes, later
compile/linker errors might be due to errors in the beginning, like due
to a missing include of a header, you have none or the wrong datatype,
which can have the effect, that the compiler takes the wrong prototype
of a function.
For this, I usually enable usually in Eclipse -> Preferences -> C/C++
-> Build -> Console to "Bring the Build Console to top when building"
and set the "Limit Console output (number of lines) to the maximum
setable value in order to have the first lines still in the output window.
Am 26.10.2015 um 16:29 schrieb David Vavra:
> Are the errors real, i.e., only those generated by the indexer and
> syntax analyzer? If so you can delete them in the Problems view. They
> will come back on the next build so it's best to figure out what's
> causing them then fix them. If they are real what's the point of debugging?
>
> I have no idea why it can't find the executable at times. My guess is
> that it gets deleted during the build process which won't complete in
> the face of real errors. I don't use managed builds so can't say for
> sure. My make files don't clean out the executables so I have to pay
> attention to the build to see if there are build errors.
>
> There's some work being done on a stand-alone debugger which may
> circumvent some of your problems (
> https://wiki.eclipse.org/CDT/StandaloneDebugger) but that seems a rather
> heavy handed solution.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04786 seconds