25.12.2008, 21:41
Код:
kowalski@kowalski:~/Asztal/sa-mp-0.2-plugin-sdk/HelloWorld$ g++ -D LINUX -I amx/ -o HelloWorld helloworld.cpp ../SDK/amxplugin.cpp In file included from helloworld.cpp:8: ../SDK/amx/amx.h:215: warning: ‘packed’ attribute ignored for field of type ‘char [20]’ ../SDK/amx/amx.h:265: warning: ‘packed’ attribute ignored for field of type ‘char’ ../SDK/amx/amx.h:266: warning: ‘packed’ attribute ignored for field of type ‘char’ helloworld.cpp: In function ‘bool Load(void**)’: helloworld.cpp:39: warning: deprecated conversion from string constant to ‘char*’ helloworld.cpp: In function ‘void Unload()’: helloworld.cpp:49: warning: deprecated conversion from string constant to ‘char*’ helloworld.cpp: In function ‘cell n_HelloWorld(AMX*, cell*)’: helloworld.cpp:62: warning: deprecated conversion from string constant to ‘char*’ In file included from ../SDK/plugin.h:9, from ../SDK/amxplugin.cpp:33: ../SDK/amx/amx.h:215: warning: ‘packed’ attribute ignored for field of type ‘char [20]’ ../SDK/amx/amx.h:265: warning: ‘packed’ attribute ignored for field of type ‘char’ ../SDK/amx/amx.h:266: warning: ‘packed’ attribute ignored for field of type ‘char’ /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/crt1.o: In function `_start': (.text+0x20): undefined reference to `main' collect2: ld returned 1 exit status
EDIT:
I fixed all warnings with changing the logprintf format's type from char * to const char *, and redefined PACKED to simly packed (#define PACKED packed). The error still remain...
EDIT:
I almost forgot, that I changed one line in the amx.h file at the top of the file. When I tried to compile the files, the compiler didn't find the sclinux.h. So I had to replace the #include <sclinux.h> with the #include "sclinux.h".
EDIT:
I was dumb sorry, I know now how to compile it right, forgot everything I said before. Here's a new problem:
Код:
kowalski@kowalski:~/Asztal/sa-mp-0.2-plugin-sdk/HelloWorld$ make gcc -c -O3 -w -DLINUX -I../SDK/amx/ ../SDK/amx/*.c g++ -c -O3 -w -DLINUX -I../SDK/amx/ ../SDK/*.cpp g++ -c -O3 -w -DLINUX -I../SDK/amx/ *.cpp g++ -O2 -fshort-wchar -shared -o "helloworld.so" *.o /usr/bin/ld: amxplugin.o: relocation R_X86_64_32 against `__gxx_personality_v0' can not be used when making a shared object; recompile with -fPIC amxplugin.o: could not read symbols: Bad value collect2: ld returned 1 exit status make: *** [all] Error 1
Ковалски