Excelsior Forums: external libs - Excelsior Forums

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

external libs

#21 User is offline   eve 

  • Member
  • PipPip
  • Group: Members
  • Posts: 26
  • Joined: 24-July 06

Posted 10 July 2008 - 07:33 AM

Quote

so are we going to see a fix for this problem


Sure, we will definitely fix the documentation to make it less confusing ;)

Quote

I want to put my .so file into a directory next to the executable that loads classes from that .so file.  I would name that directory "lib", for example.  Then I want to give JETVMPROP the value that contains "-dll:*:lib" and have the executable load my classes from any .so file in "lib" directory. 


This will significantly degrade startup time and overall performance of your application.

Still you may try to emulate required behavior through the following method:

void registerPlugins() {
    String pluginsDir = "lib";
    String dlls[] = new File(pluginsDir).list(
        new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return name.endsWith(".so");
            }
        });       
    for(String dll : dlls) {
        System.load(new File(pluginsDir, dll).getAbsolutePath());
    }
}


Just call it before any attempts to load classes from your libraries.

Does this solution satisfy your needs?


0

#22 User is offline   kyt 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 48
  • Joined: 27-March 08

Posted 10 July 2008 - 03:58 PM

Quote

This will significantly degrade startup time and overall performance of your application.


We load plug-ins after start-up when the main system receives the info from outside about what classes to load.

Anyway, you gave us a good solution.  Thank you!  ;D


0

#23 User is offline   kyt 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 48
  • Joined: 27-March 08

Posted 18 July 2008 - 09:10 PM

Is it possible to to slightly modify a .prj file (change outputname and add some jars) save it as "newproject.prj", build a new executable and then run the new executable which loads a DLL that was built  with "!uses oldproject.prj" directive? The classes in the DLL are programmatically compatible with both exe-s -- the additional jars do not affect DLL-to-exe interaction.


I have tried to do it, but I get this message: "Runtime error #4(trap, xrXTables.mod:180). Please contact Excelsior ..."

I don't understand  what is going on.  Can you help?  Thanks







0

#24 User is offline   eve 

  • Member
  • PipPip
  • Group: Members
  • Posts: 26
  • Joined: 24-July 06

Posted 21 July 2008 - 01:23 PM

Quote

Is it possible to to slightly modify a .prj file (change outputname and add some jars) save it as "newproject.prj", build a new executable and then run the new executable which loads a DLL that was built  with "!uses oldproject.prj" directive?


No. You should keep projects in sync. If you recompile some project you should recompile all projects that reference it through !uses directive.

If executable X loads DLL Y then project for Y should reference project for X not some other project.
0

#25 User is offline   kyt 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 48
  • Joined: 27-March 08

Posted 07 January 2009 - 04:05 PM

Quote

No. You should keep projects in sync. If you recompile some project you should recompile all projects that reference it through !uses directive.


Can you tell me how strict is this policy?

I have been able to recompile the main project and use the old dependent DLL's without problems. 

Thank you.
0

#26 User is offline   zztop 

  • Advanced Member
  • Group: Moderators
  • Posts: 331
  • Joined: 09-February 05

Posted 22 January 2009 - 06:21 PM

Quote

I have been able to recompile the main project and use the old dependent DLL's without problems. 


You was lucky. In general case, it does not work.

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users