I compile XS code to object code and link it in with my executable that has an embedded perl. The XS code call functions declared in the main executable; it's a callback module. The perl can't see my linked in module. When I "use Callback;" it dies looking for Callback.pm on the disk. If I make a Callback.pm and have it xsloader-bootstrap 'Callback' it dies looking for the .so. I have the proper boot functions in xs_init.
I'm quite lost. I got valid Callback.xs code that compiles fine to object code. I got "EXTERN_C void boot_Callback (pTHX_ CV* cv);" setup in the xs_init function, along with DynaLoader (which works fine). I got the perl in my main executable working fine and linking with my XS object code fine. But my Callback module DOESN'T WORK! Perl just keeps looking for stuff on the disk. How do I tell perl it doesn't need to do that?
This is all C++ using g++, if it matters.
Makefile: ... main : Callback.o ... $(CC) -o $@ $^ $(PERLLD) Callback.o : Callback.xs xsubpp Callback.xs > Callback.c $(CC) -c Callback.c $(PERLCXX)
Update: Got it working. All I had to do was add to the C++ code eval_pv("Callback::boot_Callback();", true);
In reply to embedded perl using linked in XS modules by kingkongrevenge
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |