Error when i use SDL lib : 'SDL_###' undeclared identifier

Started by
1 comment, last by mrpeed 5 years, 5 months ago

#include <SDL.h>

#include "pch.h"
#include <iostream>

using namespace std;

int main()
{
	SDL_Init(SDL_INIT_EVERYTHING);
	return 0;
}
Quote

1>------ Build started: Project: SDL2, Configuration: Debug Win32 ------
1>SDL2.cpp
1>c:\...\sdl.cpp(11): error C2065: 'SDL_INIT_EVERYTHING': undeclared identifier
1>c:\...\sdl.cpp(11): error C3861: 'SDL_Init': identifier not found
1>Done building project "SDL.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

Advertisement

Should be #include "SDL.h", Instead of #include <SDL.h>? Looks like it can't find the header file. Where is SDL located on your machine?

This may help: https://stackoverflow.com/questions/10488775/sdl-h-no-such-file-or-directory-found-when-compiling

This topic is closed to new replies.

Advertisement