The problem is that we are using a different SDL version than DarkGod is. If you look at the source code for SDL_threads you can see that the SDL_CreateThread function has changed:marvalis wrote: I got the following errors:
Code: Select all
==== Building TEngine (debug) ==== particles.c ../src/particles.c: In function ‘create_particles_thread’: ../src/particles.c:893:3: warning: passing argument 2 of ‘SDL_CreateThread’ from incompatible pointer type /usr/local/include/SDL/SDL_thread.h:145:1: note: expected ‘const char *’ but argument is of type ‘struct particle_thread *’ ../src/particles.c:893:3: error: too few arguments to function ‘SDL_CreateThread’ /usr/local/include/SDL/SDL_thread.h:145:1: note: declared here make[1]: *** [../obj/Debug/TEngine/particles.o] Error 1 make: *** [TEngine] Error 2
Code: Select all
DECLSPEC SDL_Thread *SDLCALL
SDL_CreateThread(int (SDLCALL * fn) (void *),
const char *name, void *data)
Code: Select all
diff --git a/build/te4core.lua b/build/te4core.lua
index 6cb12f8..1979eca 100644
--- a/build/te4core.lua
+++ b/build/te4core.lua
@@ -57,8 +57,8 @@ project "TEngine"
configuration "linux"
- libdirs {"/opt/SDL-1.3/lib/"}
- links { "dl", "SDL-1.3", "SDL_ttf", "SDL_image", "openal", "vorbisfile", "GL", "GLU", "m", "pthread" }
+ libdirs {"/usr/local/lib/"}
+ links { "dl", "SDL", "SDL_ttf", "SDL_image", "openal", "vorbisfile", "GL", "GLU", "m", "pthread", "png" }
defines { [[TENGINE_HOME_PATH='".t-engine"']], 'SELFEXE_LINUX' }
configuration {"Debug"}
diff --git a/premake4.lua b/premake4.lua
index f516dfe..aaf6307 100644
--- a/premake4.lua
+++ b/premake4.lua
@@ -18,7 +18,8 @@ solution "TEngine"
"src/physfs",
"src/physfs/zlib123",
"src/bzip2",
- "/opt/SDL-1.3/include/SDL/",
+ "/usr/local/include/SDL",
+ "/usr/include/SDL",
"/usr/include/GL",
}
if _OPTIONS.lua == "default" then includedirs{"src/lua"}
diff --git a/src/music.c b/src/music.c
index b438039..4ef9d47 100644
--- a/src/music.c
+++ b/src/music.c
@@ -275,7 +275,8 @@ static int loadsoundLua(lua_State *L) {
if (sound->mutex == NULL) luaL_error(L, "out of memory");
sound->cond = SDL_CreateCond();
if (sound->cond == NULL) luaL_error(L, "out of memory");
- sound->loaderThread = SDL_CreateThread(streamingLoader, sound);
+ const char *name = "Sound";
+ sound->loaderThread = SDL_CreateThread(streamingLoader, name, sound);
}
else {
sound->static_source = 0;
diff --git a/src/particles.c b/src/particles.c
index c44fcf1..e443d55 100644
--- a/src/particles.c
+++ b/src/particles.c
@@ -890,7 +890,8 @@ void create_particles_thread()
pt->keyframes = SDL_CreateSemaphore(0);
pt->running = TRUE;
- thread = SDL_CreateThread(thread_particles, pt);
+ const char *name = "Particles";
+ thread = SDL_CreateThread(thread_particles, name, pt);
if (thread == NULL) {
printf("Unable to create particle thread: %s\n", SDL_GetError());
continue;
diff --git a/src/profile.c b/src/profile.c
index 7afd243..ecc8b65 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -207,7 +207,8 @@ int create_profile_thread(lua_State *L)
profile->lock_oqueue = SDL_CreateMutex();
profile->wait_oqueue = SDL_CreateSemaphore(0);
- thread = SDL_CreateThread(thread_profile, profile);
+ const char *name = "Profile";
+ thread = SDL_CreateThread(thread_profile, name, profile);
if (thread == NULL) {
printf("Unable to create profile thread: %s\n", SDL_GetError());
return -1;