1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

question about so files

Discussion in 'C++' started by ftom2, Jul 29, 2007.

  1. ftom2

    ftom2 New Member

    Joined:
    Jul 16, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    hi,
    i'm trying to create a shared object. the files i want to put in the shared object use a properties file to read some of the data. is there a way to include the properties file in the so file?
    if not, then how do i refer the properties file from the classes in the shared object? (i want to refer to the relative path).
    thanks.
     
  2. imported_xpi0t0s

    imported_xpi0t0s New Member

    Joined:
    Jul 18, 2008
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    0
    You can include the relative path name of the file in the shared object as part of the object data. Just declare it at the top of one of your source files.

    Alternatively if you want to include the file itself in the shared object that imples the file is unchanging. If this is the case just rewrite it as a data structure and declare it as before.

    Code:
    char *props_file="../../foo.properties";
    
    void mySOfunc()
    {
    // ...
    }
    
     

Share This Page