Static linking - osLoadModule(), RiDeclare()

Help
2007-07-31
2013-04-25
  • Nicholas Yue
    Nicholas Yue
    2007-07-31

    Hi,

      I am attempting to statically link the *.a libraries I compiled using the TRUNK.

      linking with both libri.a and libpixiecommon.a produces the osLoadModule() missing errors.

      Also, is RiDeclare() not exported as a symbol for some reasons (my inhouse developed *.so plugin fails to load because RiDeclare() cannot be found)

    Regards

     
    • Okan Arikan
      Okan Arikan
      2007-07-31

          Hi Nicholas,

          This is interesting. osLoadModule is defined in src/common/os.cpp and I can not find a problem with RiDeclare.

          Are you sure you're including all c/cpp files in your library?

         Okan

       
      • Nicholas Yue
        Nicholas Yue
        2007-07-31

        Hi,

          From the svn trunk, I configure the build with --enable-static.

          I am linking against the libri.a file compiled on Ubuntu 6.0.1 as a result from that "configure".

          RiDeclare problem aside, I don't know what *.cpp file when into the linking of the libri.a library.

          BTW, I have also include libpixiecommon.a in the link in the hope that the symbols are found there but no luck.

        Regards

         
        • George Harker
          George Harker
          2007-08-01

          Hi Nicholas,

          If it's a static link you might need to mention -lpixiecommon after -lri due to the wierd way archives are searched.

          Hope that's it.

          Cheers

          George

           
          • Nicholas Yue
            Nicholas Yue
            2007-08-02

            Hi George,

            I have done the ordering swap for the Pixie library and it links fine but the *.so can't be loaded.

            I am writing two bindings for the RIB client (Java and Python), both have the same problem loading due to osLoadModule() symbol not found.

            8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------

            $ python testribclient.py
            Traceback (most recent call last):
              File "testribclient.py", line 1, in ?
                import ribclient
              File "/home/nicholas/project/pi_svn/graphics/renderman/RIBClient/python_swig/ribclient.py", line 5, in ?
                import _ribclient
            ImportError: /home/nicholas/project/pi_svn/graphics/renderman/RIBClient/python_swig/_ribclient.so: undefined symbol: _Z12osLoadModulePKc

            $ java -cp . testribclient
            Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/nicholas/project/pi_svn/graphics/renderman/RIBClient/java/libribclient.so: /home/nicholas/project/pi_svn/graphics/renderman/RIBClient/java/libribclient.so: undefined symbol: _Z12osLoadModulePKc

            8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------

            Regards