__errno() synbol referencing error

Hello,
I got this problem at the linker and did not know which -l... to link to. Does any body know that library? OS is 8 and Studio 8. Thank you for your time.
Son Tran

My compiler is
Using CC -verbose=version
CC: Sun Workshop 6 update 1 C++ 5.2 2000/09/11
I took out the following code from my source code and developed it separately
See the sourcecode for the files below.
Below is a file which has a small function which checks if a file exists or not. It includes "errno.h"
File name is xieutFile.C
============================
// xieutFile.C
#include "xieutFile.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
* Following function checks if the file fileName exists. fileName should *
* specify the full path to the file. Function returns 0 on success - file *
* exists. Returns -2 if file does not exist, -3 if search permission is *
* denied for a component of the path, and -1 for any other failure. *
* See man pages for stat(2V) for more info on stat system call. *
int xieutFileExists (const char* fileName)
extern int     errno;
struct stat stbuf;
int          return_val;
if ( return_val = stat(fileName, &stbuf) < STAT_SUCCESS )
if (errno == ENOENT) // File does not exist
          return_val = FILE_DOES_NOT_EXIST;
else
if (errno == EACCES)
               return_val = SEARCH_PERMISSION_DENIED;
else
               return_val = STAT_FAILURE;
errno = 0; // Reset for next time
return return_val;
===========================================
Now I wrote another main program which calls the function implemented as above
Below is the source code. The file is called checkFile.C
=====================================================
// checkFile.C
#include <iostream.h>
extern int xieutFileExists(const char*);
int main(int argc, const char* argv)
if( xieutFileExists("/apps/ies/6.1/dev/src/ut/xieutFile.C") )
cout << "File exists" << endl;
else
cout << "File does not exist" << endl;
=====================================
I compiled the xieutFile.C usng the below command.
CC -c -mt -xarch=v9 -DTHREAD -DSOLARIS -DSOLARIS2_7 -DBITS64 -g xieutFile.C
then I created the shared library as below.
CC -G -xarch=v9 -o libxieut.so xieutFile.o
then I compiled the main program checkFile.C as below.
CC -c -mt -xarch=v9 -DTHREAD -DSOLARIS -DSOLARIS2_7 -DBITS64 -g checkFile.C
Then I tried to make the executable checkFile using the below command .
CC -o checkFile checkFile.o -mt -xarch=v9 -g -L. -lxieut
I get the error message
ild: (undefined symbol) int*___errno() -- referenced in ./libxieut2.so
If I replaced #include <errno.h> with #include <sys/errno.h> then it compiles and links fine.
The source code of my project links with lot of libraries. like libc.so, libaio.so, libintl.so, libnsl.so, libsocket.so, libdl.so, libm.so, libiostream.so under /usr/lib/sparcv9 directory of solaris 8.
Please let me know if I am missing anything or is there any other way.
Thanks,
zaki

