G3n3ra1
07.06.05, 22:13
Hallo zusammen,
auf http://www.linux-gamers.net/modules/wfsection/article.php?articleid=36 ist eine Anleitung, wie ich Cheating Death unter Cedega ans laufen bekmmen kann. Ich hab nur einige Probleme, das ganze zu compillieren:
Wenn ich
gcc -ldl -shared -o libcdlinux.so cdlinux.c
eingebe, dann dann kommt folgende Fehlermeldung:
cdlinux.c:6:20: wtypes.h: Datei oder Verzeichnis nicht gefunden
cdlinux.c:7:20: windef.h: Datei oder Verzeichnis nicht gefunden
cdlinux.c:8:21: winbase.h: Datei oder Verzeichnis nicht gefunden
cdlinux.c:10: error: syntax error before '*' token
cdlinux.c:10: error: `LPSTR' declared as function returning a function
cdlinux.c:11: error: syntax error before "o_GetCommandLineA"
cdlinux.c:11: warning: data definition has no type or storage class
cdlinux.c:13: error: syntax error before '*' token
cdlinux.c:13: warning: parameter names (without types) in function declaration
cdlinux.c:13: error: `HMODULE' declared as function returning a function
cdlinux.c:14: error: syntax error before "o_LoadLibraryA"
cdlinux.c:14: warning: data definition has no type or storage class
cdlinux.c:17: error: syntax error before "cddll"
cdlinux.c:17: warning: data definition has no type or storage class
cdlinux.c:19: error: syntax error before "GetCommandLineA"
cdlinux.c: In function `GetCommandLineA':
cdlinux.c:21: error: `o_GetCommandLineA_ptr' undeclared (first use in this function)
cdlinux.c:21: error: (Each undeclared identifier is reported only once
cdlinux.c:21: error: for each function it appears in.)
cdlinux.c:21: error: syntax error before "dlsym"
cdlinux.c:22: error: `o_LoadLibraryA_ptr' undeclared (first use in this function)
cdlinux.c:22: error: syntax error before "dlsym"
cdlinux.c:23: warning: assignment makes integer from pointer without a cast
cdlinux.c:29: error: called object is not a function
cdlinux.c:32: error: called object is not a function
Kann mir einer sagen, woran das liegt? Ich denke, das könnte daran liegen dass ich irgendwo den Dateipfad zum Deating Death Verzeichniss angeben muss, wie auch auf der Seite beschrieben, ich weiss nur nicht wo... :ugly:
You may need to change the path in the LoadLibraryA line to wherever you installed your CD. Make sure you use \\ to seperate directories, NOT / or \
Hier ist mal meine 'cdlinux.c', in der ich irgendwo den Pfad eintragen muss:
#include <stdlib.h>
#include <stdio.h>
#define __USE_GNU
#include <dlfcn.h>
#include <wtypes.h>
#include <windef.h>
#include <winbase.h>
typedef LPSTR (WINAPI *o_GetCommandLineA_ptr) (void);
static o_GetCommandLineA_ptr o_GetCommandLineA;
typedef HMODULE (WINAPI *o_LoadLibraryA_ptr) (LPCSTR);
static o_LoadLibraryA_ptr o_LoadLibraryA;
static int initialized = 0;
static LPCSTR cddll = 0;
LPSTR WINAPI GetCommandLineA (void) {
if (!initialized) {
o_GetCommandLineA = (o_GetCommandLineA_ptr) dlsym (RTLD_NEXT, "GetCommandLineA");
o_LoadLibraryA = (o_LoadLibraryA_ptr) dlsym (RTLD_NEXT, "LoadLibraryA");
cddll = getenv ("CDDLL");
}
initialized++;
if (initialized == 6) {
printf ("Injecting %s NOW!\n", cddll);
o_LoadLibraryA (cddll);
}
return o_GetCommandLineA ();
}
Ich hoffe ihr könnt mir bei meinem kleinen Problemchen helfen! :)
Gruß
G3n3ra1
P.S. Wird das ganze dann auch mit Point2Play funktionieren, oder MUSS ich dann die 'command line Version' nehmen?
auf http://www.linux-gamers.net/modules/wfsection/article.php?articleid=36 ist eine Anleitung, wie ich Cheating Death unter Cedega ans laufen bekmmen kann. Ich hab nur einige Probleme, das ganze zu compillieren:
Wenn ich
gcc -ldl -shared -o libcdlinux.so cdlinux.c
eingebe, dann dann kommt folgende Fehlermeldung:
cdlinux.c:6:20: wtypes.h: Datei oder Verzeichnis nicht gefunden
cdlinux.c:7:20: windef.h: Datei oder Verzeichnis nicht gefunden
cdlinux.c:8:21: winbase.h: Datei oder Verzeichnis nicht gefunden
cdlinux.c:10: error: syntax error before '*' token
cdlinux.c:10: error: `LPSTR' declared as function returning a function
cdlinux.c:11: error: syntax error before "o_GetCommandLineA"
cdlinux.c:11: warning: data definition has no type or storage class
cdlinux.c:13: error: syntax error before '*' token
cdlinux.c:13: warning: parameter names (without types) in function declaration
cdlinux.c:13: error: `HMODULE' declared as function returning a function
cdlinux.c:14: error: syntax error before "o_LoadLibraryA"
cdlinux.c:14: warning: data definition has no type or storage class
cdlinux.c:17: error: syntax error before "cddll"
cdlinux.c:17: warning: data definition has no type or storage class
cdlinux.c:19: error: syntax error before "GetCommandLineA"
cdlinux.c: In function `GetCommandLineA':
cdlinux.c:21: error: `o_GetCommandLineA_ptr' undeclared (first use in this function)
cdlinux.c:21: error: (Each undeclared identifier is reported only once
cdlinux.c:21: error: for each function it appears in.)
cdlinux.c:21: error: syntax error before "dlsym"
cdlinux.c:22: error: `o_LoadLibraryA_ptr' undeclared (first use in this function)
cdlinux.c:22: error: syntax error before "dlsym"
cdlinux.c:23: warning: assignment makes integer from pointer without a cast
cdlinux.c:29: error: called object is not a function
cdlinux.c:32: error: called object is not a function
Kann mir einer sagen, woran das liegt? Ich denke, das könnte daran liegen dass ich irgendwo den Dateipfad zum Deating Death Verzeichniss angeben muss, wie auch auf der Seite beschrieben, ich weiss nur nicht wo... :ugly:
You may need to change the path in the LoadLibraryA line to wherever you installed your CD. Make sure you use \\ to seperate directories, NOT / or \
Hier ist mal meine 'cdlinux.c', in der ich irgendwo den Pfad eintragen muss:
#include <stdlib.h>
#include <stdio.h>
#define __USE_GNU
#include <dlfcn.h>
#include <wtypes.h>
#include <windef.h>
#include <winbase.h>
typedef LPSTR (WINAPI *o_GetCommandLineA_ptr) (void);
static o_GetCommandLineA_ptr o_GetCommandLineA;
typedef HMODULE (WINAPI *o_LoadLibraryA_ptr) (LPCSTR);
static o_LoadLibraryA_ptr o_LoadLibraryA;
static int initialized = 0;
static LPCSTR cddll = 0;
LPSTR WINAPI GetCommandLineA (void) {
if (!initialized) {
o_GetCommandLineA = (o_GetCommandLineA_ptr) dlsym (RTLD_NEXT, "GetCommandLineA");
o_LoadLibraryA = (o_LoadLibraryA_ptr) dlsym (RTLD_NEXT, "LoadLibraryA");
cddll = getenv ("CDDLL");
}
initialized++;
if (initialized == 6) {
printf ("Injecting %s NOW!\n", cddll);
o_LoadLibraryA (cddll);
}
return o_GetCommandLineA ();
}
Ich hoffe ihr könnt mir bei meinem kleinen Problemchen helfen! :)
Gruß
G3n3ra1
P.S. Wird das ganze dann auch mit Point2Play funktionieren, oder MUSS ich dann die 'command line Version' nehmen?