The doc does not say anything about C++
And that already was the exact error:
Code: Select all
g++ -o ../../../mymod.dll ../mymod.o -L/usr/local/lib -ltcl8.4 -lm /usr/lib/binmode.o
../../mymod.o: In function `TestCommand'
src/mod/mymod/mymod.cpp:54: undefined reference to `_dprintf'
If you add something like modules.o to your linker you get
Code: Select all
../../modules.o: In function `module_load':
/devel/eggdrop1.6.17/src/modules.c:791: undefined reference to `_H_load'
/devel/eggdrop1.6.17/src/modules.c:791: undefined reference to `_check_tcl_loadunld'
../../modules.o: In function `module_unload':
/devel/eggdrop1.6.17/src/modules.c:819: undefined reference to `_H_unld'
/devel/eggdrop1.6.17/src/modules.c:819: undefined reference to `_check_tcl_loadunld'
../../modules.o: In function `add_hook':
/devel/eggdrop1.6.17/src/modules.c:1027: undefined reference to `__rfc_ncasecmp'
/devel/eggdrop1.6.17/src/modules.c:1026: undefined reference to `__rfc_casecmp'
/devel/eggdrop1.6.17/src/modules.c:1028: undefined reference to `__rfc_tolower'
/devel/eggdrop1.6.17/src/modules.c:1029: undefined reference to `__rfc_toupper'
/devel/eggdrop1.6.17/src/modules.c:1037: undefined reference to `_block_dns_hostbyip'
/devel/eggdrop1.6.17/src/modules.c:1041: undefined reference to `_block_dns_ipbyhost'
../../modules.o: In function `del_hook':
/devel/eggdrop1.6.17/src/modules.c:1100: undefined reference to `_block_dns_hostbyip'
/devel/eggdrop1.6.17/src/modules.c:1104: undefined reference to `_block_dns_ipbyhost'
...
Seems it is not that easy to have it just compile ALL in C++.
I worked around that now by compiling the stuff that interacts with eggdrop directly (start, close, command functions) in C.
The other stuff i compile in C++ and then just link the stuff to one lib.
Seems to work for now.
Just need some ugly C functions to pass the input data to the classes *shrug*
Regards