Similar Messages

  • Referencing errors

    I am getting numerous referencing errors for this class. If anyone can help to shed some light on why I am getting these errors and how I can fix them, it would be greatly appreciated.
    Reptile.java:44: calculateAge() in Reptile cannot be applied to (Date)
    int currentAge = calculateAge(yearOfBirth);
    ^
    Reptile.java:46: setFoodQty() in Reptile cannot be applied to (Food)
    setFoodQty(quantity);
    ^
    Reptile.java:97: non-static method getDay() cannot be referenced from a static context
    dayOfBirth = Date.getDay();
    ^
    Reptile.java:97: incompatible types
    found : int
    required: Date
    dayOfBirth = Date.getDay();
    ^
    Reptile.java:104: non-static method getMonth() cannot be referenced from a static context
    monthOfBirth = Date.getMonth();
    ^
    Reptile.java:104: incompatible types
    found : int
    required: Date
    monthOfBirth = Date.getMonth();
    ^
    Reptile.java:111: non-static method getYear() cannot be referenced from a static context
    YOB = Date.getYear();
    ^
    Reptile.java:111: incompatible types
    found : int
    required: Date
    YOB = Date.getYear();
    ^
    Reptile.java:119: non-static method getDay() cannot be referenced from a static context
    arrivalDay = Date.getDay();
    ^
    Reptile.java:119: incompatible types
    found : int
    required: Date
    arrivalDay = Date.getDay();
    ^
    Reptile.java:126: non-static method getMonth() cannot be referenced from a static context
    arrivalMonth = Date.getMonth();
    ^
    Reptile.java:126: incompatible types
    found : int
    required: Date
    arrivalMonth = Date.getMonth();
    ^
    Reptile.java:133: non-static method getYear() cannot be referenced from a static context
    arrivalYear = Date.getYear();
    ^
    Reptile.java:133: incompatible types
    found : int
    required: Date
    arrivalYear = Date.getYear();
    ^
    Reptile.java:141: non-static method getFoodType() cannot be referenced from a static context
    preferredFood = Food.getFoodType();
    ^
    Reptile.java:141: incompatible types
    found : Food.FoodType
    required: Food
    preferredFood = Food.getFoodType();
    ^
    Reptile.java:149: cannot find symbol
    symbol : variable foodQuantity
    location: class Reptile
    foodQuantity = Food.getDosage();
    ^
    Reptile.java:149: non-static method getDosage() cannot be referenced from a static context
    foodQuantity = Food.getDosage();
    ^
    Reptile.java:197: incompatible types
    found : Date
    required: int
    return arrivalDay;
    ^
    Reptile.java:203: incompatible types
    found : Date
    required: int
    return arrivalMonth;
    ^
    Reptile.java:209: incompatible types
    found : Date
    required: int
    return arrivalYear;
    ^
    Reptile.java:221: incompatible types
    found : Food
    required: int
    return foodQTY;
    ^
    Reptile.java:235: operator - cannot be applied to int,Date
    currentAge = currentYear - YOB; //calculate age
    ^
    Reptile.java:240: cannot find symbol
    symbol : variable FoodType
    location: class Reptile
    Food testReptile = new Reptile("Larry", ReptileType.Lizard, 2000, 10, 10, 2008, FoodType.ButterflyWings, 10);
    ^
    Reptile.java:240: internal error; cannot instantiate Reptile.<init> at Reptile to ()
    Food testReptile = new Reptile("Larry", ReptileType.Lizard, 2000, 10, 10, 2008, FoodType.ButterflyWings, 10);
    ^
    Reptile.java:242: cannot find symbol
    symbol : method getReptileID()
    location: class Food
    System.out.println(testReptile.getReptileID());
    ^
    Reptile.java:244: cannot find symbol
    symbol : method getReptileName()
    location: class Food
    System.out.println(testReptile.getReptileName());
    ^
    Reptile.java:249: cannot find symbol
    symbol : method getReptileType()
    location: class Food
    System.out.println(testReptile.getReptileType());
    ^
    Reptile.java:251: cannot find symbol
    symbol : method getReptileAge()
    location: class Food
    System.out.println(testReptile.getReptileAge());
    ^
    Reptile.java:253: cannot find symbol
    symbol : method getArrivalDay()
    location: class Food
    System.out.println(testReptile.getArrivalDay() + "/" testReptile.getArrivalMonth() "/"
    ^
    Reptile.java:253: cannot find symbol
    symbol : method getArrivalMonth()
    location: class Food
    System.out.println(testReptile.getArrivalDay() + "/" testReptile.getArrivalMonth() "/"
    ^
    Reptile.java:254: cannot find symbol
    symbol : method getArrivalYear()
    location: class Food
    + testReptile.getArrivalYear());
    ^
    Reptile.java:256: cannot find symbol
    symbol : method getFood()
    location: class Food
    System.out.println(testReptile.getFood());
    ^
    Reptile.java:258: cannot find symbol
    symbol : method getFoodQTY()
    location: class Food
    System.out.println(testReptile.getFoodQTY() + "g");
    import java.util.Scanner;
    import java.util.Random;
    import java.util.Calendar;
    public class Reptile {
         private int reptileID;                                        //unique reptile ID
         private String reptileName;                                   //name of reptile
         public enum ReptileType {Snake, Lizard, Crocodile};     //enumerated list for different animal types
         private ReptileType reptileType;                         //reptile type
         private Date dayOfBirth;                                   //Reptile's year of birth
         private Date monthOfBirth;                                   //Reptile's year of birth
         private Date YOB;                                             //Reptile's year of birth (used to calculate reptile's age)
         private int currentAge;                                        //the reptile's age
         private int currentYear = 2008;                              //the default current year
         private Date arrivalDay;                                   //Day of reptile's arrivial in enclosure
         private Date arrivalMonth;                                   //Month of reptile's arrivial in enclosure
         private Date arrivalYear;                                   //Year of reptile's arrivial in enclosure
         private Food preferredFood;                                   //Reptile's food type
         private Food foodQTY;                                        //Reptile's daily food dosage
        //Default Reptile constructor
        public Reptile() {}
        //Reptile constructor
        public Reptile(String name, ReptileType type, Date yearOfBirth, Date entryDay, Date entryMonth,
             Date entryYear, Food food, Food  quantity)
             int reptileID = createID();
             setReptileName(name);
             setReptileType(type);
             setYOB(yearOfBirth);
             setArrivalMonth(entryMonth);
             setArrivalYear(entryYear);
             setArrivalDay(entryDay);
             int currentAge = calculateAge(yearOfBirth);
             setFood(food);
             setFoodQty(quantity);     
        // Mutator method to set the reptile name
            public void setReptileName(String name)
             Scanner scan = new Scanner(System.in);                         //get user input for reptile name
                 System.out.println("\nEnter the Reptile's Name...");
             reptileName = scan.nextLine();
        // Mutator method to set the reptile type
        public void setReptileType(ReptileType type)
             String newReptileType = "A";
             while (!((newReptileType.equals("S")) || (newReptileType.equals("L")) || (newReptileType.equals("C"))))
                  Scanner scan = new Scanner(System.in);                    //get user input for reptile type
                      System.out.println("\nEnter the Reptile Type...");
                  System.out.println("(S) for Snake");
                  System.out.println("(L) for Lizard");
                  System.out.println("(C) for Crocodile");
                  System.out.print("Reptile Type: ");
                  newReptileType = scan.nextLine();
                  //assign reptile types to the letters representing them, eg. S = Snake
                  if (newReptileType.equals("S"))                              
                       reptileType = ReptileType.Snake;
                       else
                            if (newReptileType.equals("L"))
                                 reptileType = ReptileType.Lizard;
                                 else
                                      if (newReptileType.equals("C"))
                                           reptileType = ReptileType.Crocodile;
                                           else
                                                System.out.println("Error. Input is not valid.");
        // Mutator method to set the reptile's day of birth
        public void setDayOfBirth(Date day)
             Scanner scan = new Scanner(System.in);
             System.out.println("You are required to enter the date the reptile was born. ");
             dayOfBirth = Date.getDay();
        // Mutator method to set the reptile's month of birth
        public void setMonthOfBirth(Date month)
             Scanner scan = new Scanner(System.in);
             monthOfBirth = Date.getMonth();
        // Mutator method to set the reptile's year of birth
        public void setYOB(Date year)
             Scanner scan = new Scanner(System.in);
             YOB = Date.getYear();
        // Mutator method to set the reptile's day of arrival
        public void setArrivalDay(Date day)
             Scanner scan = new Scanner(System.in);
             System.out.println("You are required to enter the date the reptile entered the enclosure. ");
             arrivalDay = Date.getDay();
        // Mutator method to set the reptile's month of arrival
        public void setArrivalMonth(Date month)
             Scanner scan = new Scanner(System.in);
             arrivalMonth = Date.getMonth();
        // Mutator method to set the reptile's year of arrival
        public void setArrivalYear(Date year)
             Scanner scan = new Scanner(System.in);
             arrivalYear = Date.getYear();
        // Mutator method to set the reptile's preferred food
        public void setFood(Food food)
             Scanner scan = new Scanner(System.in);
             System.out.println("You are required to enter the reptile's preferred food. ");
             preferredFood = Food.getFoodType();
        // Mutator method to set the reptile's daily food quantity
        public void setFood()
             Scanner scan = new Scanner(System.in);
             System.out.println("You are required to enter daily food quantity for the reptile. ");
             foodQuantity = Food.getDosage();
        // ReptileID accessor.
        public int getReptileID()
             return reptileID;
        // ReptileName accessor.
        public String getReptileName()
             return reptileName;
        // ReptileType accessor.
        public ReptileType getReptileType()
             return reptileType;
        // Reptile Day of Birth accessor.
        public Date getDayOfBirth()
             return dayOfBirth;
        // Reptile Month of Birth accessor.
        public Date getMonthOfBirth()
             return monthOfBirth;
        // Reptile Year of Birth accessor.
        public Date getYOB()
             return YOB;
        // Reptile currentAge accessor.
        public int getReptileAge()
             return currentAge;
         // Reptile arrival day accessor.
        public int getArrivalDay()
             return arrivalDay;
        // Reptile arrival month accessor.
        public int getArrivalMonth()
             return arrivalMonth;
        // Reptile arrival date accessor.
        public int getArrivalYear()
             return arrivalYear;
        // Reptile preferredFood accessor.
        public Food getFood()
             return preferredFood;
        // Reptile FoodQTY accessor.
        public int getFoodOTY()
             return foodQTY;
        //The createID() method produces a random reptile ID number between 0 and 100.
        public int createID()
             Random generator = new Random();
             reptileID = generator.nextInt(100) + 1;
        // The calculateAge() method calculates the reptile's current age
        public int calculateAge()
             //currentYear = Calendar.get(Calendar.YEAR) - 1900          //use a built-in Java function to calculate current year
             currentAge = currentYear - yearOfBirth;                         //calculate age
        public static void main(String args[])                               //driver Program to test class
             Food testReptile = new Reptile("Larry", ReptileType.Lizard, 2000, 10, 10, 2008, ButterflyWings, 10);
             System.out.print("Actual reptileID returned: ");
             System.out.println(testReptile.getReptileID());
             System.out.print("Actual reptile Name returned: ");
             System.out.println(testReptile.getReptileName());
             System.out.println("\nFor user input 'S', Expected reptile: Snake");
             System.out.println("For user input 'L', Expected reptile: Lizard");
             System.out.println("For user input 'C', Expected reptile: Crocodile");
             System.out.print("\nActual reptile type returned: ");
             System.out.println(testReptile.getReptileType());
             System.out.print("Actual reptile age returned: ");
             System.out.println(testReptile.getReptileAge());
             System.out.print("Actual arrival date returned: ");
             System.out.println(testReptile.getArrivalDay() + "/" +testReptile.getArrivalMonth() + "/"
                  + testReptile.getArrivalYear());
             System.out.print("Actual preferred food type returned: ");
             System.out.println(testReptile.getFood());
             System.out.print("Actual daily food dosage returned: ");
             System.out.println(testReptile.getFoodQTY() + "g");
    }

    I have changed all types to int but still am getting the same error. Any suggestions for the non-static method getDay() cannot be referenced from a static context errors I am getting?
    Reptile.java:44: calculateAge() in Reptile cannot be applied to (int)
    int currentAge = calculateAge(yearOfBirth);
    ^
    Reptile.java:46: setFoodQty() in Reptile cannot be applied to (Food)
    setFoodQty(quantity);
    ^
    Reptile.java:97: non-static method getDay() cannot be referenced from a static context
    dayOfBirth = Date.getDay();
    ^
    Reptile.java:104: non-static method getMonth() cannot be referenced from a static context
    monthOfBirth = Date.getMonth();
    ^
    Reptile.java:111: non-static method getYear() cannot be referenced from a static context
    YOB = Date.getYear();
    ^
    Reptile.java:119: non-static method getDay() cannot be referenced from a static context
    arrivalDay = Date.getDay();
    ^
    Reptile.java:126: non-static method getMonth() cannot be referenced from a static context
    arrivalMonth = Date.getMonth();
    ^
    Reptile.java:133: non-static method getYear() cannot be referenced from a static context
    arrivalYear = Date.getYear();
    ^
    Reptile.java:141: non-static method getFoodType() cannot be referenced from a static context
    preferredFood = Food.getFoodType();
    ^
    Reptile.java:149: non-static method getDosage() cannot be referenced from a static context
    foodQTY = Food.getDosage();
    ^
    Reptile.java:240: cannot find symbol
    symbol : variable FoodType
    location: class Reptile
    Food testReptile = new Reptile("Larry", ReptileType.Lizard, 2000, 10, 10, 2008, FoodType.WormSoup, 10);
    ^
    Reptile.java:240: internal error; cannot instantiate Reptile.<init> at Reptile to ()
    Food testReptile = new Reptile("Larry", ReptileType.Lizard, 2000, 10, 10, 2008, FoodType.WormSoup, 10);
    ^
    Reptile.java:242: cannot find symbol
    symbol : method getReptileID()
    location: class Food
    System.out.println(testReptile.getReptileID());
    ^
    Reptile.java:244: cannot find symbol
    symbol : method getReptileName()
    location: class Food
    System.out.println(testReptile.getReptileName());
    ^
    Reptile.java:249: cannot find symbol
    symbol : method getReptileType()
    location: class Food
    System.out.println(testReptile.getReptileType());
    ^
    Reptile.java:251: cannot find symbol
    symbol : method getReptileAge()
    location: class Food
    System.out.println(testReptile.getReptileAge());
    ^
    Reptile.java:253: cannot find symbol
    symbol : method getArrivalDay()
    location: class Food
    System.out.println(testReptile.getArrivalDay() + "/" testReptile.getArrivalMonth() "/"
    ^
    Reptile.java:253: cannot find symbol
    symbol : method getArrivalMonth()
    location: class Food
    System.out.println(testReptile.getArrivalDay() + "/" testReptile.getArrivalMonth() "/"
    ^
    Reptile.java:254: cannot find symbol
    symbol : method getArrivalYear()
    location: class Food
    + testReptile.getArrivalYear());
    ^
    Reptile.java:256: non-static method getDay() cannot be referenced from a static context
    System.out.println(Date.getDay() + "/" + Date.getMonth() + "/" + Date.getYear());
    ^
    Reptile.java:256: non-static method getMonth() cannot be referenced from a static context
    System.out.println(Date.getDay() + "/" + Date.getMonth() + "/" + Date.getYear());
    ^
    Reptile.java:256: non-static method getYear() cannot be referenced from a static context
    System.out.println(Date.getDay() + "/" + Date.getMonth() + "/" + Date.getYear());
    ^
    Reptile.java:258: cannot find symbol
    symbol : method getFood()
    location: class Food
    System.out.println(testReptile.getFood());
    ^
    Reptile.java:260: cannot find symbol
    symbol : method getFoodQTY()
    location: class Food
    System.out.println(testReptile.getFoodQTY() + "g");
    import java.util.Scanner;
    import java.util.Random;
    import java.util.Calendar;
    public class Reptile {
         private int reptileID;                                        //unique reptile ID
         private String reptileName;                                   //name of reptile
         public enum ReptileType {Snake, Lizard, Crocodile};     //enumerated list for different animal types
         private ReptileType reptileType;                         //reptile type
         private int dayOfBirth;                                        //Reptile's year of birth
         private int monthOfBirth;                                   //Reptile's year of birth
         private int YOB;                                             //Reptile's year of birth (used to calculate reptile's age)
         private int currentAge;                                        //the reptile's age
         private int currentYear = 2008;                              //the default current year
         private int arrivalDay;                                        //Day of reptile's arrivial in enclosure
         private int arrivalMonth;                                   //Month of reptile's arrivial in enclosure
         private int arrivalYear;                                   //Year of reptile's arrivial in enclosure
         private Food.FoodType preferredFood;                    //Reptile's food type
         private double foodQTY;                                        //Reptile's daily food dosage
        //Default Reptile constructor
        public Reptile() {}
        //Reptile constructor
        public Reptile(String name, ReptileType type, int yearOfBirth, int entryDay, int entryMonth,
             int entryYear, Food.FoodType food, Food  quantity)
             int reptileID = createID();
             setReptileName(name);
             setReptileType(type);
             setYOB(yearOfBirth);
             setArrivalMonth(entryMonth);
             setArrivalYear(entryYear);
             setArrivalDay(entryDay);
             int currentAge = calculateAge(yearOfBirth);
             setFood(food);
             setFoodQty(quantity);     
        // Mutator method to set the reptile name
            public void setReptileName(String name)
             Scanner scan = new Scanner(System.in);                         //get user input for reptile name
                 System.out.println("\nEnter the Reptile's Name...");
             reptileName = scan.nextLine();
        // Mutator method to set the reptile type
        public void setReptileType(ReptileType type)
             String newReptileType = "A";
             while (!((newReptileType.equals("S")) || (newReptileType.equals("L")) || (newReptileType.equals("C"))))
                  Scanner scan = new Scanner(System.in);                    //get user input for reptile type
                      System.out.println("\nEnter the Reptile Type...");
                  System.out.println("(S) for Snake");
                  System.out.println("(L) for Lizard");
                  System.out.println("(C) for Crocodile");
                  System.out.print("Reptile Type: ");
                  newReptileType = scan.nextLine();
                  //assign reptile types to the letters representing them, eg. S = Snake
                  if (newReptileType.equals("S"))                              
                       reptileType = ReptileType.Snake;
                       else
                            if (newReptileType.equals("L"))
                                 reptileType = ReptileType.Lizard;
                                 else
                                      if (newReptileType.equals("C"))
                                           reptileType = ReptileType.Crocodile;
                                           else
                                                System.out.println("Error. Input is not valid.");
        // Mutator method to set the reptile's day of birth
        public void setDayOfBirth(int day)
             Scanner scan = new Scanner(System.in);
             System.out.println("You are required to enter the date the reptile was born. ");
             dayOfBirth = Date.getDay();
        // Mutator method to set the reptile's month of birth
        public void setMonthOfBirth(int month)
             Scanner scan = new Scanner(System.in);
             monthOfBirth = Date.getMonth();
        // Mutator method to set the reptile's year of birth
        public void setYOB(int year)
             Scanner scan = new Scanner(System.in);
             YOB = Date.getYear();
        // Mutator method to set the reptile's day of arrival
        public void setArrivalDay(int day)
             Scanner scan = new Scanner(System.in);
             System.out.println("You are required to enter the date the reptile entered the enclosure. ");
             arrivalDay = Date.getDay();
        // Mutator method to set the reptile's month of arrival
        public void setArrivalMonth(int month)
             Scanner scan = new Scanner(System.in);
             arrivalMonth = Date.getMonth();
        // Mutator method to set the reptile's year of arrival
        public void setArrivalYear(int year)
             Scanner scan = new Scanner(System.in);
             arrivalYear = Date.getYear();
        // Mutator method to set the reptile's preferred food
        public void setFood(Food.FoodType food)
             Scanner scan = new Scanner(System.in);
             System.out.println("You are required to enter the reptile's preferred food. ");
             preferredFood = Food.getFoodType();
        // Mutator method to set the reptile's daily food quantity
        public void setFoodQty()
             Scanner scan = new Scanner(System.in);
             System.out.println("You are required to enter daily food quantity for the reptile. ");
             foodQTY = Food.getDosage();
        // ReptileID accessor.
        public int getReptileID()
             return reptileID;
        // ReptileName accessor.
        public String getReptileName()
             return reptileName;
        // ReptileType accessor.
        public ReptileType getReptileType()
             return reptileType;
        // Reptile Day of Birth accessor.
        public int getDayOfBirth()
             return dayOfBirth;
        // Reptile Month of Birth accessor.
        public int getMonthOfBirth()
             return monthOfBirth;
        // Reptile Year of Birth accessor.
        public int getYOB()
             return YOB;
        // Reptile currentAge accessor.
        public int getReptileAge()
             return currentAge;
         // Reptile arrival day accessor.
        public int getArrivalDay()
             return arrivalDay;
        // Reptile arrival month accessor.
        public int getArrivalMonth()
             return arrivalMonth;
        // Reptile arrival date accessor.
        public int getArrivalYear()
             return arrivalYear;
        // Reptile preferredFood accessor.
        public Food.FoodType getFood()
             return preferredFood;
        // Reptile FoodQTY accessor.
        public double getFoodOTY()
             return foodQTY;
        //The createID() method produces a random reptile ID number between 0 and 100.
        public int createID()
             Random generator = new Random();
             reptileID = generator.nextInt(100) + 1;
        // The calculateAge() method calculates the reptile's current age
        public int calculateAge()
             //currentYear = Calendar.get(Calendar.YEAR) - 1900          //use a built-in Java function to calculate current year
             currentAge = currentYear - YOB;                                   //calculate age
        public static void main(String args[])                               //driver Program to test class
             Food testReptile = new Reptile("Larry", ReptileType.Lizard, 2000, 10, 10, 2008, FoodType.WormSoup, 10);
             System.out.print("Actual reptileID returned: ");
             System.out.println(testReptile.getReptileID());
             System.out.print("Actual reptile Name returned: ");
             System.out.println(testReptile.getReptileName());
             System.out.println("\nFor user input 'S', Expected reptile: Snake");
             System.out.println("For user input 'L', Expected reptile: Lizard");
             System.out.println("For user input 'C', Expected reptile: Crocodile");
             System.out.print("\nActual reptile type returned: ");
             System.out.println(testReptile.getReptileType());
             System.out.print("Actual reptile age returned: ");
             System.out.println(testReptile.getReptileAge());
             System.out.print("Actual arrival date returned: ");
             System.out.println(testReptile.getArrivalDay() + "/" +testReptile.getArrivalMonth() + "/"
                  + testReptile.getArrivalYear());
             //System.out.print("Please enter the arrival date: ");
             System.out.println(Date.getDay() + "/" + Date.getMonth() + "/" + Date.getYear());
             System.out.print("Actual preferred food type returned: ");
             System.out.println(testReptile.getFood());
             System.out.print("Actual daily food dosage returned: ");
             System.out.println(testReptile.getFoodQTY() + "g");
    }

  • Referencing error while linking

    I am migrating our codes compiled in CC 4.2 to 6.2 and moving from Solaris 6 to 9
    I am compiling with the following options
    /apps/dev/sun5/lang6.2/SUNWspro/bin/CC -DCLASSIC_IOSTREAMS -library=rwtools7,iostream -staticlib=rwtools7,iostream -g -pto -DIT_EX_MACROS=1 -D_DEBUG=1
    -DOPSYS_SOLARIS=1 -DOPSYS_UNIX=1 -I<Includes> -c TeknekronFunctions_u.cpp -o TeknekronFunctions_u.o
    and linking with the following options
    /apps/dev/sun5/lang6.2/SUNWspro/bin/CC -o mditibgateway_sv < all the objects > -nolib -Bstatic -library=rwtools7,iostream -staticlib=rwtools7,iostream < all the libraries>
    -liostream -lCrun -lCstd -lrwtool -lm -lw -lcx -lsocket -lc -lsunmath -Bdynamic -lnsl -ldl
    Compiling is done successfully.
    But while linking , referencing errors occurs.
         RWCString::RWCString(char) /src/optics/TIB_MIG/sol.cxx.620_new/alert/libalert.a(MDIServerName.o)
         void(*set_terminate(void(*)()))() /src/optics/TIB_MIG/sol.cxx.620_new/alert/libalert.a(AlertExceptionHandlerRegistor.o)
    Do you have any clue on this referencing errors.
    Regards
    Deepak

    I am migrating our codes from CC4.2 to CC6.2
    I have one executable broker which is running and another server which when starts up cotacts
    the broker.
    At this point I am getting the core dump, while debugging the fuction is CountedObject::AddRef.
    This is the code, which increments the m_count using the obj.
    class CountedObject
    friend class CountingPointer;
         private:
         unsigned m_count;
    static void AddRef (CountedObject *obj)
              if (obj != NULL)
              ++obj->m_count;
                        TraceAddRef (obj);
    program terminated by signal SEGV (no mapping at the fault address)
    Current function is CountedObject::AddRef
    101 ++obj->m_count;
    (/apps/dev/sun5/lang6.2/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) where
    =>[1] CountedObject::AddRef(obj = 0x26454e44), line 101 in "refct.hpp"
    [2] CountingPointer::CountingPointer(this = 0xffbfd4f0, that = CLASS), line 167 in "refct.hpp"
    [3] MessageSegmentPointer::MessageSegmentPointer(this = 0xffbfd4f0, that = CLASS), line 201 in "message.hpp"
    [4] Message::UnmarshallSegments(this = 0x34d580, buff = 0x34d4b0 "+SEG&END"), line 1123 in "message.cpp"
    [5] Message::Message(this = 0x34d580, header = CLASS, buff = 0x34d4b0 "+SEG&END"), line 997 in "message.cpp"
    [6] Transmitter::ProcessBody(this = 0x350aa0), line 1879 in "transmitter.cpp"
    [7] Transmitter::DoRead(this = 0x350aa0), line 1819 in "transmitter.cpp"
    [8] DataSocket::DoRead(this = 0x34d458), line 547 in "datasocket.cpp"
    [9] DataSocket::DoOpenEvent(this = 0x34d458, evt = EV_READ), line 394 in "datasocket.cpp"
    [10] DataSocket::DoEvents(this = 0x34d458, events = CLASS, error = 285626368), line 437 in "datasocket.cpp"
    [11] Socket::Poll(maxWait = CLASS), line 770 in "socket_c.cpp"
    [12] MsgInfApplication::Go(limit = CLASS), line 676 in "msgapp_c.cpp"
    [13] BrokerApp::Run(this = 0x2cdd3c, argc = 0, argv = 0x2ea264), line 182 in "bkmain.cpp"
    [14] MsgInfApplication::RunApp(this = 0x2cdd3c, argc = 1, argv = 0x2ea260), line 623 in "msgapp_c.cpp"
    [15] main(argc = 1, argv = 0xffbfed3c), line 404 in "commonapp_c.cpp"
    (/apps/dev/sun5/lang6.2/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx)
    Can you please help me how to clear thes errors.

  • Ld: fatal symbol referencing errors when linking g++

    I have setup gcc with path=/usr/bin:/usr/sbin:/opt/sfw/bin:/opt/sfw/sbin:/opt/sfw/include/g++-3:/opt/sfw/lib/gcc-lib/i386-pc-solaris2.8/2.95.2:/usr/include:/usr/lib
    I can do # g++ -o test test.cpp
    but not # g++ -c test test.o
    get -> ld:fatal error symbol referencing error
    as well as ->
    ostream::operator<<(ostream &(*) /var/tmp/ccvxG011.o
    Undefined first referenced
    symbol in file
    cout /var/tmp/ccvhGO11.o
    I also have checked that there is no files
    gconfig.h, stdio.h, stdlib.h
    This was installed by using the companion cd
    as others has done as well.
    How do I send output using "cout" if STD C++
    gives this error , is certain functions replaced??
    a Test file with:
    ============
    <iostream>
    main()
    cout << "hello world" << endl;
    return 0;
    should work!!!

    HI
    If I can have a look at your program, may be I can shed some
    light on whats going on. Let me know your email address.
    -Manish
    "The services, software, materials and information provided at or in connection with this
    site ("Support") are offered subject to the Terms of Use at the link at the bottom of this
    page. You hereby accept these Terms by using this site, so please read these Terms
    carefully before using this site. If you do not accept these Terms, or you cannot access
    them, you cannot use this site or the Support offered. The Support, including any
    response, communication or followup by Sun, does not constitute an agreement to deliver
    any additional Support, and your use of the site and any Support is at your own risk."

  • Ld:fatal error symbol referencing error using g++

    I have setup gcc with path=/usr/bin:/usr/sbin:/opt/sfw/bin:/opt/sfw/sbin:/opt/sfw/include/g++-3:/opt/sfw/lib/gcc-lib/i386-pc-solaris2.8/2.95.2:/usr/include:/usr/lib
    I can do # g++ -o test test.cpp
    but not # g++ -c test test.o
    get -> ld:fatal error symbol referencing error
    as well as ->
    ostream::operator<<(ostream &(*) /var/tmp/ccvxG011.o
    Undefined first referenced
    symbol in file
    cout /var/tmp/ccvhGO11.o
    I also have checked that there is no files
    gconfig.h, stdio.h, stdlib.h
    This was installed by using the companion cd
    as others has done as well.
    How do I send output using "cout" if STD C++
    gives this error , is certain functions replaced??
    a Test file with:
    ============
    <iostream>
    main()
    cout << "hello world" << endl;
    return 0;
    should work!!!

    Perhaps if you do:
    #include <iostream.h>
    it will work better?
    A little note. Don't put /usr/include in your path and neither should you put the compiler's internal header dir in your path. That will confuse your compiler. The compiler should pick up its path for includes by itself and if you don't pass any arguments to GCC, it picks up its internal include dir and then the system (/usr/include).
    If by chance you get a system header and use it with GCC, but should have been the GCC header, you can get strange ld errors. Try gcc -E for more debugging.
    Alex

  • SP01: 2005 A SP01 Pl:02 Memory referenced error

    Hi,
    I have upgraded the system to 2005 A SP01 PL:02. I have created a add-on and deployed. When im trying to shut down the add-on, Memory referenced error is throw.
    is this a known issue in SP01 PL:02 or is there anything that needs to be done from the developer side. In SP00 PL:09 this is an issue reported.
    Waiting for an update
    Thanks
    Amudha
    Message was edited by: Frank Moebius
    Please start the topic with "SP01:"

    Thanks for the reply TOm and Frank. I am using .Net for development. i did the testing on demo dutch database and go this error. When i tried it on US Demo database there was no error when shutting thr add-on.
    I looked into the notes 928405. is this the cause for this issue?
    Symptom
    The upgrade to the 2005 A Release crashes with the following error message:
    "The instruction at "0x0157350c" referenced memory at "0xcccccccc". The
    memory could not be "read"."
    This happens to companies which use A\R Down Payments.
    Other terms
    down payment, crash, upgrade, 2005A, memory read
    Reason and Prerequisites
    bug
    Solution
    This issue will be fixed in a patch, please refer to the info.txt file
    on Service Market Place to confirm.
    What will be the solution?
    Thanks
    Amudha

  • Help needed regarding symbol referencing errors.

    Hi All,
    Im trying to compile a C code on Solaris 9 machine (Configuration details: SunOS Generic_112233-12 sun4u sparc SUNW,Sun-Blade-100 , 64-bit sparcv9)
    Command I ran :
    gcc -Wall -g -DUNIX -DN_PLAT_UNIX -I ../include/ client.c ../include/prim.c -L <library path> -ltls -lccs2 -o Client_new1
    ../include/prim.c: In function `PrimCloseSocket':
    ../include/prim.c:101: warning: implicit declaration of function `close'
    ../include/prim.c: In function `PrimSemaphoreInit':
    ../include/prim.c:263: warning: implicit declaration of function `memset'
    Undefined first referenced
    symbol in file
    sem_wait /var/tmp//cco4HZ48.o (symbol belongs to implicit dependency /lib/librt.so.1)
    sem_post /var/tmp//cco4HZ48.o (symbol belongs to implicit dependency /lib/librt.so.1)
    sem_init /var/tmp//cco4HZ48.o (symbol belongs to implicit dependency /lib/librt.so.1)
    nanosleep /var/tmp//cco4HZ48.o (symbol belongs to implicit dependency /lib/librt.so.1)
    sem_destroy /var/tmp//cco4HZ48.o (symbol belongs to implicit dependency /lib/librt.so.1)
    ld: fatal: Symbol referencing errors. No output written to Client_new1
    collect2: ld returned 1 exit status
    I'm getting these symbol referencing errors and I'm totally clueless as to what needs to be done nw. Any help guys??
    Thanks.

    the MAN page for sem_wait() implies that you must link with librt ( -ltr on the command line for linking )

  • Non-static method setUp() cannot be referenced  (error)

    Hi;
    I have this error
    "findContainer.java": non-static method setUp() cannot be referenced from a static context at line 10, column 26
    everytime i am trying to make this call
    jade.core.AddContTry.setUp();in
    public class findContainer {
      public findContainer() {}
        public void sUp(){
        System.out.println("please wait, this is first try to find he agents in the main container"+"\n");
        jade.core.AddContTry.setUp();
    this setup() method
    is written as follows
    public void AddContTry () {
    public void setUp(){
      AID[] list= null;
      try {
        MyMainContainer = myprofile.getMain();
        System.out.println("\n"+"This is the new container created in case of failure"+"\n");
        list = MyMainCont.agentNames();
        for (int i=0; i<list.length; i++){
          System.out.println("names = " + list.toString() + " \n");
    catch (ProfileException pe) { System.out.println("there is not main container");
    could you please help me?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    My guess is that it is throwing a NullPointerException because you have not set 'a' to be anything.
    The sample code you provided does not make sense.
    AddContTry is a method in the code but you are using it like a class.
    You have to set the following before you can use the object 'a'
    AddContTry a = // something
    I am just guessing here but can you write
    AddContTry a = new AddContTry();
    a.setUp();
    Note, If this is the case, the code in setUp should be in the constructor.

  • Object Referenced Error When calling the Windows Form during Runtime

    Hi,
    I am getting  Object reference errors when running windows form during runtime. In debugging mode in MS Visual studio 2005, I am not getting this error. I'm calling the window form from menu and called the window in a thread as suggested in one of forums . I don't see anyone in the forum mentioned this problem I have. Any help would be deeply appreciated. Below are the error and code samples.
    ERROR Message
    Exception Text **************
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Project1.Loadxml.Loadxml_Load(Object sender, EventArgs e)
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Form.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    Edited by: Albert Tio on Feb 16, 2011 9:55 AM

    Here is the code.
    Option Strict Off
    Option Explicit On
    Friend Class GetEvents
        Public WithEvents SBO_Application As SAPbouiCOM.Application
        Public SboGuiApi As SAPbouiCOM.SboGuiApi
        Public oForm As SAPbouiCOM.Form
        Public oDBDataSource As SAPbouiCOM.DBDataSource
        Public oCompany As SAPbobsCOM.Company
        Public RS As SAPbobsCOM.Recordset
        Public oPrev_Bank As String, oPrev_AcctType As String
        Public oLoadXml As Loadxml
        Public Sub SetApplication()
                 'Dim SboGuiApi As SAPbouiCOM.SboGuiApi
            Dim sConnectionString As String
            SboGuiApi = New SAPbouiCOM.SboGuiApi
            ' by following the steps specified above, the following
            ' statment should be suficient for either development or run mode
            sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
            ' connect to a running SBO Application
            SboGuiApi.Connect(sConnectionString)
            ' get an initialized application object
            SBO_Application = SboGuiApi.GetApplication()
        End Sub
        Public Sub SetCompany()
            Dim ret As Long
            Dim MsgStr As String
            Dim Cookie As String
            Dim ConnStr As String
            Try
                oCompany = New SAPbobsCOM.Company
                Cookie = oCompany.GetContextCookie
                ConnStr = SBO_Application.Company.GetConnectionContext(Cookie)
                '//before setting the SBO login context make sure the company is not connected
                If oCompany.Connected = True Then
                    oCompany.Disconnect()
                End If
                ret = oCompany.SetSboLoginContext(ConnStr)
                If Not ret = 0 Then
                    Exit Sub
                End If
                ret = oCompany.Connect
            Catch ex As Exception
                SBO_Application.MessageBox(ex.Message)
            End Try
            MsgStr = ""
            If Not ret = 0 Then
                oCompany.GetLastError(ret, MsgStr)
                SBO_Application.MessageBox(MsgStr)
            Else
            End If
        End Sub
        Public Sub New()
            MyBase.New()
            ' set SBO_Application with an initialized application object
            SetApplication()
            SetCompany()
            AddMenuItems()
        End Sub
        Private Sub SBO_Application_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.MenuEvent
            Dim myThread As New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf LoadXmlMainThread))
            Try
                If (pVal.MenuUID = "MySubMenu") And (pVal.BeforeAction = False) Then
                    'SBO_Application.MessageBox("My sub menu item was clicked")
                    '// Create a form to be launched in response to a click on the
                    '// new sub menu item
                    myThread.SetApartmentState(System.Threading.ApartmentState.STA)
                    myThread.Start()
                    'Loadxml.ShowDialog()
                                End If
            Catch ex As Exception
                SBO_Application.MessageBox("1." & ex.Message)
            End Try
            'If (pVal.MenuUID = "MyGoToMenu") And (pVal.BeforeAction = False) Then
            '    SBO_Application.MessageBox("My GoTo Menu was clicked")
            'End If
            'If (pVal.MenuUID = "MySecondGoToMenu") And (pVal.BeforeAction = False) Then
            '    SBO_Application.MessageBox("My Second GoTo Menu was clicked")
            'End If
        End Sub
        Private Sub LoadXmlMainThread()
            'Dim lLoadxml As New Loadxml
            Try
                oLoadXml = New Loadxml
                oLoadXml.WindowState = FormWindowState.Maximized
                oLoadXml.ShowInTaskbar = True
                oLoadXml.TopMost = True
                oLoadXml.Activate()
                Application.Run(oLoadXml)
            Catch ex As Exception
                SBO_Application.MessageBox("2." & ex.Message)
            End Try
        End Sub
        Private Sub AddMenuItems()
            '// Let's add a separator, a pop-up menu item and a string menu item
            Dim oMenus As SAPbouiCOM.Menus
            Dim oMenuItem As SAPbouiCOM.MenuItem
            Dim i As Integer '// to be used as counter
            Dim lAddAfter As Integer
            Dim sXML As String
            '// Get the menus collection from the application
            oMenus = SBO_Application.Menus
            'Save an XML file containing the menus...
            'sXML = SBO_Application.Menus.GetAsXML
            'Dim xmlD As System.Xml.XmlDocument
            'xmlD = New System.Xml.XmlDocument
            'xmlD.LoadXml(sXML)
            'xmlD.Save("c:
    mnu.xml")
            Dim oCreationPackage As SAPbouiCOM.MenuCreationParams
            oCreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)
            oMenuItem = SBO_Application.Menus.Item("43520") 'moudles'
            Dim sPath As String
            sPath = Application.StartupPath
            'sPath = sPath.Remove(sPath.Length - 3, 3)
            If sPath.EndsWith("\") = False Then
                sPath = sPath & "\"
            End If
            '// find the place in wich you want to add your menu item
            '// in this example I chose to add my menu item under
            '// SAP Business One.
            oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP
            oCreationPackage.UniqueID = "MyMenu01"
            oCreationPackage.String = "Unbridle Menu"
            oCreationPackage.Enabled = True
            oCreationPackage.Image = sPath & "unbridle.bmp"
            oCreationPackage.Position = 15
            oMenus = oMenuItem.SubMenus
            Try ' If the manu already exists this code will fail
                oMenus.AddEx(oCreationPackage)
                '// Get the menu collection of the newly added pop-up item
                oMenuItem = SBO_Application.Menus.Item("MyMenu01")
                oMenus = oMenuItem.SubMenus
                '// Create s sub menu
                oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
                oCreationPackage.UniqueID = "MySubMenu"
                oCreationPackage.String = "Unbridle Monitoring"
                oMenus.AddEx(oCreationPackage)
            Catch er As Exception ' Menu already exists
                'SBO_Application.MessageBox("Menu Already Exists")
            End Try
        End Sub
    End Class
    Public Class Loadxml
        'Inherits System.Windows.Forms.Form
        Public sBPpath As String
        Public sGLpath As String
        Public sBillpath As String
        Public bRun As Boolean
        Private Sub Loadxml_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Me.TextGL.Text = System.Configuration.ConfigurationSettings.AppSettings("GLAcctDownloadPath").ToString()
            Me.TextBP.Text = System.Configuration.ConfigurationSettings.AppSettings("BPAcctUPloadPath").ToString()
            Me.TextBill.Text = System.Configuration.ConfigurationSettings.AppSettings("BillUPloadPath").ToString()
            Me.NotifyIcon1.Visible = False
        End Sub
    End Class

  • External Jars referencing error

    I followed all the following steps which were discussed in forum to referencemy 9 external jars, my DC build was succeded in NWDI and has been deployed onto portal server. I got error message "DeploymentException:Clusterwide Exception:Failed to prepare application.....check the reference....." while running that ear file from portal.
    Steps i followed to reference external library:
    1) Created externallibrary DC, plces jars and made them as public (<b>here i made one public part for all jars, do i need to create different public part for different jars)...</b>
    2) Created library DC and added the above DC as used dc for build time and runtime reference,then deployed onto server i can see the service in visual admin with alljars in it.
    3) Created webdynpro DC and added above library DC as used DC, I added library reference tooo, build was succeded and above getting runtime error. <b>Iam giving the exact reference which is copied from visual admin.</b>
    I removed the library reference but iam still getting the same error.we running on NW'04s SP8,Any help is appreciated.
    Thanks,
    Damodhar.

    Hi Damodhar,
    Please check the posting
    https://forums.sdn.sap.com/click.jspa?searchID=216037&messageID=2563001.
    from the posting::
    "you need public part with type "compilation". Also you need to open project properties, go to "Web Dynpro References -> Web Dynpro Application" and add run-time reference to DC that exposes component"
    Regards, Anilkumar

  • Symbol referencing errors

    The calling subroutine failed to call other subroutines which were identified as undefined symbols within it. What are the problems actually? It looks like everything is well defined. Please help. Thanks in advance.

    I don't know if this is still an issue for you.
    In general in recounting these kinds of problems
    you need to supply more specfics such as in this
    case were the subroutines and the routine in the same
    source document? What is the compile step? What
    specfically are the compile or runtime error messages?
    Do you have a simplified code example you can show
    that still illustrates the error? What is your
    config, some system and OS information and the version
    of the compiler, the compile command or Makefile?

  • Fascinating Referencing Error

    I am an amateur Flash designer, and wanted to work on one portion of a Flash website, labelled, 'news', with a backup file in case I irrevocably messed up the original.  So, I 'Saved As' the 'news' file as 'newsBackup', creating two files, 'news' and 'newsBackup'.  Now when I run the index of the site, however, when I click the tab to bring up 'news', it doesn't work and I get the error message, Error opening URL 'file:///C|/Users/John%20Baldwin/Documents/Dreamweaver/Sites/sandhill/undefined'.  How can I fix this?  Any recommendations?  Thank you Flash gurus.
    -John

    You'll need to check the code for that tab that is associated with trying to open the file that is currently coming up as "undefined".  Some variable in your code is not getting assigned what it should, which may mean the resource that it is relying on for the file name might be missing or is otherwise not getting properly targeted. You'll need to backtrack to see where that variable gets assigned some value to see what it is missing in assigning the right value.

  • Implementing Custom Event - non-static referencing in static context error

    Hi,
    I'm implementing a custom event, and I have problems adding my custom listeners to objects. I can't compile because I'm referencing a non-static method (my custom addListener method ) from a static context (a JFrame which contains static main).
    However, the same error occurs even if I try to add the custom listener to another class without the main function.
    Q1. Is the way I'm adding the listener wrong? Is there a way to resolve the non-static referencing error?
    Q2. From the examples online, I don't see people adding the Class name in front of addListener.
    Refering to the code below, if I remove "Data." in front of addDataUpdatelistener, I get the error:
    cannot resolve symbol method addDataUpdateListener (<anonymous DataUpdateListener>)
    I'm wondering if this is where the error is coming from.
    Below is a simplified version of my code. Thanks in advance!
    Cindy
    //dividers indicate contents are in separate source files
    //DataUpdateEvent Class
    public class DataUpdateEvent extends java.util.EventObject
         public DataUpdateEvent(Object eventSource)
              super(eventSource);
    //DataUpdateListener Interface
    public interface DataUpdateListener extends java.util.EventListener
      public void dataUpdateOccured(DataUpdateEvent event);
    //Data Class: contains data which is updated periodically. Needs to notify Display frame.
    class Data
    //do something to data
    //fire an event to notify listeners data has changed
    fireEvent(new DataUpdateEvent(this));
      private void fireEvent(DataUpdateEvent event)
           // Make a copy of the list and use this list to fire events.
           // This way listeners can be added and removed to and from
           // the original list in response to this event.
           Vector list;
           synchronized(this)
                list = (Vector)listeners.clone();
           for (int i=0; i < list.size(); i++)
                // Get the next listener and cast the object to right listener type.
               DataUpdateListener listener = (DataUpdateListener) list.elementAt(i);
               // Make a call to the method implemented by the listeners
                  // and defined in the listener interface object.
                  listener.dataUpdateOccured(event);
               System.out.println("event fired");
    public synchronized void addDataUpdateListener(DataUpdateListener listener)
         listeners.addElement(listener);
      public synchronized void removeDataUpdateListener(DataUpdateListener listener)
         listeners.removeElement(listener);
    //Display Class: creates a JFrame to display data
    public class Display extends javax.swing.JFrame
         public static void main(String args[])
              //display frame
              new Display().show();
         public Display()
         //ERROR OCCURS HERE:
         // Non-static method addDataUpdateListener (DataUpdateListener) cannot be referenced from a static context
         Data.addDataUpdateListener(new DataUpdateListener()
             public void dataUpdateOccured(DataUpdateEvent e)
                 System.out.println("Event Received!");
    //-----------------------------------------------------------

    Calling
        Data.someMethodName()is referencing a method in the Data class whose signature includes the 'static' modifier and
    might look something like this:
    class Data
        static void someMethodName() {}What you want is to add the listener to an instance of the Data class. It's just like adding
    an ActionListener to a JButton:
        JButton.addActionListener(new ActionListener()    // won't work
        JButton button = new JButton("button");           // instance of JButton
        button.addActionListener(new ActionListener()     // okay
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Vector;
    import javax.swing.*;
    public class EventTest extends JFrame
        Data data;
        JLabel label;
        public EventTest()
            label = getLabel();
            data = new Data();
            // add listener to instance ('data') of Data
            data.addDataUpdateListener(new DataUpdateListener()
                public void dataUpdateOccured(DataUpdateEvent e)
                    System.out.println("Event Received!");
                    label.setText("count = " + e.getValue());
            getContentPane().add(label, "South");
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            setSize(300,200);
            setLocation(200,200);
            setVisible(true);
        private JLabel getLabel()
            label = new JLabel("  ", JLabel.CENTER);
            Dimension d = label.getPreferredSize();
            d.height = 25;
            label.setPreferredSize(d);
            return label;
        public static void main(String[] args)
            new EventTest();
    * DataUpdateEvent Class
    class DataUpdateEvent extends java.util.EventObject
        int value;
        public DataUpdateEvent(Object eventSource, int value)
            super(eventSource);
            this.value = value;
        public int getValue()
            return value;
    * DataUpdateListener Interface
    interface DataUpdateListener extends java.util.EventListener
        public void dataUpdateOccured(DataUpdateEvent event);
    * Data Class: contains data which is updated periodically.
    * Needs to notify Display frame.
    class Data
        Vector listeners;
        int count;
        public Data()
            listeners = new Vector();
            count = 0;
            new Thread(runner).start();
        private void increaseCount()
            count++;
            fireEvent(new DataUpdateEvent(this, count));
        private void fireEvent(DataUpdateEvent event)
            // Make a copy of the list and use this list to fire events.
            // This way listeners can be added and removed to and from
            // the original list in response to this event.
            Vector list;
            synchronized(this)
                list = (Vector)listeners.clone();
            for (int i=0; i < list.size(); i++)
                // Get the next listener and cast the object to right listener type.
                DataUpdateListener listener = (DataUpdateListener) list.elementAt(i);
                // Make a call to the method implemented by the listeners
                // and defined in the listener interface object.
                listener.dataUpdateOccured(event);
            System.out.println("event fired");
        public synchronized void addDataUpdateListener(DataUpdateListener listener)
            listeners.addElement(listener);
        public synchronized void removeDataUpdateListener(DataUpdateListener listener)
            listeners.removeElement(listener);
        private Runnable runner = new Runnable()
            public void run()
                boolean runit = true;
                while(runit)
                    increaseCount();
                    try
                        Thread.sleep(1000);
                    catch(InterruptedException ie)
                        System.err.println("interrupt: " + ie.getMessage());
                    if(count > 100)
                        runit = false;
    }

  • __errno() not defined..

    Getting this error while building a C++ executable on Solaris 10 using SUN Studio 11.
    Undefined
    symbol int*___errno()
    ld: fatal: Symbol referencing errors.
    We are using the -mt flag as one of the compiler options and the module builds fine if -mt is not specified. I was expecting this to be defined in the thread safe library /usr/lib/libCstd.so.1 but it is not.
    nm libCstd.so.1 |grep __errno
    [3851] | 0| 0|FUNC |GLOB |0 |UNDEF |___errno
    Any thoughts on what I am missing?

    There is a subtle clue in the error message. Because
    it shows up with "int*" in the linker error, we can deduce
    that the linker is complaining about a mangled name.
    The mangled name is turned into "int*___errno()" by
    an error output filter in the compiler driver.
    The problem is a missing 'extern "C"' wrapper around
    the declaration for ___errno.
    Make sure you're including "errno.h"
    There should be a #define in one of the headers like:
    #define errno (___errno())
    Nearby that there should also be a declaration for the ___errno()
    function, and that function should be wrapped by extern "C"
    so that the C++ compiler knows not to use the C++ mangling
    scheme on that symbol.
    --chris                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Report Generation Error Code=1 applying patch 1471898

    When apply the file g1471898 the adpatch was unable to generate reports. The message is ERROR [Code=1] generating report ....

    Thats not much to go on.
    You should probably take this up with Oracle Support.
    But surely there is more in the logs than just that.
    You dont have any 'ld: fatal: Symbol referencing errors..' or
    something along those lines?
    If you cant sort out the issue from your log files, then
    you might want to recompile your apps schema and try the g-driver
    again. Before contacting Support.

Maybe you are looking for

  • Computer freezes when I plug in Nano

    Whenever I plug in my Nano into this computer, this computer freezes.The iPod screen looks like it's only charging, without the "Do Not Disconnect" screen. I have tried plugging in the iPod into two other computers, a PC and Mac, and it worked fine f

  • How can I add a new domain to portal by writing a program

    I have been studied portal for a while but I still dont know how to solve this problem. Actually, I need to provide an api for my partner's program which is running on the iplanet application server. Therefore I tried to write a servlet which would i

  • Commons Net - List files with more than a wildcard "*" in path

    Hello everybody! I�m starting to use commons net library in a java project, and I have this doubt: I need to list files in a ftp server, for instance, like this �action*/slot*-qual*.txt� i.e., I want to list all the files like �slot (something) � qua

  • BAPI in SQ02

    Hi, I have a selection screen program for sale order change bapi in Dev 700 Client & its working fine. Now i want to execute same in Qulity client 900 without transporting request number. Through SQ02. Just let me know how to proceed for Extras-Code

  • Reg: Appraisal results effect on merit increase(compensation mgmt)...help.

    Dear friends, Greetings!! I hope so all are doing well,i have a scenario in implementation,the scenario belongs to appraisal results.In PD apprisal results should effect on the basic pay(0008 IT),it should be through compensation management(merit inc