Best linux compiler
#8

Код:
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
I got these errors with running the G++ complier on the SDK. I tried to compile the getch.c file too, but nothing changed.

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
I compiled as the compiler said (replaced -shared with -fPIC), and now gives again the 'main reference error' I mentioned above.

Ковалски
Reply


Messages In This Thread
Best linux compiler - by D4rkBlade - 17.12.2008, 13:36
Re: Best linux compiler - by D4rkBlade - 17.12.2008, 14:07
Re: Best linux compiler - by Kowalski - 17.12.2008, 14:30
Re: Best linux compiler - by D4rkBlade - 17.12.2008, 14:52
Re: Best linux compiler - by Kowalski - 25.12.2008, 16:58
Re: Best linux compiler - by Kowalski - 25.12.2008, 21:20
Re: Best linux compiler - by mabako - 25.12.2008, 21:34
Re: Best linux compiler - by Kowalski - 25.12.2008, 21:41
Re: Best linux compiler - by Kowalski - 26.12.2008, 11:11
Re: Best linux compiler - by Kowalski - 26.12.2008, 11:43
Re: Best linux compiler - by Kowalski - 26.12.2008, 12:04
Re: Best linux compiler - by Kowalski - 26.12.2008, 19:21
Re: Best linux compiler - by Rozzie - 26.12.2008, 20:10
Re: Best linux compiler - by Kowalski - 27.12.2008, 19:55
Re: Best linux compiler - by Streetplaya - 27.12.2008, 21:18
Re: Best linux compiler - by Y_Less - 27.12.2008, 22:01
Re: Best linux compiler - by Kowalski - 28.12.2008, 07:00
Re: Best linux compiler - by Y_Less - 28.12.2008, 16:22

Forum Jump:


Users browsing this thread: 1 Guest(s)