Menu

Error with Shared Lib in C++:

An Zou
2017-01-27
2017-01-27
  • An Zou

    An Zou - 2017-01-27

    When I want to load the ngspice shared lib.
    It reports an error:
    /lib/libngspice.so: undefined symbol: MIFiSize
    Does someone know how to solve it?

    Thank you so much.

     
  • Robert Larice

    Robert Larice - 2017-01-27

    MIFiSize is part of a "xspice" .c file. Have you "configure"'ed with "xspice" or without ?
    If not, then please try --enable-xspice when building the shared library and let us know.
    Thank You,

     
    • An Zou

      An Zou - 2017-01-27

      Thank you so much for help.

      I think you are right. I "configure"ed with "xspice".

      Currently, I figured out this problem. I re"configure" and re"install" the software using following method (without xspice):

      ./configure --with-ngshared --disable-help
      make V=1
      sudo make install

       
    • Ryan Westafer

      Ryan Westafer - 2017-03-07

      Thanks Robert, is it possible to use xspice through the shared library?

      Update (error message and actions taken):

      # I get this error in a binary that uses libngspice.so :
      /usr/local/lib/libngspice.so: undefined symbol: MIFiSize
      
      # so I check the library and find out that it is undefined, but many similar symbols are defined...
      $ nm /usr/local/lib/libngspice.so | grep -5 MIFiSize
      0000000000104af5 t MIFget_port_type
      0000000000108bf3 t MIFgettok
      0000000000108e8a t MIFget_token
      000000000010659c t MIFgetValue
      00000000001051a6 t MIF_INP2A
                       U MIFiSize
      00000000001069f2 t MIFload
      0000000000109299 t MIFmAsk
      0000000000109ec5 t MIFmDelete
      00000000001079dc t MIFmParam
      0000000000107d4e t MIFsetup
      
       

      Last edit: Ryan Westafer 2017-03-07
      • Robert Larice

        Robert Larice - 2017-03-07

        Hello Ryan,
        from the An Zou's original posting, I got the impression he might have had
        an unclean build environment. Something like having configured with xspice, then compiled, then reconfigured without xspice, compiled. If not all artefacts of the first
        run have beend removed then I can imagine a problem like this might evolve.
        Right now, I've done a compilation myself here (with cider and xspice)(git master branch) and then looked with nm for MIFiSize. For me it is defined.
        I did it in a separate and completely empty build directory named "w32", like this

         mkdir w32
         rm -rf w32/* ; (cd ngspice && ./autogen.sh) && (cd w32 && LC_ALL=C ../ngspice/configure --enable-xspice --enable-cider --with-ngshared) && (cd w32 && LC_ALL=C make -k -j7)
        
        (cd w32 && LC_ALL=C make -k DESTDIR=/tmp install)
        
        nm /tmp/usr/local/lib/libngspice.so.0.0.0 | grep -5 MIFiSize
        

        This did all run straight and fine. and MIFiSize in defined in the .so file.
        Please redo the whole business, from a clean environment,
        and please report whether you succeeded or not.
        Regards

         
        • Ryan Westafer

          Ryan Westafer - 2017-03-07

          Thank you, Robert. Starting entirely from scratch fixed it; should have done that first.

           
          • Robert Larice

            Robert Larice - 2017-03-07

            Thank You for the Answer,
            good to know there is nothing more severe behind it.
            Regards

             

Log in to post a comment.