Runtime error in linking with static variables....

Hi,
I am building a shared library which includes a compiled object generated from a class containing the static variables only and also I have another version of same class with same & some new static variables in it and using that to generate another shared library. Now when I tried to run a program
which links with both the library it core dumps when it tries to return from the program i.e when it finishes.
Can someone please help me explain why my program is behaving like that?? Can duplicate inculsion of static variables in different scope can cause problem ?? How can this be avoided ?
Also please be advised that the class with static variables gets generated at the compile time using a script which uses a DTD whose version (specification) can be different in both the libraries therefore I can't just seperate the common stuff into one class and specific into another.
Thanks.
Rajeev.

Not to worry...found the answer in another post. Seems like patches need to applied to the OS.

Similar Messages

  • [SOLVED] mingw32 cross compile won't link with static libraries

    Hi all,
    I'm trying to cross compile an app I have written to i486-mingw32.  I'm running Arch 64-bit (under which it compiles fine natively), and I have installed the mingw32 binaries along with mingw32-boost-static from AUR.
    All seems well, but unfortunately when I cross compile my code libtool refuses to link to the static Boost libraries:
    *** Warning: Trying to link with static lib archive /usr/i486-mingw32/lib/libboost_filesystem-mt-s.a.
    *** I have the capability to make that library automatically link in when
    *** you link to this library. But I can only do this if you have a
    *** shared version of the library, which you do not appear to have
    *** because the file extensions .a of this argument makes me believe
    *** that it is just a static archive that I should not use here.
    This then leads to undefined references as the library is not linked in.  But as I *want* the static version of the library, does anyone know how to tell libtool to accept the .a file and link it?
    Last edited by Malvineous (2011-05-02 02:44:48)

    Just to follow up on this, I discovered the problem.  It turns out libtool was doing the correct thing, and refusing to link the static library in with the shared one (otherwise later this could result in something being defined multiple times.)  The undefined references were unrelated to the error above, and the code that was causing them (in a different Boost header file) could be easily #defined out.
    When the time came to link the actual executables, libtool did include all the necessary libraries and everything worked as it should!

  • How to import files with static variables into a block with methods?

    i have a problem. is it possible to import files with static variables into tags like
    <%!
    //here i want to import a file named settings.inc
    //whitch is used to set jdbc constants like url,driver,...
    private void method() {
    private void method2() {
    %>
    <%@include file="xy"%>//dosn�t work above
    //only in <%%>tag

    This should be done using either the Properties class or ResourceBundle. Ex.
    <%
    ResourceBundle resBun = ResourceBundle.getBundle(String resource);
    String username = resBun.getString("username");
    String password = resBun.getString("password");
    // etc
    %>

  • Error on compile - non-static variable can not be referencedfrom static con

    Error on compile happening with addButton?
    Thanks
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.JButton;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    import javax.swing.JFrame;
    public class Log implements ActionListener {
    JButton addButton;
    public static void addComponentsToPane(Container pane) {
    pane.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
         c.gridy = 3;
    c.gridx = 0;
         JLabel callsignLabel= new JLabel("Callsign");
    pane.add(callsignLabel, c);
         c.gridy = 3;
    c.gridx = 1;
         JLabel nameLabel= new JLabel("Name");
    pane.add(nameLabel, c);
         c.gridy = 3;
    c.gridx = 2;
         JLabel timeLabel= new JLabel("Time");
    pane.add(timeLabel, c);
         c.gridy = 3;
    c.gridx = 3;
         JLabel dateLabel= new JLabel("Date");
    pane.add(dateLabel, c);
         c.gridy = 3;
    c.gridx = 4;
         JLabel frequencyLabel= new JLabel("Freq ");
    pane.add(frequencyLabel, c);
         c.gridy = 3;
    c.gridx = 5;
         JLabel locationLabel = new JLabel("Country/State");
    pane.add(locationLabel, c);
    c.gridy = 5;
    c.gridx = 0;
         addButton = new JButton("Add");
    pane.add(addButton, c);
         addButton.addActionListener(this);

    Thank you for the reply
    I am new to Java
    What is wrong with the way it is coded?The error message tells you what's wrong: You're trying to reference a non-static variable from a static context.
    If you don't know what that means, then click the link I provided and look at the results from that google search. You might have to go through a few before you find a satisfactory explanation. And after you've done that, if you have specific questions about things you didn't understand there, please post again.

  • Runtime Error displaying Linked List

    Hi, I've got a main class with a linked list which I am trying to display but I seem to be getting a "Class Cast Exception" eventhough I type cast the list as a String. Can anyone help please. The code is below:
    import java.util.*;
    public class Library
         public static void main (String[] args)
              LinkedList myList = new LinkedList();
              LibraryItems libraryItems = new LibraryItems("Java how to Program", 10);
              myList.add(libraryItems);
              ListIterator myListIterator = myList.listIterator();
              while (myListIterator.hasNext())
                   String itemlist = (String) myListIterator.next();//this is where the runtime error occurs
                   libraryItems = (LibraryItems) myList.getFirst();
                   System.out.println(itemlist + " " + libraryItems.getItemName() + " "+
                                            libraryItems.getItemNumber());
    }and here is the supporting class:
    import java.util.LinkedList;
    public class LibraryItems
         private String itemName;
         private int   itemNumber;
         public LibraryItems(String itemName, int itemNumber)
              this.itemName = itemName;
              this.itemNumber = itemNumber;
         public String getItemName()
              return itemName;
         public int getItemNumber()
              return itemNumber;
    }Any help would really be appreciated.

    You add LibraryItems to the LinkedList, but when you get them out, you are casting to String.
    probably
    LibraryItems itemlist = (LibraryItems) myListIterator.next();
    System.out.println(itemlist.getItemName()...

  • Runtime error Outlook.exe with Acrobat 7.0.9

    I use Acrobat 7.0.9 professional with Office 2000. When using Outlook I get often messages "Microsoft Visual C++ runtime library Runtime error! Program: X:\Apps\Microsoft Office\Office]Outlook.exe This application has requested the Runtime to terminate it in a unusual way. Please contact the application's support team for more information."
    This error message shows up after deleting a message. Not always. The operating software is Windows XP.

    1 - the latest is 7.1
    2 - microsoft has one (maybe two) runtime fixes
    go to http://search.microsoft.com/search.aspx?mkt=en-US&setlang=en-US
    search for the text of the error message, or "something like"
    runtime update
    and follow the links to find the download

  • Runtime Error building Installer with NI-VISA Runtime

    Greetings,  I'm getting this error whenever I check the "NI-VISA Runtime" option in the installer app builder.
    Everything builds fine when I check only the Runtime Engine.  Shown below is what causes the RUNTIME ERROR and closes Labview Unexpectedly.
    Any help you could provide would be very much appreciated.
    Regards,
    JD

    Hi JD,
    This is a relatively common error with the Application Builder that can happen for several different reasons, namely registry keys pointing to installations that no longer exist. The easiest way to identify the problem is to get detailed information about the installer build. Here are directions:
    LabVIEW has the
    ability to create a very detailed log of the events that occur when
    building an application or installer. To enable this feature, open up
    the LabVIEW.ini file and copy "CDK.EnableLog=true" to the bottom
    of the file. Save the changes and close the ini file. The LabVIEW.ini
    file is usually located in C:\Program Files\National
    Instruments\LabVIEW X.X
    Enabling this feature will create a log file in the %temp% directory of your computer (%...% means a computer variable) .
    To
    find out where this temp directory is located, go to Start>>Run.
    Type in "cmd". Then type "set". This will return all of your computer's
    variable names.
    Look for TEMP in the list of variable names. You should see something like "TEMP=C:\DOCUME~1\user\LOCALS~1\Temp".
    Navigate to this directory using Windows Explorer.
    You
    should see a file named "Name.log" where "name" is the name of your
    build specification. For example, you might see "My Installer.log" if
    the name of your build specification is "My Installer".
    This will give you a more detailed log of the attempted build and, if I'm correct about why this particular build failed, show you which installer is expected at that registry. If the registry points to a directory without the necessary installer (i.e. VISA), simply delete the registry and allow the App Builder to prompt you to to point to the correct location.
    Michael K.
    | Michael K | Project Manager | LabVIEW R&D | National Instruments |

  • Runtime Error in JTable with JTableModel Implementation

    Hi,
    I tried to do a JTable (named "table) in my program, with an implementation of JTableModel, called DataContent (obj named "dc"). Now if I try to change dc's data and refresh the table in the window by doing a "table.setModel(dc);", my programm gives me just runtime errors.
    class MyFrame extends JFrame implements ActionListener{
    // This is the class of the JFrame which contains the table
    // globally defined vars:
    private DataContent dc;
    private final JTable table;
    // in someMethod(){
    public MyFrame(){
    // creates, inits and draws the table into the window - this works !
         JPanel jpPreview = new JPanel(new GridLayout(1,0));
         dc = new DataContent();
            table = new JTable(dc.getTableData(), dc.getCol());
            table.setPreferredScrollableViewportSize(new Dimension(500, 40));
            table.setBorder(borderPanel);
            jpPreview.add(table);
         jpSeparator.add(jpPreview);
    public void actionPerformed(ActionEvent ae) {
    // in the same class
              if(ae.getSource() == butLoadPath){
                   // choose a path by clicking on a button "butLoadPath"
                   szPath = sg.readPath();
                   labelLoadPath.setText(szPath);
                   dc.setPath(szPath);
                   dc.setContent(szToken);
              }else if(ae.getSource() == butSeparator){
                   // choose a different separator token by JRadioButtons
                   // when someone clicks on the button butSeparator,
                   // the table should be refreshed, with this function:
                   setPreview();
              }else...
    private void setPreview(){
              // reads out which option was chosen by the radiobuttons - this works
              // refreshes the Object[][] oData in dc - this works, too
              dc.setContent(szToken);
              // this should refresh the table obj in the JFrame,
              // this gives me some Null.pointer.exception - why ?
              table.setModel(dc);// ??? P R O B L E M ???
         }I have implemented the Interface DataContent like this:
    public class DataContent implements TableModel{
         // vars
         private int iRow,iCol;
         private String szInputData = "";
         char cToken, cLineLimiter;
         private Object[][] oData;
         // ctor
         public DataContent(){
              reset(); // set Elements...
         public void setPath( String szPath){          
              // read line from file obj...
         private void reset(){
              // set up an epmty set of data in the table...
         public void setContent( String szToken){          
              // separate content of szInputData by szToken and set oData...
         public Object[][] getTableData(){
              // return oData...
         public String[] getCol(){
              // gives some name for each column...
    ////////////////////////////////// automatic generated for the implementation of the interface JTableModel /////////////////
         /* (non-Javadoc)
          * @see javax.swing.table.TableModel#getRowCount()
         public int getRowCount() {
              // TODO Auto-generated method stub
              return iRow;
         /* (non-Javadoc)
          * @see javax.swing.table.TableModel#getColumnCount()
         public int getColumnCount() {
              // TODO Auto-generated method stub
              return iCol;
         /* (non-Javadoc)
          * @see javax.swing.table.TableModel#getColumnName(int)
         public String getColumnName(int columnIndex) {
              // TODO Auto-generated method stub
              String[] szColumnName = getCol();
              return szColumnName[columnIndex];
         /* (non-Javadoc)
          * @see javax.swing.table.TableModel#getColumnClass(int)
         public Class getColumnClass(int columnIndex) {
              // TODO Auto-generated method stub
              return null;
         /* (non-Javadoc)
          * @see javax.swing.table.TableModel#isCellEditable(int, int)
         public boolean isCellEditable(int rowIndex, int columnIndex) {
              // TODO Auto-generated method stub
              return false;
         /* (non-Javadoc)
          * @see javax.swing.table.TableModel#getValueAt(int, int)
         public Object getValueAt(int rowIndex, int columnIndex) {
              // TODO Auto-generated method stub
              return oData[rowIndex][columnIndex];
         /* (non-Javadoc)
          * @see javax.swing.table.TableModel#setValueAt(java.lang.Object, int, int)
         public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
              // TODO Auto-generated method stub
              // NO editing !
         /* (non-Javadoc)
          * @see javax.swing.table.TableModel#addTableModelListener(javax.swing.event.TableModelListener)
         public void addTableModelListener(TableModelListener l) {
              // TODO Auto-generated method stub
         /* (non-Javadoc)
          * @see javax.swing.table.TableModel#removeTableModelListener(javax.swing.event.TableModelListener)
         public void removeTableModelListener(TableModelListener l) {
              // TODO Auto-generated method stub
    }I tried to implement some of the automatic generated methods, without success, still the same problem. What can I do, that...
    table.setModel(dc);
    ...works without probs ???
    Is there a better way to do this - the table should not even be editable, just to be shown in the window, to give an impression ??
    THX

    Why are you creating you own TableModel. Use the DefaultTableModel its easier. If you don't want you cells to be editable then you just do this:
    JTable table = new JTable(...)
         public boolean isCellEditable(int row, int column)
              return false;
    };

  • Getting "warning" -- "Late bound resolution, runtime errors could occur" with a line referencing a Word document

    The problem line is:
                Dim Author$ = wd.ActiveDocument.BuiltInDocumentProperties(WdBuiltInProperty.wdPropertyAuthor).value.ToString
    "wd" is my program's instance of Microsoft Word.
    I've encountered this error before and could always fix the program and get rid of the warning without having to enclose the line in a "Try..Catch" structure. I enclosed this line in a Try..Catch, but the warning still appears, and for some reason,
    I have dedicated my few remaining years to getting rid of it.
    Robert Homes

    Armin:
    That didn't work for me. I couldn't even compile it like that, and I changed it to:
    =============================================
            Dim props As Microsoft.Office.Core.DocumentProperties = _
                    DirectCast(wd.ActiveDocument.BuiltInDocumentProperties, _
    Microsoft.Office.Core.DocumentProperties)
            Dim Author$ = props(WdBuiltInProperty.wdPropertyAuthor).Value.ToString
    =============================================
    That at least allowed me to compile (and DID get rid of the warning), but then I got a runtime error:
    ========================================================
    An unhandled exception of type 'System.InvalidCastException' occurred in Share.exe
    Additional information: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Core.DocumentProperties'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{2DF8D04D-5BFA-101B-BDE5-00AA0044DE52}'
    failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
    ================================================================================
    Robert Homes

  • Slow Query over Database Link with Bind Variable

    I have a query over a DB link, with all tables on the remote database.
    If I use a bind variable (from Toad), the query takes 4 minutes. If I replace the bind variable with a constant or substitution variable, it takes 1 second.
    The query runs fine when run directly on the remote database using bind variable.
    9.2.0.7

    Look up "Bind variable peeking"
    What's happened is you have an execution plan that differs from the one with the constant. Why? My bet is that Oracle "peeked" at the bind variable to help it decide which execution plan to build. It then cached it. It probably cached an execution with an index when it should be doing a full table scan or a hash join instead of a nested loop. It's hard to say specifically what it is.
    Try this, flush your shared pool and rerun the query with the bind and let us know if it takes 1 second or 4 minutes. If it takes 1 second, then that was probably it.
    Read part 2 of Tom Kyte's blog post on what it is and it's behavior.
    http://tkyte.blogspot.com/2007/09/sqltracetrue-part-two.html

  • Runtime Error on XP with Outlook 2010

    I get Runtime errors too.
    When i want to open an PDF in my Office 2010 Outlook then i get a runtime error.
    Whats to do?
    Greets
    Olaf

    A good idea would be to search for this problem in discussion forums (such as this one) and also to reinstall both Outlook and Adobe Reader to see if this resolves the problem.
    John
    http://www.ep1c-gaming.co.uk

  • Implement interface with static variable

    Hello all
    I want to create a class that has a static variable. In this class I also want to create a static function to change this static value. So I donot have to create any object when change the static variable.
    My problem is that this class should implement an interface (using facade pattern). As it implements an interface, it cannot have any static function in it.
    How I can overcome this problem. please help
    Many thanks
    shuhu

    My problem is that this class should implement an interface (using facade pattern).
    As it implements an interface, it cannot have any static function in it.Any class (including one that implements an interface) can have static methods.
    Do you mean you want the static method to be part of the interface? In this case you have a problem. Perhaps you should use an abstract class instead of an interface (the class could possibly implement the interface). Or perhaps you should rethink the need to have a static method.

  • Create a Template Editable Region Link with static "label"?

    Hello.
    Does anybody know how to create a simple, basic link on my template (just the word "LINK" will do) . . . . and put an Editable Field *behind* the "LINK" . . . so I can change the link destination link on each child page?
    So, in the particular child page, the visitor clicks on "LINK" . . . then goes to a specific destination URL just for that child page?
    Thanks.

    Chamuel333 wrote: Nadia . . . I have *attached* a screen shot of the error message I receive to this post (I figured that will eliminate the risk of me screwing-up a description of exactly what it says . . . and wasting your time).
    And, lastly, here is the exact code causing that error message:
    <!-- TemplateBeginEditable name="change-link" --><a href="http://annapolis-resume.com/Links.html" class="style7">Links</a><!-- TemplateEndEditable -->
    Thank you so much for your help with my beginner question!
    Jim
    That's pretty much the code I suppied originally and then removed thinking you'd prefer blus' method, which isn't all that hard to do by the way.
    The error message is saying that the template markup is sitting insite a block element, something like a paragraph, which is a block element,  for example.
    <!-- TemplateBeginEditable name="change-link" --><a href="http://annapolis-resume.com/Links.html" class="style7">Links</a><!-- TemplateEndEditable --></p>
    If so, move the template markup outside of the <p> attribute like so:
    <!-- TemplateBeginEditable name="change-link" --><p><a href="http://annapolis-resume.com/Links.html" class="style7">Links</a></p><!-- TemplateEndEditable -->
    This will make the paragraph editable.
    If that's not the problem, and you don't have the link inside a paragraph, then post a bit of code that surrounds that template markup that you have.  Better yet, if you can post a link to the page maybe even better  (if you can upload it to a server).

  • Error in linking with tuxedo 8.1 libraries

    Hi
    <BR></BR>
    <BR></BR>
    I am trying to compile a tuxedo client in tuxedo 8.1 on a PA-RISC HP UX system. When I compile, the following error is returned:
    <BR></BR>
    <BR></BR>
    <i>Can't open shared library: /home2/beadev/PEG/p/bld/lib/libengine.sl</i>
    <BR></BR>
    <BR></BR>
    What is puzzling about this is that on installation we defined our own tuxedo app directory to be <i>/mid/dev/product/tux/8.1_full</i> and hence the lib directory (which is in the SHLIB_PATH variable) should be <i>/mid/dev/product/tux/8.1_full/lib</i>. Yet the linking keeps referring to this directory that we have never created.
    <BR></BR>
    <BR></BR>
    Any help will be greatly appreciated
    <BR></BR>
    <BR></BR>
    Regards
    </BR>
    Ilan

    Not to worry...found the answer in another post. Seems like patches need to applied to the OS.

  • Polymorphismus with static variables?

    Hi,
    I just have a vatiable which stores some speficic data of the class and one method to return this value. If I declare the code like below getName always return "Superclass" until I override getName with the same body (so it's exactly the same method) in the subclass.
    Cause of this Redunancy, I want to know if there is a way to avoid this?
    Even using return this.name has not the desired effect.
    Thanks a lot in advance.
    Greetings Michael
    Superclass
    private static final String name = "Superclass";
    public  String  getName(){
      return name;
    }Subclass
    private static final String name = "Subclass";

    There is no way Superclass method getName() could access Subclass static member name, unless explicitely.
    In your case, the returned value of Superclass' getName() method is fixed at compilation time.
    As you didn't override the getName() method in Subclass, the Superclass getName() will be invoked for any instance of Superclass or Subclass.
    If you override the getName() method in Subclass, the choice of which method to invoke will be done at runtime.
    To make things easier to understand, always access static members in a static way, i.e. prefix static member access with its class name:class Superclass {
      private static final String name = "Superclass";
      public  String  getName(){
        return Superclass.name;
    }(this code is equivalent to yours)

Maybe you are looking for

  • SAP SD query

    Hello Experts, 1) I am getting Error while creating delivery for particular material. it says this material have 0 qty available. I have cheked the stock and stock is still available of 4.600KG. But when i Create delivery through sales order, it does

  • Error in transaction SOST

    Hi All, In transaction SOST, there are a lot of entries with the message "Email IHC account statements not delivered". For certain other entries the status text shows "The message could not be processed in the SAP system". What could be the reason fo

  • Itunes - Urgent help Needed!

    I recently uninstalled and deleted my old version of itunes as it was acting up.However when i went to download the new version it always stops at the stopping services part it says i do not have sufficient privaleges.Please help.

  • Comm: sed Tainted: Errors

    I just installed some cannibalized ram and I'm getting errors like this.  Could this be related? Apr 9 09:30:25 myhost kernel: FS-Cache: Loaded Apr 9 09:30:25 myhost kernel: FS-Cache: Netfs 'nfs' registered for caching Apr 9 09:30:25 myhost kernel: I

  • I phone 4s, Is it possible to automatically resend a message?

    I have an iphone 4s. Is there anyway to programme the phone to resend a message automatically, when the phone receives a signal. I find it very frustrating to have to keep pressing retry, and on a couple of occasions, have forgot to try resend thinki