in reply to Re^2: Unable to use created PerlXS Modul ( using c++ )
in thread Unable to use created PerlXS Modul ( using c++ )

libmyclass builds successfully, and the test I created for it works fine

What files are created with myclass in the name?

.. undefined symbol ..

What do you get for  ldd -v /home/dr/Abby/XS/Mytest/blib/arch/auto/Mytest/Mytest.so
(see ldd -v ...so / ldd -v ..so like this )

What do you get for when you  objdump -p myclassfiles | grep MyClass ( see Re^4: DBD::mysql fail install check (objdump -p missing symbol) )

Replies are listed 'Best First'.
Re^4: Unable to use created PerlXS Modul ( using c++ )
by lamchob (Initiate) on Feb 10, 2014 at 10:30 UTC
    The following files are created: libmyclass.a myclass.o

    objdump

    dr@Marvin:~/Abby/XS/Mytest/myclass$ objdump -p myclass.o | grep MyCla +ss dr@Marvin:~/Abby/XS/Mytest/myclass$ objdump -p libmyclass.a | grep My +Class dr@Marvin:~/Abby/XS/Mytest/myclass$ objdump -p libmyclass.a In archive libmyclass.a: myclass.o: file format elf32-i386 unitTest.o: file format elf32-i386 dr@Marvin:~/Abby/XS/Mytest/myclass$ objdump -p myclass.o myclass.o: file format elf32-i386

    ldd -d ...

    dr@Marvin:~/Abby/XS/Mytest$ ldd -v /home/dr/Abby/XS/Mytest/blib/arch/a +uto/Mytest/Mytest.so linux-gate.so.1 => (0xb77b0000) libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb76b20 +00) libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb7694000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb74e9000) libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb74bd000) /lib/ld-linux.so.2 (0xb77b1000) Version information: /home/dr/Abby/XS/Mytest/blib/arch/auto/Mytest/Mytest.so: libc.so.6 (GLIBC_2.1.3) => /lib/i386-linux-gnu/libc.so.6 libgcc_s.so.1 (GCC_3.0) => /lib/i386-linux-gnu/libgcc_s.so.1 libstdc++.so.6 (CXXABI_1.3) => /usr/lib/i386-linux-gnu/libstdc +++.so.6 libstdc++.so.6 (GLIBCXX_3.4) => /usr/lib/i386-linux-gnu/libstd +c++.so.6 /usr/lib/i386-linux-gnu/libstdc++.so.6: libm.so.6 (GLIBC_2.0) => /lib/i386-linux-gnu/libm.so.6 ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2 libgcc_s.so.1 (GCC_4.2.0) => /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so.1 (GLIBC_2.0) => /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so.1 (GCC_3.3) => /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so.1 (GCC_3.0) => /lib/i386-linux-gnu/libgcc_s.so.1 libc.so.6 (GLIBC_2.4) => /lib/i386-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib/i386-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.1) => /lib/i386-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.3) => /lib/i386-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.1.3) => /lib/i386-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.3.2) => /lib/i386-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.0) => /lib/i386-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.2) => /lib/i386-linux-gnu/libc.so.6 /lib/i386-linux-gnu/libgcc_s.so.1: libc.so.6 (GLIBC_2.2.4) => /lib/i386-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.1.3) => /lib/i386-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.0) => /lib/i386-linux-gnu/libc.so.6 /lib/i386-linux-gnu/libc.so.6: ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2 ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2 ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2 /lib/i386-linux-gnu/libm.so.6: ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2 libc.so.6 (GLIBC_2.1.3) => /lib/i386-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.0) => /lib/i386-linux-gnu/libc.so.6 libc.so.6 (GLIBC_PRIVATE) => /lib/i386-linux-gnu/libc.so.6
    I can see what you are getting at, but what should I do now?

      hmm, cheap/dirty version, edit Makefile add myclass.o somewhere here

      g++ -shared -O2 -g -L/usr/local/lib -fstack-protector Mytest.o -o b +l +ib/arch/auto/Mytest/Mytest.so myclass/libmyclass.a \
      or run that command manually so myclass.o gets linked into MyTest.so

      if the tests pass after that then study ar manual (or xspp or Inline::CPP examples-generated-example-Makefile ) to figure out if you can fixup that portion of your Makefile so ar to generate the right type of file (like static version, or one with the right symbols being exported ...)

      Try removing unitTest.o from the list

      Also it would be helpful if you could provide a patch file like SOso-0.01.patch.txt , easier than copy/pasting multiple files from here on perlmonks ..

      Thats all I have time for now :) See you next day