Hi,

Probwaj dali ne te ustrojwa towa (za C++):

extern "C" int plugin_main
{
}

Za da se preglatne ot C kompilatora shte trqbwa da naprawish uslowna
kompilaciq I malko macrosi.

Pozdrawi,
Ico

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Stanislav Lechev
[AngelFire]
Sent: Friday, July 04, 2003 12:12 PM
To: [EMAIL PROTECTED]
Subject: lug-bg: c/c++ differences


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

// da se chete ot po naprednali c/c++ programisti

zdrawejte move bi ne e naj prawilnoto mqsto za maila mi no wse pak shte se
probwam w momenta pisha plugin baziran demon ... ideqta e da zarevda plugini
koito da obsluvwat razni neshtica... znachi problema mi e sledniq

eto edna primerna c/c++ programa:
int plugin_main() {
}
- -------
eto kakwo se poluchawa pri kompilirane sys C kompilator

[EMAIL PROTECTED]:[0]:utils# gcc qwe.c -c [EMAIL PROTECTED]:[0]:utils# objdump -t
qwe.o
qwe.o:     file format elf32-i386

SYMBOL TABLE:
00000000 l    df *ABS*  00000000 qwe.c
00000000 l    d  .text  00000000
00000000 l    d  .data  00000000
00000000 l    d  .bss   00000000
00000000 l    d  .comment       00000000
00000000 g     F .text  00000005 plugin_main


waven e posledniq red w sluchaq imeto na funkciqta e "plugin_main" kakto se 
wivda i ot symbol tabel-a

eto kakwo stawa sys C++:

[EMAIL PROTECTED]:[0]:utils# g++ qwe.c -c [EMAIL PROTECTED]:[0]:utils# objdump -t
qwe.o

qwe.o:     file format elf32-i386

SYMBOL TABLE:
00000000 l    df *ABS*  00000000 qwe.c
00000000 l    d  .text  00000000
00000000 l    d  .data  00000000
00000000 l    d  .bss   00000000
00000000 l    d  .comment       00000000
00000000 g     F .text  00000005 _Z11plugin_mainv

kakto wivdame w C++ funkciqta e sys ime "_Z11plugin_mainv" koeto weroqtno e
zaradi polimorfizma ili pone taka si go obqsnqwam az ... wyprosa mi e
sledniq 
kogato se opitwam da zaredq plugina si ...
az napraktika ne mu znam imenata na funkciite
kogato sa kompilirani na C++
znam che ima wariant sys dummy funkcii prez C da go prekaram
no ne me ustrojwa...
interesnoto e che na razlichnite versii na libc/glibc 
tezi prefix i suffix: _Z11 i v
sa razlichni...

wyprosa mi e kak po dqwolite da si adresiram prawilno funkciqta sled kato ne
znam imeto i...

za momenta sym si reshil problema po sledniq nachin
oshte ot configure scripta
si izpylnqwam edno perl scriptche koeto kompilira takawa
malka programka i parswa rezultata ot objdump-a
po tozi nachin wadq prefix i suffix koito wkarwam s DEFINE-owe w programata
si... ne che ne stawa po tozi nachin no mi se wivda mnogo dyrweno... 10x in
advance...

- -- 
- -=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-
  Regards,                                            AngelFire  
      Stanislav Lechev                    <[EMAIL PROTECTED]>     
     PGP Key: http://firedust.vega.bg/pgp/StanislavLechev.asc    
   Vega Internet Service Provider (tm)  --  http://www.vega.bg   
- -=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-=#=-


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/BUT28RPXBhiMqewRAjhJAKCLC9OcPw166EI3TeTgZ5/J0MCTxACfVSiI
VUW6ZL90gWHdhuF+YRD3Sbs=
=aZph
-----END PGP SIGNATURE-----
============================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers).
http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora
To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
============================================================================

============================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers).
http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora
To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
============================================================================

Reply via email to