Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Program file does not exist error when using SDL library
Program file does not exist error when using SDL library [message #1758103] Thu, 23 March 2017 10:32 Go to next message
Eclipse UserFriend
I am very new to Eclipse and C++ but recently I have been trying to use SDL in my programs. I have installed it correctly and set up the proper libraries and paths. But when I use #include <SDL.h> the program builds just fine but I get a "Program file does not exist" error. If I remove #include <SDL.h> the program works perfectly and created a .exe in my workspace. But if I add #include <SDL.h> the .exe goes away. I have searched all over the internet and have found no viable solution so any help would be greatly appreciated.
Re: Program file does not exist error when using SDL library [message #1758239 is a reply to message #1758103] Sat, 25 March 2017 11:04 Go to previous message
Eclipse UserFriend
Your post is confusing.
You say that: "using #include <SDL.h> the program builds just fine".
But then say: "if I add #include <SDL.h> the .exe goes away".
They are mutually exclusive. The latter says no build occurred.

The error message also implies the build stopped before the .exe file was created.

I'm guessing that the include either contains an error or can't be found by the compiler.
To use external libraries you need to tell Eclipse where the headers and libraries are so that the Makefile can be properly built.

You d this by modifying the Tool Settings for the compiler and inker.
The Tool Settings tab is under Project-->Properties-->C/C++ Build-->Settings
Select Includes under the appropriate compiler and set the header locations in the pane labeled (Include Paths -I)
Select Libraries under the linker and set the panes appropriately.

Since your program works when you don't include <SDL.h>, the program as written doesn't need it.
But when it does, the Indexer must also be informed of the path to <SDL.h> or you will get spurious errors when editing.
You do this by setting the path to the library headers under the CDT User Setting Entries found in the Entries tab of Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc.
Previous Topic:INT_MAX was not declared in this scope/could not be resolved
Next Topic:Use unidata netcdf libraries
Goto Forum:
  


Current Time: Sat Jul 12 15:37:48 EDT 2025

Powered by FUDForum. Page generated in 0.04792 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top