GetChars problem

Hi all, I'm having an issue extracting the first 11 characters from a 14 character string (read in from a DB2 database) using the getChars method. Here's the code:
String s = (rs.getString("partition_name"));
System.out.println("original string: " + s);
int start = 1;
int end = 11;
char newpart[] = new char[end - start];
s.getChars(start, end, newpart, 0);
System.out.println("     new string: " + newpart);And this is the output:
original string: TB_1538418432_384
new string: [C@533760a8[/b]
The output I'm expecting is:
[b]new string: TB_1538418432_
(i.e. the first 11 characters of a 14 character string).
I'm suspecting this is something to do with a mismatch between a database (DB2) that deals in one type of Unicode characters, and a system (UNIX) that deals with another.
However, if anyone can see a flaw in the code, please let me know - otherwise, if it looks OK and anyone thinks this is something to do with incompatible Unicode types, any advice on how to get around that would be hugely welcomed!
TIA.

Hi all, I'm having an issue extracting the first 11
characters from a 14 character string (read in from a
DB2 database) using the getChars method. Here's the
code:
String s = (rs.getString("partition_name"));
System.out.println("original string: " + s);
int start = 1;
int end = 11;
char newpart[] = new char[end - start];
s.getChars(start, end, newpart, 0);
System.out.println("     new string: " +
newpart);And this is the output:
original string: TB_1538418432_384
new string: [C@533760a8[/b]
[C@533760a8 is the return value of calling toString() on the char[] containing your chars. Try:System.out.println("     new string: " + new String(newpart));However why you are not using s.substring(0, 11) is lost on me.

Similar Messages

  • Problem in Java Mapping

    Hi,
          I was trying out a simple Java mapping example.
    Example of source structure is -
    <?xml version="1.0"?>
    <ns0:MT_SRC xmlns:ns0="http://www.sap-press.com/xi/training/00">
    <organization>
    <employee>
    <firstname>Jack</firstname>
    <lastname>Rose</lastname>
    </employee>
    <employee>
    <firstname>Paul</firstname>
    <lastname>McNealy</lastname>
    </employee>
    <employee>
    <firstname>Vaibhav</firstname>
    <lastname>Pandey</lastname>
    </employee>
    </organization>
    </ns0:MT_SRC>
    Example of target structure is -
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_TRGT xmlns:ns0="http://www.sap-press.com/xi/training/00"><Organization><employee><name>JackRose</name></employee><employee><name>PaulMcNealy</name></employee><employee><name>VaibhavPandey</name></employee></Organization></ns0:MT_TRGT>
    and here's the code I'm using
    package com.mapping;
    import java.io.*;
    import java.util.Map;
    import java.util.HashMap;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.api.MappingTrace;
    import com.sap.aii.mapping.api.StreamTransformation;
    public class JavaMap implements StreamTransformation{
         private Map param = null;
            private MappingTrace  trace = null;
            public void setParameter (Map param) {
                this.param = param;
                if (param == null) {
                    this.param = new HashMap();
            public void execute(InputStream in, OutputStream out) {
                   OutputStreamWriter buf_writer = new OutputStreamWriter(out);        
                   InputStreamReader buf_reader = new InputStreamReader(in);
                   String mat = new String();
                   String extmat = new String();
                   try {
                        buf_writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>" ,0,56);
                        buf_writer.write("<ns0:MT_TRGT xmlns:ns0=\"http://www.sap-press.com/xi/training/00\">");
                        buf_writer.write("<Organization>",0,20);
                        buf_writer.flush();
                  } catch(IOException e){};
                  try {
                       DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();          
                       factory.setValidating(false);          
                       DocumentBuilder builder = factory.newDocumentBuilder();          
                       Document doc = builder.parse(in);
                        String fname = null;
                        String lname = null;
                        doc.getDocumentElement().normalize();
                        //System.out.println("Root element " + doc.getDocumentElement().getNodeName());
                        NodeList nodeLst = doc.getElementsByTagName("employee");
                        //System.out.println("Information of all employees");
                        for (int s = 0; s < nodeLst.getLength(); s++) {
                        Node fstNode = nodeLst.item(s);
                        if (fstNode.getNodeType() == Node.ELEMENT_NODE) {
                             buf_writer.write("<employee>");     
                        Element fstElmnt = (Element) fstNode;
                        NodeList fstNmElmntLst = fstElmnt.getElementsByTagName("firstname");
                        Element fstNmElmnt = (Element) fstNmElmntLst.item(0);
                        NodeList fstNm = fstNmElmnt.getChildNodes();
                        //System.out.println("First Name : " + ((Node) fstNm.item(0)).getNodeValue());
                        fname = fstNm.item(0).getNodeValue();
                        NodeList lstNmElmntLst = fstElmnt.getElementsByTagName("lastname");
                        Element lstNmElmnt = (Element) lstNmElmntLst.item(0);
                        NodeList lstNm = lstNmElmnt.getChildNodes();
                        //System.out.println("Last Name : " + ((Node) lstNm.item(0)).getNodeValue());
                        lname = lstNm.item(0).getNodeValue();
                        buf_writer.write("<name>"fname" "lname"</name>");
                        buf_writer.write("</employee>");
                        buf_writer.write("</Organization>");
                        buf_writer.write("</ns0:MT_TRGT>");
                        TransformerFactory tFactory = TransformerFactory.newInstance();
                     Transformer transformer = tFactory.newTransformer();
                     transformer.setOutputProperty("indent", "yes");
                     DOMSource source = new DOMSource(doc);
                     StreamResult result = new StreamResult(out);
                     transformer.transform(source, result);
                        } catch (Exception e) {
                        e.printStackTrace();
    However, when I'm testing my Interface mapping, I'm getting the following error -
    Call method execute of the application Java mapping com.mapping.JavaMap
    Error during appliction Java mapping com/mapping/JavaMap
    java.lang.StringIndexOutOfBoundsException at java.lang.String.getChars(String.java:672)
    Could anyone please help me out with this?
    Thanks and Regards,
    Shiladitya

    HI,
    It looks to be that your JavaMap class have one field whihc will be not getting the proper value as input thus its creating the array Index out of bound exception.
    Please can you verify if you have assigned the proper String size for all the fields.
    Or probably you are getting the blank value which have created the execption.
    Also can you narrow down and let me know about the line String.getChars(String.java:672)
    Here you have used the try and catch option but may be the exact line no. can give better idea about the problem.
    Thanks
    swarup

  • Problem in reading this particular text file, what is the problem with it..

    Hai to all..,
    I had developed an application to read the text file that is stored in my computer from mobile, all are working fine but some files create problems in reading the file content, like the file i had attached with this..
    Can any one please tell why this particular file creates problem in reading the contents...
    I had attached a text file with this...
    and the code I am using is
    int getcharcount;
    FileInputStream fstream = new FileInputStream(filename);
    InputStreamReader in = new InputStreamReader(fstream);
    while ((getcharcount = in.read()) != 0)
         getchar = getchar + (char) getcharcount;
    System.out.println("Full File Content :"+getchar);
    I try'd with BufferedReader also, but have the same problem,
    Can any one please give me a solution for this..

    Hai to all..,
    Sorry for the previous posting,
    I had developed an application to read the text file that is stored in my computer from mobile, all are working fine but some files create problems in reading the file content, like the file i had attached with this..
    Can any one please tell why this particular file creates problem in reading the contents...
    and the code I am using is
    int getcharcount;
    FileInputStream fstream = new FileInputStream(filename);
    InputStreamReader in = new InputStreamReader(fstream);
    while ((getcharcount = in.read()) != 0)
         getchar = getchar + (char) getcharcount;
    System.out.println("Full File Content :"+getchar);
    I try'd with BufferedReader also, but have the same problem,
    Can any one please give me a solution for this..The error I am getting is
    Full File Content :ÿþC
    But the file contains plain text only..
    Edited by: Kamal Raj on Oct 17, 2010 10:22 PM

  • Problem with special characters (umlaut)

    Hi,
    I have a text box in my form.
    when I am entering the normal characters it working fine and the values are
    persisting quiet well in the database but when I am entering special characters (umlaut characters),
    it is not storing them properly in the database.
    I have checked in the logs at the application server side and the problem is while getting the values from
    the request. The JSP which is submitting the request I have explictly put the following line:
    request.setCharacterEncoding("iso-8859-1");
    But this also not seems to be working.
    Could you please let me know the resolution of this problem.
    Thanks in advance
    Amit

    Hi,
    Thanks for the reply.
    I have checked the database and there is no problem there.
    To check if I am getting the correct values from the JSP I have put the following code in my action class:
                                  if(columnName.equalsIgnoreCase("REMARKS"))
                                       log.debug("Character Encoding value of � is "+Character.getNumericValue('�'));
                                       log.debug("Character Encoding value of � is "+Character.getNumericValue('�'));
                                       log.debug("Character Encoding value of � is "+Character.getNumericValue('�'));
                                       log.debug("Character Encoding value of � is "+Character.getNumericValue('�'));
                                       log.debug("Character Encoding value of � is "+Character.getNumericValue('�'));
                                       log.debug("Character Encoding value of � is "+Character.getNumericValue('�'));
                                       String str = value.toString();
                                       char[] remarkArray = new char[str.length()];
                                       str.getChars(0, (str.length()-1), remarkArray, 0);
                                       for (int i = 0; i < remarkArray.length; i++)
                                            log.debug("Encoding value of "+remarkArray[i]+" is "+Character.getNumericValue(remarkArray));
    In the remarhs I am setting the value in the form as "������"
    and I am getting the following in the logs:
    Character Encoding value of &#9472; is -1
    Character Encoding value of � is -1
    Character Encoding value of &#9604; is -1
    Character Encoding value of � is -1
    Character Encoding value of � is -1
    Character Encoding value of � is -1
    Encoding value of &#9500; is -1
    Encoding value of &#9488; is -1
    Encoding value of &#9500; is -1
    Encoding value of &#9488; is -1
    Encoding value of &#9500; is -1
    Encoding value of &#9488; is -1
    Encoding value of &#9500; is -1
    Encoding value of &#9488; is -1
    Encoding value of &#9500; is -1
    Encoding value of � is -1
    Encoding value of &#9500; is -1
    Encoding value of is -1
    Kindly suggest what may be the issue??
    Amit

  • Switch statement problem

    I am doing a question in which I have to make a simple ATM program that can withraw and deposit money as many times as the user wants. To exit the program the user has to hit "x". I have to use a switch statement. Im getting incompatible type errors after compiling it. Can anyone help me? Sorry if the formattings not too good.
    //ATM.java
    //This program reads in a user's opening balance and performs a withdrawal or a deposit at the request of the user
    import java.text.*;
         public class ATM
         public static void main(String args[])
              int      balance;
              char      withdrawal, deposit, choice;
              //Ask for the opening balance
              System.out.print("Please enter your opening balance");
              balance=UserInput.getInt();
              //Find out what the user wants done
              System.out.print("What would you like to do? (Withdrawal, Depositor Exit(x))");
              choice=UserInput.getChar();
                                                                          switch(choice){     
    case "w":
                                                                          while(balance>0)
                                                                                              System.out.print("How much would you like to withdraw?");
                                                                                              withdrawal=UserInput.getChar();
                                                                                              balance=balance-withdrawal;
                                                                                              System.out.print("Your remaining balance is " + balance);
                                                                                              break;
    case "d":     
    while(balance>0)
                                                                                              System.out.print("How much do you wish to deposit?");
                                                                                              deposit=UserInput.getChar();
                                                                                              balance=balance+deposit;
                                                                                              System.out.print("Your new balance is " + balance);
                                                                                              break;
    case "x":          
                                                                System.out.print("Goodbye and thank you for using this program");
                                                                                              break;
    default:     
                                                                     System.out.print("We were not able to process your request, please try again");
                                                                                              break;
    }

    Type a reply to the topic using the form below. When finished, you can optionally preview your reply by clicking on the "Preview" button. Otherwise, click the "Post" button to submit your message immediately.
    Subject:
    Click for bold      Click for italics      Click for underline           Click for code tags      
      Formatting tips
    Message:
    Add topic to Watchlist:
    Original Message:
    Switch statement problem
    Xivilai Registered: Mar 3, 2007 9:52 AM      Mar 3, 2007 10:06 AM
    I am doing a question in which I have to make a simple ATM program that can withraw and deposit money as many times as the user wants. To exit the program the user has to hit "x". I have to use a switch statement. Im getting incompatible type errors after compiling it. Can anyone help me? Sorry if the formattings not too good.
    //ATM.java
    //This program reads in a user's opening balance and performs a withdrawal or a deposit at the request of the user
    import java.text.*;
    public class ATM
    public static void main(String args[])
    int balance;
    char withdrawal, deposit, choice;
    //Ask for the opening balance
    System.out.print("Please enter your opening balance");
    balance=UserInput.getInt();
    //Find out what the user wants done
    System.out.print("What would you like to do? (Withdrawal, Depositor Exit(x))");
    choice=UserInput.getChar();
    switch(choice){
    case 'w':
    while(balance>0)
    System.out.print("How much would you like to withdraw?");
    withdrawal=UserInput.getChar();
    balance=balance-withdrawal;
    System.out.print("Your remaining balance is " + balance);
    break;
    case 'd':
    while(balance>0)
    System.out.print("How much do you wish to deposit?");
    deposit=UserInput.getChar();
    balance=balance+deposit;
    System.out.print("Your new balance is " + balance);
    break;
    case 'x':
    System.out.print("Goodbye and thank you for using this program");
    break;
    default:
    System.out.print("We were not able to process your request, please try again");
    break;
    }

  • Q: problems allocating pointers with malloc

    Hi,
    I have some troubles allocating pointers with malloc. Maybe this
    is a CVI C compiler bug, because with gcc and Visual C it works
    fine. As you can see below, I have included a sample source code.
    The task of this program is only to isolate the error. So don�t wonder
    about the function.
    In line 34 I declare a new data type 'test_t' which consists of some
    int and pointer to int.
    In line 45 I call memalloc() to allocate a memory for such a variable.
    memalloc() is a wrapper function to malloc() which terminates the
    program
    if malloc fails otherwise it initializes the memory with 0.
    The real problem can be found in line 46 where the void pointer returned
    from memalloc() is assigned to a 'test_t' pointer. All fields of the
    allocated
    'test_t' variable which are pointers are set to 0xfd1e1f10. Other
    fields like the 'int status' are left zero.
    If I use calloc() instead of malloc() at line 20 it works.
    What's going on? I can't explain this behavior.
    Any ideas?
    Best regards,
    Franz Hollerer
    ========================================================
    sample c code
    ========================================================
    1 #include
    2 #include
    3 #include
    4
    5
    6 /* =============================================== */
    7
    8 void *memalloc(size_t size);
    9
    10 /* =============================================== */
    11
    12 /*
    13 * allocate and clear memory
    14 */
    15 void *memalloc(size)
    16 size_t size;
    17 {
    18 void *p;
    19
    20 p=malloc(size);
    21
    22 if (!p)
    23 {
    24 fprintf(stderr, "malloc() faild\n");
    25 exit(1);
    26 }
    27
    28 memset(p, 0, size);
    29 return(p);
    30 } /* eof memalloc */
    31
    32 /* =============================================== */
    33
    34 typedef struct condgen_t{
    35 int *next, *prev;
    36 int status;
    37 int *condnr;
    38 } test_t;
    39
    40 int main()
    41 {
    42 void *vp;
    43 test_t *p;
    44
    45 vp=memalloc(sizeof(test_t));
    46 p=vp;
    47 return(0); /* avoid gcc warning */
    48 }
    49
    Institut fuer Hochenegiephysik
    Nikolsdorfer Gasse 18
    1050 Wien
    Austria
    Tel: (+43-1)5447328/50

    Hi,
    I have started a discussion in comp.lang.c which deals with this
    problem. Keith Thomson has rewritten the demo program (see below).
    output of debuggable executable:
    null_pointer = 0
    sizeof(void *) = 4
    sizeof(test_t *) = 4
    sizeof(int *) = 4
    p = a20060
    p->next = 101f1efd
    p->prev = 101f1efd
    p->status = 0
    p->condnr = 101f1efd
    output of release executeable:
    null_pointer = 0
    sizeof(void *) = 4
    sizeof(test_t *) = 4
    sizeof(int *) = 4
    p = a20060
    p->next = 0
    p->prev = 0
    p->status = 0
    p->condnr = 0
    This means that the debuggable executable has some problem.
    Franz Hollerer
    1 #include
    2 #include
    3 #include
    4
    5 /*
    6 * I've deleted the superfluous declaration for memalloc. -- kst
    7 */
    8
    9 void *memalloc(size_t size)
    10 /*
    11 * Old-style declarations are still legal, but there's really
    12 * no point in using them. -- kst
    13 */
    14 {
    15 void *p;
    16
    17 p=malloc(size);
    18
    19 if (!p)
    20 {
    21 fprintf(stderr, "malloc() faild\n");
    22 exit(1);
    23 }
    24
    25 memset(p, 0, size);
    26 /*
    27 * As others have pointed out, this sets the struct to all zeros,
    28 * so it doesn't necessarily set the next, prev, and condnr
    members
    29 * to NULL. I don't think that's causing the problem you're
    seeing,
    30 * though. -- kst
    31 */
    32
    33 return(p);
    34 }
    35
    36 /* =============================================== */
    37
    38 typedef struct condgen_t{
    39 int *next, *prev;
    40 int status;
    41 int *condnr;
    42 } test_t;
    43
    44 /*
    45 * Added function show_info() to show some possibly relevant
    46 * characteristics of your system.
    47 */
    48 void show_info(void)
    49 {
    50 void *null_pointer = NULL;
    51
    52 printf("null_pointer = %p\n", null_pointer);
    53 printf("sizeof(void*) = %d\n", (int)sizeof(void*));
    54 printf("sizeof(test_t*) = %d\n", (int)sizeof(test_t*));
    55 printf("sizeof(int*) = %d\n", (int)sizeof(int*));
    56 }
    57
    58 int main(void)
    59 /*
    60 * Changed declaration from "int main()" to "int main(void)" -- kst
    61 */
    62 {
    63 test_t *p;
    64 p = memalloc(sizeof(test_t));
    65 /*
    66 * Deleted unnecessary void* intermediate pointer. memalloc()
    67 * returns a void*, but you can assign the result directly to
    68 * a test_t*. -- kst
    69 */
    70 show_info();
    71 printf("p = %p\n", (void*)p);
    72 printf("p->next = %p\n", (void*)p->next);
    73 printf("p->prev = %p\n", (void*)p->prev);
    74 printf("p->status = %d\n", p->status);
    75 printf("p->condnr = %p\n", p->condnr);
    76 /*
    77 * Finally, show some information. -- kst
    78 */
    79 getchar();
    80 return 0;
    81 /*
    82 * Note: The "return 0" isn't just to avoid a gcc warning, it's
    83 * a necessary part of the program. Without it, you'd be
    returning
    84 * some arbitrary status to the environment. -- kst
    85 */
    86 }
    87
    Institut fuer Hochenegiephysik
    Nikolsdorfer Gasse 18
    1050 Wien
    Austria
    Tel: (+43-1)5447328/50

  • Problem with regex

    sorry about my english.
    i'm working with large xml file which it data like this
    (this is sample data)
    <DOCTYPE lewis SYSTEM "lewis.dtd">
    <REUTERS TOPICS="NO" LEWISSPLIT="TEST" CGISPLIT="TRAINING-SET" OLDID="20436" NEWID="21001">
    <DATE>19-OCT-1987 15:37:46.03</DATE>
    <TOPICS></TOPICS>
    <PLACES></PLACES>
    <PEOPLE></PEOPLE>
    <ORGS></ORGS>
    <EXCHANGES></EXCHANGES>
    <COMPANIES></COMPANIES>
    <UNKNOWN>
    F
    f2882reute
    f f BC-CITYFED-FINANCI   10-19 0013</UNKNOWN>
    <TEXT TYPE="BRIEF">
    ******<TITLE>CITYFED FINANCIAL CORP SAYS IT CUT QTRLY DIVIDEND TO ONE CENT FROM 10 CTS/SHR
    </TITLE>Blah blah blah.
    </TEXT>
    </REUTERS>
    <REUTERS TOPICS="YES" LEWISSPLIT="TEST" CGISPLIT="TRAINING-SET" OLDID="20435" NEWID="21002">
    <DATE>19-OCT-1987 15:35:53.55</DATE>
    <TOPICS><D>crude</D><D>ship</D></TOPICS>
    <PLACES><D>bahrain</D><D>iran</D><D>usa</D></PLACES>
    <PEOPLE></PEOPLE>
    <ORGS></ORGS>
    <EXCHANGES></EXCHANGES>
    <COMPANIES></COMPANIES>
    <UNKNOWN>
    2873reute
    r f AM-GULF-PLATFORM   10-19 0101</UNKNOWN>
    <TEXT>
    <TITLE>HUGE OIL PLATFORMS DOT GULF LIKE BEACONS</TITLE>
    <AUTHOR>    By ASHRAF FOUAD</AUTHOR>
    <DATELINE>    BAHRAIN, Oct 19 - </DATELINE><BODY>Blah blah blah
    </BODY></TEXT>
    </REUTERS>
    <REUTERS TOPICS="YES" LEWISSPLIT="TEST" CGISPLIT="TRAINING-SET" OLDID="20435" NEWID="21002">
    <DATE>19-OCT-1987 15:35:53.55</DATE>
    <TOPICS><D>ship</D></TOPICS>
    <PLACES><D>bahrain</D><D>iran</D><D>usa</D></PLACES>
    <PEOPLE></PEOPLE>
    <ORGS></ORGS>
    <EXCHANGES></EXCHANGES>
    <COMPANIES></COMPANIES>
    <UNKNOWN>
    Y
    f2873reute
    r f AM-GULF-PLATFORM   10-19 0101</UNKNOWN>
    <TEXT>
    <TITLE>LIKE BEACONS</TITLE>
    <AUTHOR>    By ASHRAF FOUAD</AUTHOR>
    <DATELINE>    BAHRAIN, Oct 19 - </DATELINE><BODY>Blah blah blah
    </BODY></TEXT>
    </REUTERS>
    <REUTERS TOPICS="YES" LEWISSPLIT="TEST" CGISPLIT="TRAINING-SET" OLDID="20435" NEWID="21002">
    <DATE>19-OCT-1987 15:35:53.55</DATE>
    <TOPICS><D>ship</D></TOPICS>
    <PLACES><D>bahrain</D><D>iran</D><D>usa</D></PLACES>
    <PEOPLE></PEOPLE>
    <ORGS></ORGS>
    <EXCHANGES></EXCHANGES>
    <COMPANIES></COMPANIES>
    <UNKNOWN>
    Y
    f2873reute
    r f AM-GULF-PLATFORM   10-19 0101</UNKNOWN>
    <TEXT>
    <TITLE>HUGE OIL PLATFORMS DOT GULF LIKE BEACONS</TITLE>
    <AUTHOR>    By ASHRAF FOUAD</AUTHOR>
    <DATELINE>    BAHRAIN, Oct 19 - </DATELINE><BODY>Blah blah blah
    </BODY></TEXT>
    </REUTERS>
    <REUTERS TOPICS="YES" LEWISSPLIT="TEST" CGISPLIT="TRAINING-SET" OLDID="20435" NEWID="21002">
    <DATE>19-OCT-1987 15:35:53.55</DATE>
    <TOPICS><D>ship</D></TOPICS>
    <PLACES></PLACES>
    <PEOPLE></PEOPLE>
    <ORGS></ORGS>
    <EXCHANGES></EXCHANGES>
    <COMPANIES></COMPANIES>
    <UNKNOWN>
    Y
    f2873reute
    r f AM-GULF-PLATFORM   10-19 0101</UNKNOWN>
    <TEXT>
    <TITLE>HUGE OIL PLATFORMS DOT GULF LIKE BEACONS</TITLE>
    <AUTHOR>    By ASHRAF FOUAD</AUTHOR>
    <DATELINE>    BAHRAIN, Oct 19 - </DATELINE><BODY>Blah blah blah
    </BODY></TEXT>
    </REUTERS>i'm try to remove article with no topic or two or more topic.
    this is my code.(sorry for not clean the code many testing in it)
    package reuterxmlextraction;
    import java.io.*;
    import java.util.ArrayList;
    import java.util.regex.Pattern;
        public static void main(String[] args) throws IOException {
            int traningcount = 0;
            int testingcount = 0;
            int notopicex = 0;
            int multitopicex = 0;
            int totaltest = 0;
            int totaltrain = 0;
            int countarticle = 0;
            String finalOutput = "";
            File rfile = new File(args[0]);
            try {
                // Open the file that is the first
                // command line parameter
                FileInputStream fstream = new FileInputStream(rfile);
                // Get the object of DataInputStream
                DataInputStream in = new DataInputStream(fstream);
                BufferedReader br = new BufferedReader(new InputStreamReader(in), 1024 * 100);
                String strLine;
                String preOutput = "";
                ArrayList<String> preOutputmod = new ArrayList<String>();
                //Read File Line By Line
                //           while ((strLine = br.readLine()) != null) {
                //preOutput += strLine;
                //System.out.print(strLine);
                int len = (int) (rfile.length());
                byte buf[] = new byte[len];
                fstream.read(buf);
                fstream.close();
                preOutput = new String(buf);
                //System.out.println(preOutput);
                totaltest = count(preOutput, "LEWISSPLIT=\"TEST\"");
                totaltrain = count(preOutput, "LEWISSPLIT=\"TRAIN\"");
                int tempindex = 0;
                while (preOutput.indexOf("<REUTERS ", tempindex) != -1) {
                    //        while(tempindex == 0){
                    int a = preOutput.indexOf("<REUTERS ", tempindex);
                    //System.out.print(a +"\n");
                    int b = preOutput.indexOf("</REUTERS>", tempindex) + 10;
                    //System.out.print(b +"\n");
                    char pre[] = new char[b - a];
                    preOutput.getChars(a, b, pre, 0);
                    preOutputmod.add(String.valueOf(pre));
                    tempindex = b;
                    countarticle++;
                int loop = 0;
                while (loop < preOutputmod.size()) {
                    if (preOutputmod.get(loop).matches(".+<TOPICS>\\s*</TOPICS>.+")) {
                        preOutputmod.remove(loop);
                        notopicex++;
                        continue;
                    if (Pattern.matches(".+[<TOPICS>]?[<D>.+</D>]{2,}</TOPICS>.+\\s*", preOutputmod.get(loop))) {
                        preOutputmod.remove(loop);
                        multitopicex++;
                        continue;
                    } else {
                        finalOutput += preOutputmod.get(loop);
                    loop++;
            } catch (Exception e) {//Catch exception if any
                System.err.println("Error: " + e.getMessage());
            if (args[1] != null) {
                File f = new File(args[1]);
                Writer output = new BufferedWriter(new FileWriter(f));
                try {
                    //FileWriter always assumes default encoding is OK!
                    output.write(finalOutput);
                } finally {
                    output.close();
        static int count(String base, String searchFor) {
            int len = searchFor.length();
            int result = 0;
            if (len > 0) {  // search only if there is something
                int start = base.indexOf(searchFor);
                while (start != -1) {
                    result++;
                    start =
                            base.indexOf(searchFor, start + len);
            return result;
    }problem is that regex in my code don't work.
    i'm not good with regex.
    please help.
    ps.the xml i mentioned is reuter-21578 dataset total size approx 27mb

    Just saying "doesn't work" is meaningless. You need to provide details about exactly what went wrong.
    However, that's irrelevant here, since this is NOT a good job for regex. Use an XML parser.

  • The shuttle puzzle problem..

    Hi guys;
    for those raedy to rise challenges i present this problem... Any ideas to solve it are welcomed..some code would be a generous action from your part...
    SHUTTLE PUZZLE
    The SHUTTLE PUZZLE of size 3
    consists of 3 white marbles, 3 black
    marbles, and a strip of wood with 7 holes.
    The marbles of the same color are placed
    in the holes at the opposite ends of the
    strip, leaving the center hole empty.
    INITIAL STATE: WWW BBB
    GOAL STATE: BBB WWW
    To solve the shuttle puzzle use only two
    types of moves. Move 1 marble 1 space
    (into the empty hole) or jump 1 marble
    over 1 marble of the opposite color (into
    the empty hole). You may not back up,
    and you may not jump over 2 marbles.
    A Shuttle Puzzle of size N consists of N
    white marbles and N black marbles and
    2N+1 holes.
    Write a program that will solve the
    SHUTTLE PUZZLE for any size N(*10)
    and display the board after each move.
    Use W to represent a white marble and B
    to represent a black marble and a blank to
    represent the empty hole. Test your
    program for N=3 and N=4.
    Sample Run
    N = 3
    WWW BBB
    WWWB BB
    WW BWBB
    W WBWBB
    WBW WBB
    WBWBW B
    WBWBWB
    WBWB BW
    WB BWBW
    BWBWBW
    B WBWBW
    BBW WBW
    BBWBW W
    BBWB WW
    BB BWWW
    BBB WWW

    my friend , here is my own program for the Shutle problem...
    try it and tell me if something is wrong...
    cheers.
    * Created on 23 f�vr. 2004
    * To change the template for this generated file go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    * @author user
    * To change the template for this generated type comment go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    import java.io.*;
    import java.util.*;
    public class Shuttle {
         static int N=3;
         static int ln= 2*N+1;
         static int p=(int) Math.pow(2,N+1);
         static String[] a= new String[ln];
         static boolean shifted= false;
    public static void init()throws IOException {
         /*System.out.println("Enter N:");
         String ss= getString();
         N =(int)Integer.parseInt(ss);*/
         System.out.println("Solved shuttle:");
         ln= 2*N+1;
         p=(int) Math.pow(2,N+1);
         a= new String[ln];
         for(int i=0; i<N;i++)
         a="W";
         a[N]=" ";
         for(int i=N+1; i<a.length;i++)
         a[i]="B";
    public static String getString() throws IOException
         InputStreamReader isr = new InputStreamReader(System.in);
         BufferedReader br = new BufferedReader(isr);
         String s = br.readLine();
         return s;
    public static char getChar() throws IOException{
         String s= getString();
         return s.charAt(0);
    public static void print(String[] a){
         for(int i=0;i<a.length;i++)
              System.out.print(a[i]);
              System.out.println();
    public static int getHole(String[] a){
         int index=-1;
         for(int i=0;i<a.length;i++){
              if(a[i].equals(" ")){
                   index=i;break;
         return index;
    public static void swap(String[] a,int i,int j){
         String X=new String();
         X=a[i];
         a[i]=a[j];
         a[j]=X;
    public static boolean Done(String[]a){
         boolean done=true;
         for(int i=0;i< N; i++){
              if(!a[i].equals("B")){done=false;break;}
         if(!a[N].equals(" ")){done=false;
         for(int i=N+1; i< a.length;i++){
              if(!a[i].equals("W")){ done=false; break;
         return done;
    public static void shuttle(){
         int index=-1;
         //for(int k=0;k<p;k++){
         do{
              print(a);
              index=getHole(a);
              if(index==0){
                   if(a[index+1].equals("B"))swap(a,index,index+1);
                   else if(a[index+1].equals("W")&& a[index+2].equals("B")) swap(a,index,index+2);
                   //else if(a[index+1].equals("W")&& a[index+2].equals("B")) swap(a,index,index+2);
              else if(index==a.length-1){
                   if(a[index-1].equals("B")&&a[index-2].equals("W") )swap(a,index,index-2);
                   else if(a[index-1].equals("W"))swap(a,index,index-1);
              else if(a[index-1].equals("W")&&a[index+1].equals("B") ){
                   if (shifted==false){     swap(a,index,index+1); shifted=true; }
                   else if(shifted==true){ swap(a,index,index-1); shifted=false;
                   else if(a[index-1].equals("B")&&a[index+1].equals("W")){
                        if(((index+2)<=a.length-1)&& a[index+2].equals("B")) swap(a,index+2,index);
                        else if((index-2>=0)&& a[index-2].equals("W") ) swap(a,index-2,index);
              else if(a[index-1].equals("B")&& a[index+1].equals("B") ){
                   if ((index-2>=0)&& a[index-2].equals("W") )swap(a,index-2,index);
                   else if (((index+2)<=a.length-1)&& a[index+2].equals("B") ) swap(a,index-2,index);
                        else swap(a,index,index+1);
                   else if(a[index-1].equals("W")&& a[index+1].equals("W") ){
                        if (((index +2)<=(a.length-1)) && a[index+2].equals("B")) swap(a,index+2,index);
                        else if ((index -2>=0)&& a[index-2].equals("W") ) swap(a,index-2,index);
                        else swap(a,index,index-1);
              }while(Done(a)==false);
              print(a);
         public static void main(String[] args)throws IOException {
              while (true){
                   System.out.println("Enter N:");
                   String ss= getString();
                   N =(int)Integer.parseInt(ss);
              init();
              shuttle();
              System.out.print("another trial(y/n)?: ");
              char c=getChar();
              if (c=='y')continue;
              else if(c=='n'){System.err.println("Bye!");break;}

  • How to slove the character-converting problem?

    I'm developing a Japanese Application.
    In jsp , i get the string "6-2-3" which is all input by Japanese. But after i sent it to JavaBean as a parameter,it turned out to be "6?2?3". I 'm really confused by it.
    By the way , how to get a character's unicode in java?

    the primitive type char is used to store unicode values (\u0000 to \uFFFF, so 0 to 65335). java.lang.String are composed of char and so are unicode aware too. To get chars from your string you have 2 possibilities:
    - String.toCharArray()
    - String.getChar(int)
    About having a japanese user input of "6-2-3" and getting in your bean "6?2?3", that's definitely an encoding problem. The user input field does not use the ame encoding as your javaBean, so that's why one generate char that are not well understood by your bean. I'm sorry, I only know the problem, but not the solution.

  • [SOLVED] Problems building amule cvs

    Hello
    I'm almost new to arch and I've been able to build some packages, but don't know what's happening with this one
    I think I have some dependency missing or some symlinks to make, but don't really know
    The first problem is /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:52:24: error: wchar.h: file not exists
    but it exists in /usr/include/wchar.h, /usr/include/bits/wchar.h and /usr/include/c++/4.3.0/tr1/wchar.h
    Someone knows how to solve it?
    Thanks!!
    I attach the tail of makepkg
    All info parsed
    echo abstracts/ECTagTypes.abstract abstracts/ECCodes.abstract > ECGeneratedFiles
    make all-recursive
    make[5]: se ingresa al directorio `/home/alberto/aur/amule-cvs/src/amule-cvs/src/libs/ec'
    Making all in cpp
    make[6]: se ingresa al directorio `/home/alberto/aur/amule-cvs/src/amule-cvs/src/libs/ec/cpp'
    gcc ../../../../src/utils/mkFileSum.c -o mkFileSum
    Generating ECVersion.h... created.
    make all-am
    make[7]: se ingresa al directorio `/home/alberto/aur/amule-cvs/src/amule-cvs/src/libs/ec/cpp'
    if g++ -DHAVE_CONFIG_H -I. -I. -I../../../.. -isystem /usr/lib/wx/include/gtk2-unicode-release-2.8 -isystem /usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../../../src -I../../../../src/libs -I../../../../src/include -march=x86-64 -mtune=generic -O2 -pipe -isystem /usr/include -D__CRYPTO_INSTALLED__ -D__WEAK_CRYPTO__ -W -Wall -Wshadow -Wundef -O2 -DUSE_WX_EXTENSIONS -MT libec_a-ECTag.o -MD -MP -MF ".deps/libec_a-ECTag.Tpo" -c -o libec_a-ECTag.o `test -f 'ECTag.cpp' || echo './'`ECTag.cpp; \
    then mv -f ".deps/libec_a-ECTag.Tpo" ".deps/libec_a-ECTag.Po"; else rm -f ".deps/libec_a-ECTag.Tpo"; exit 1; fi
    En el fichero incluído de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/postypes.h:47,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iosfwd:47,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:44,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    de ECTag.h:28,
    de ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:52:24: error: wchar.h: No existe el fichero o el directorio
    En el fichero incluído de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:48,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:46,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    de ECTag.h:28,
    de ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:50:24: error: stdio.h: No existe el fichero o el directorio
    En el fichero incluído de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/c++locale.h:47,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/localefwd.h:47,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:47,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    de ECTag.h:28,
    de ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/clocale:48:25: error: locale.h: No existe el fichero o el directorio
    En el fichero incluído de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/localefwd.h:49,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:47,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    de ECTag.h:28,
    de ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cctype:49:24: error: ctype.h: No existe el fichero o el directorio
    En el fichero incluído de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:46,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/basic_ios.h:44,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:50,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    de /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    de ECTag.h:28,
    de ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:51:25: error: wctype.h: No existe el fichero o el directorio
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/postypes.h:47,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iosfwd:47,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:44,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:72: error: '::mbstate_t' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:146: error: '::wint_t' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:148: error: '::btowc' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:149: error: '::fgetwc' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:150: error: '::fgetws' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:151: error: '::fputwc' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:152: error: '::fputws' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:153: error: '::fwide' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:154: error: '::fwprintf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:155: error: '::fwscanf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:156: error: '::getwc' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:157: error: '::getwchar' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:158: error: '::mbrlen' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:159: error: '::mbrtowc' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:160: error: '::mbsinit' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:161: error: '::mbsrtowcs' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:162: error: '::putwc' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:163: error: '::putwchar' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:164: error: '::swprintf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:165: error: '::swscanf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:166: error: '::ungetwc' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:167: error: '::vfwprintf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:169: error: '::vfwscanf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:171: error: '::vswprintf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:173: error: '::vswscanf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:175: error: '::vwprintf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:177: error: '::vwscanf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:179: error: '::wcrtomb' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:180: error: '::wcscat' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:181: error: '::wcscmp' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:182: error: '::wcscoll' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:183: error: '::wcscpy' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:184: error: '::wcscspn' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:185: error: '::wcsftime' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:186: error: '::wcslen' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:187: error: '::wcsncat' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:188: error: '::wcsncmp' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:189: error: '::wcsncpy' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:190: error: '::wcsrtombs' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:191: error: '::wcsspn' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:192: error: '::wcstod' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:194: error: '::wcstof' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:196: error: '::wcstok' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:197: error: '::wcstol' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:198: error: '::wcstoul' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:199: error: '::wcsxfrm' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:200: error: '::wctob' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:201: error: '::wmemcmp' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:202: error: '::wmemcpy' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:203: error: '::wmemmove' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:204: error: '::wmemset' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:205: error: '::wprintf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:206: error: '::wscanf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:208: error: '::wcschr' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar: In function 'wchar_t* std::wcschr(wchar_t*, wchar_t)':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:212: error: conversión inválida de 'const wchar_t*' a 'wchar_t*'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:212: error: argumento de inicialización 1 de 'wchar_t* std::wcschr(wchar_t*, wchar_t)'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar: At global scope:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:214: error: '::wcspbrk' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar: In function 'wchar_t* std::wcspbrk(wchar_t*, const wchar_t*)':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:218: error: conversión inválida de 'const wchar_t*' a 'wchar_t*'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:218: error: argumento de inicialización 1 de 'wchar_t* std::wcspbrk(wchar_t*, const wchar_t*)'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar: At global scope:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:220: error: '::wcsrchr' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar: In function 'wchar_t* std::wcsrchr(wchar_t*, wchar_t)':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:224: error: conversión inválida de 'const wchar_t*' a 'wchar_t*'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:224: error: argumento de inicialización 1 de 'wchar_t* std::wcsrchr(wchar_t*, wchar_t)'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar: At global scope:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:226: error: '::wcsstr' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar: In function 'wchar_t* std::wcsstr(wchar_t*, const wchar_t*)':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:230: error: conversión inválida de 'const wchar_t*' a 'wchar_t*'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:230: error: argumento de inicialización 1 de 'wchar_t* std::wcsstr(wchar_t*, const wchar_t*)'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar: At global scope:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:232: error: '::wmemchr' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar: In function 'wchar_t* std::wmemchr(wchar_t*, wchar_t, size_t)':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:236: error: conversión inválida de 'const wchar_t*' a 'wchar_t*'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:236: error: argumento de inicialización 1 de 'wchar_t* std::wmemchr(wchar_t*, wchar_t, size_t)'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar: At global scope:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:253: error: '::wcstold' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:262: error: '::wcstoll' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:263: error: '::wcstoull' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:270: error: '__gnu_cxx::wcstold' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:271: error: '__gnu_cxx::wcstoll' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwchar:272: error: '__gnu_cxx::wcstoull' no se ha declarado
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iosfwd:47,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:44,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/postypes.h:207: error: 'mbstate_t' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/postypes.h:207: error: el argumento de plantilla 1 es inválido
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/postypes.h:207: error: invalid type in declaration before ';' token
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/postypes.h:209: error: 'mbstate_t' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/postypes.h:209: error: el argumento de plantilla 1 es inválido
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/postypes.h:209: error: invalid type in declaration before ';' token
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:48,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:46,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:100: error: '::FILE' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:101: error: '::fpos_t' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:103: error: '::clearerr' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:104: error: '::fclose' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:105: error: '::feof' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:106: error: '::ferror' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:107: error: '::fflush' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:108: error: '::fgetc' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:109: error: '::fgetpos' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:110: error: '::fgets' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:111: error: '::fopen' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:112: error: '::fprintf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:113: error: '::fputc' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:114: error: '::fputs' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:115: error: '::fread' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:116: error: '::freopen' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:117: error: '::fscanf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:118: error: '::fseek' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:119: error: '::fsetpos' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:120: error: '::ftell' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:121: error: '::fwrite' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:122: error: '::getc' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:123: error: '::getchar' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:124: error: '::gets' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:125: error: '::perror' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:126: error: '::printf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:127: error: '::putc' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:128: error: '::putchar' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:129: error: '::puts' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:130: error: '::remove' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:131: error: '::rename' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:132: error: '::rewind' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:133: error: '::scanf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:134: error: '::setbuf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:135: error: '::setvbuf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:136: error: '::sprintf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:137: error: '::sscanf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:138: error: '::tmpfile' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:139: error: '::tmpnam' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:140: error: '::ungetc' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:141: error: '::vfprintf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:142: error: '::vprintf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:143: error: '::vsprintf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:170: error: '::snprintf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:171: error: '::vfscanf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:172: error: '::vscanf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:173: error: '::vsnprintf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:174: error: '::vsscanf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:181: error: '__gnu_cxx::snprintf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:182: error: '__gnu_cxx::vfscanf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:183: error: '__gnu_cxx::vscanf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:184: error: '__gnu_cxx::vsnprintf' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cstdio:185: error: '__gnu_cxx::vsscanf' no se ha declarado
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:46,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:69: error: 'mbstate_t' en el espacio de nombres 'std' no nombra un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h: In static member function 'static typename __gnu_cxx::_Char_types<_CharT>::int_type __gnu_cxx::char_traits<_CharT>::eof()':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:141: error: 'EOF' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h: At global scope:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:242: error: 'mbstate_t' no nombra a un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h: In static member function 'static int std::char_traits<char>::eof()':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:295: error: 'EOF' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h: At global scope:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:309: error: 'wint_t' no nombra a un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:312: error: 'mbstate_t' no nombra a un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:351: error: expected ',' or '...' before '&' token
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:353: error: 'int_type' no nombra a un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:357: error: expected ',' or '...' before '&' token
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:360: error: 'int_type' no nombra a un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:363: error: 'int_type' no nombra a un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h: In static member function 'static int std::char_traits<wchar_t>::compare(const wchar_t*, const wchar_t*, size_t)':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:328: error: 'wmemcmp' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h: In static member function 'static size_t std::char_traits<wchar_t>::length(const wchar_t*)':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:332: error: 'wcslen' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h: In static member function 'static const wchar_t* std::char_traits<wchar_t>::find(const wchar_t*, size_t, const wchar_t&)':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:336: error: conversión inválida de 'const wchar_t*' a 'wchar_t*'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:336: error: argumento de inicialización 1 de 'wchar_t* std::wmemchr(wchar_t*, wchar_t, size_t)'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h: In static member function 'static wchar_t* std::char_traits<wchar_t>::move(wchar_t*, const wchar_t*, size_t)':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:340: error: 'wmemmove' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h: In static member function 'static wchar_t* std::char_traits<wchar_t>::copy(wchar_t*, const wchar_t*, size_t)':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:344: error: 'wmemcpy' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h: In static member function 'static wchar_t* std::char_traits<wchar_t>::assign(wchar_t*, size_t, wchar_t)':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:348: error: 'wmemset' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h: In static member function 'static wchar_t std::char_traits<wchar_t>::to_char_type(int)':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:351: error: '__c' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h: In static member function 'static bool std::char_traits<wchar_t>::eq_int_type(int)':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:358: error: '__c1' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/char_traits.h:358: error: '__c2' no se declaró en este ámbito
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/c++locale.h:47,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/localefwd.h:47,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:47,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/clocale: At global scope:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/clocale:59: error: '::lconv' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/clocale:60: error: '::setlocale' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/clocale:61: error: '::localeconv' no se ha declarado
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/localefwd.h:47,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:47,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/c++locale.h:57: error: 'uselocale' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/c++locale.h:57: error: invalid type in declaration before ';' token
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/c++locale.h:64: error: '__locale_t' no nombra a un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/c++locale.h:71: error: expected ',' or '...' before '&' token
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/c++locale.h: In function 'int std::__convert_from_v(int)':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/c++locale.h:77: error: expected `;' before '__old'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/c++locale.h:91: error: '__fmt' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/c++locale.h:94: error: '__out' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/c++locale.h:94: error: '__size' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/c++locale.h:102: error: '__old' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/c++locale.h:102: error: no se puede usar '__gnu_cxx::__uselocale' como una función
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/localefwd.h:49,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:47,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cctype: At global scope:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cctype:71: error: '::isalnum' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cctype:72: error: '::isalpha' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cctype:73: error: '::iscntrl' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cctype:74: error: '::isdigit' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cctype:75: error: '::isgraph' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cctype:76: error: '::islower' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cctype:77: error: '::isprint' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cctype:78: error: '::ispunct' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cctype:79: error: '::isspace' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cctype:80: error: '::isupper' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cctype:81: error: '::isxdigit' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cctype:82: error: '::tolower' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cctype:83: error: '::toupper' no se ha declarado
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:47,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/localefwd.h:132: error: 'mbstate_t' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/localefwd.h:132: error: el argumento de plantilla 3 es inválido
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/localefwd.h:134: error: 'mbstate_t' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/localefwd.h:134: error: el argumento de plantilla 3 es inválido
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/ios_base.h:48,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:48,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_classes.h:349: error: '__c_locale' no nombra a un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_classes.h:380: error: '__c_locale' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_classes.h:381: error: '__c_locale' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_classes.h:383: error: '__c_locale' no nombra a un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_classes.h:387: error: '__c_locale' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_classes.h:391: error: '__c_locale' no nombra a un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_classes.h:622: error: '__c_locale' no nombra a un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_classes.h:650: error: expected `)' before '__cloc'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_classes.h: In constructor 'std::collate<_CharT>::collate(size_t)':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_classes.h:637: error: la clase 'std::collate<_CharT>' no tiene ningún campo llamado '_M_c_locale_collate'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_classes.h:637: error: no hay argumentos para '_S_get_c_locale' que dependan de un parámetro de plantilla, por lo cual una declaración de '_S_get_c_locale' debe estar disponible
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_classes.h:637: error: (si utiliza '-fpermissive', G++ aceptará su código, pero permitir el uso de un nombre sin declarar es obsoleto)
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_classes.h: In destructor 'virtual std::collate<_CharT>::~collate()':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_classes.h:714: error: '_M_c_locale_collate' no se declaró en este ámbito
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/streambuf:801,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:49,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/streambuf: At global scope:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/streambuf: In instantiation of 'std::basic_streambuf<wchar_t, std::char_traits<wchar_t> >':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/streambuf.tcc:165: instantiated from here
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/streambuf:130: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/streambuf:280: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/streambuf:298: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/streambuf:320: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/streambuf:353: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/streambuf:378: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/streambuf:405: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/streambuf:668: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/streambuf:681: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/streambuf:705: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/streambuf:748: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:46,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/basic_ios.h:44,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:50,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:83: error: '::wctrans_t' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:84: error: '::wctype_t' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:85: error: '::wint_t' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:87: error: '::iswalnum' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:88: error: '::iswalpha' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:90: error: '::iswblank' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:92: error: '::iswcntrl' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:93: error: '::iswctype' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:94: error: '::iswdigit' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:95: error: '::iswgraph' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:96: error: '::iswlower' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:97: error: '::iswprint' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:98: error: '::iswpunct' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:99: error: '::iswspace' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:100: error: '::iswupper' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:101: error: '::iswxdigit' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:102: error: '::towctrans' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:103: error: '::towlower' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:104: error: '::towupper' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:105: error: '::wctrans' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/cwctype:106: error: '::wctype' no se ha declarado
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:48,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/basic_ios.h:44,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:50,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/ctype_base.h:53: error: '_ISupper' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/ctype_base.h:54: error: '_ISlower' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/ctype_base.h:55: error: '_ISalpha' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/ctype_base.h:56: error: '_ISdigit' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/ctype_base.h:57: error: '_ISxdigit' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/ctype_base.h:58: error: '_ISspace' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/ctype_base.h:59: error: '_ISprint' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/ctype_base.h:60: error: '_ISalpha' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/ctype_base.h:60: error: '_ISdigit' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/ctype_base.h:60: error: '_ISpunct' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/ctype_base.h:61: error: '_IScntrl' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/ctype_base.h:62: error: '_ISpunct' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/ctype_base.h:63: error: '_ISalpha' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/x86_64-unknown-linux-gnu/bits/ctype_base.h:63: error: '_ISdigit' no se declaró en este ámbito
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/basic_ios.h:44,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:50,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:72: error: expected ',' or '...' before '&' token
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:78: error: expected ',' or '...' before '&' token
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:83: error: expected ',' or '...' before '&' token
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:88: error: expected ',' or '...' before '&' token
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:689: error: '__c_locale' no nombra a un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:730: error: expected `)' before '__cloc'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:1226: error: 'wctype_t' no nombra a un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:1229: error: '__c_locale' no nombra a un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:1234: error: 'wint_t' no nombra a un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:1238: error: '__wmask_type' no nombra a un tipo
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:1264: error: expected `)' before '__cloc'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:1267: error: '__wmask_type' no nombra a un tipo
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/basic_ios.h:44,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:50,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:1736: error: expected `)' before '__cloc'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:1893: error: '__c_locale' no se ha declarado
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:1904: error: se declaró la variable o campo '_M_initialize_numpunct' como void
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:1904: error: '__c_locale' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:1912: error: se declaró la variable o campo '_M_initialize_numpunct' como void
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:1912: error: '__c_locale' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h: In constructor 'std::numpunct_byname<_CharT>::numpunct_byname(const char*, size_t)':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:1930: error: '__c_locale' no se declaró en este ámbito
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:1930: error: expected `;' before '__tmp'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:1931: error: '__tmp' no se declaró en este ámbito
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.h:2635,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/basic_ios.h:44,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:50,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.tcc: In member function 'virtual _InIter std::num_get<_CharT, _InIter>::do_get(_InIter, _InIter, std::ios_base&, std::_Ios_Iostate&, float&) const':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.tcc:685: error: no hay argumentos para '_S_get_c_locale' que dependan de un parámetro de plantilla, por lo cual una declaración de '_S_get_c_locale' debe estar disponible
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.tcc: In member function 'virtual _InIter std::num_get<_CharT, _InIter>::do_get(_InIter, _InIter, std::ios_base&, std::_Ios_Iostate&, double&) const':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.tcc:698: error: no hay argumentos para '_S_get_c_locale' que dependan de un parámetro de plantilla, por lo cual una declaración de '_S_get_c_locale' debe estar disponible
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.tcc: In member function 'virtual _InIter std::num_get<_CharT, _InIter>::do_get(_InIter, _InIter, std::ios_base&, std::_Ios_Iostate&, long double&) const':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.tcc:726: error: no hay argumentos para '_S_get_c_locale' que dependan de un parámetro de plantilla, por lo cual una declaración de '_S_get_c_locale' debe estar disponible
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.tcc: In member function '_OutIter std::num_put<_CharT, _OutIter>::_M_insert_float(_OutIter, std::ios_base&, _CharT, char, _ValueT) const':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.tcc:981: error: no hay argumentos para '_S_get_c_locale' que dependan de un parámetro de plantilla, por lo cual una declaración de '_S_get_c_locale' debe estar disponible
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets.tcc:989: error: no hay argumentos para '_S_get_c_locale' que dependan de un parámetro de plantilla, por lo cual una declaración de '_S_get_c_locale' debe estar disponible
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/basic_ios.h:475,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ios:50,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:45,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/basic_ios.h: At global scope:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/basic_ios.h: In instantiation of 'std::basic_ios<wchar_t, std::char_traits<wchar_t> >':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/basic_ios.tcc:186: instantiated from here
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/basic_ios.h:76: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:572,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:45,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream: In instantiation of 'std::basic_ostream<wchar_t, std::char_traits<wchar_t> >':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/ostream.tcc:388: instantiated from here
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/ostream:64: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:46,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/istream: In instantiation of 'std::basic_istream<wchar_t, std::char_traits<wchar_t> >':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/istream:613: instantiated from here
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/istream:64: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/istream:284: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/istream:439: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/istream:450: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/istream:836,
    from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/iostream:46,
    from ECTag.h:28,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/istream: In instantiation of 'std::basic_istream<wchar_t, std::char_traits<wchar_t> >::sentry':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/istream.tcc:1002: instantiated from here
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/istream:647: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/istream: In instantiation of 'std::basic_iostream<wchar_t, std::char_traits<wchar_t> >':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/istream.tcc:1021: instantiated from here
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/istream:778: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/sstream:572,
    from ECTag.h:29,
    from ECTag.cpp:25:
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/sstream: In instantiation of 'std::basic_stringbuf<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/sstream.tcc:269: instantiated from here
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/sstream:71: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/sstream: In instantiation of 'std::basic_istringstream<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/sstream.tcc:270: instantiated from here
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/sstream:266: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/sstream: In instantiation of 'std::basic_ostringstream<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/sstream.tcc:271: instantiated from here
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/sstream:375: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/sstream: In instantiation of 'std::basic_stringstream<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >':
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/sstream.tcc:272: instantiated from here
    /usr/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/sstream:484: error: no type named 'int_type' in 'struct std::char_traits<wchar_t>'
    In file included from ECTag.h:42,
    from ECTag.cpp:25:
    ../../../MD4Hash.h: In member function 'bool CMD4Hash::Decode(const std::string&)':
    ../../../MD4Hash.h:180: error: 'toupper' no se declaró en este ámbito
    make[7]: *** [libec_a-ECTag.o] Error 1
    make[7]: se sale del directorio `/home/alberto/aur/amule-cvs/src/amule-cvs/src/libs/ec/cpp'
    make[6]: *** [all] Error 2
    make[6]: se sale del directorio `/home/alberto/aur/amule-cvs/src/amule-cvs/src/libs/ec/cpp'
    make[5]: *** [all-recursive] Error 1
    make[5]: se sale del directorio `/home/alberto/aur/amule-cvs/src/amule-cvs/src/libs/ec'
    make[4]: *** [all] Error 2
    make[4]: se sale del directorio `/home/alberto/aur/amule-cvs/src/amule-cvs/src/libs/ec'
    make[3]: *** [all-recursive] Error 1
    make[3]: se sale del directorio `/home/alberto/aur/amule-cvs/src/amule-cvs/src/libs'
    make[2]: *** [all-recursive] Error 1
    make[2]: se sale del directorio `/home/alberto/aur/amule-cvs/src/amule-cvs/src'
    make[1]: *** [all-recursive] Error 1
    make[1]: se sale del directorio `/home/alberto/aur/amule-cvs/src/amule-cvs'
    make: *** [all] Error 2
    ==> ERROR: Fallo build()
    Abortando...
    Last edited by ADRez (2008-03-23 16:03:34)

    The problem was I was using testing repo, so I had gcc 4.3 which is not compatible with amule. See more here: http://forum.amule.org/index.php?topic=14360.0
    I've solved it downgrading package gcc to core/gcc, building amule and upgrading gcc

  • C programming problem

    using gcc 4.5.0-6
    checking.c
    #include <stdio.h>
    #include <stdbool.h>
    //validate that input is an integer
    int get_int(void);
    //vlaidate that range limits are validate
    bool bad_limits(int begin, int end, int low, int high);
    //calculate the sum of the squares of the integers
    //a through b
    double sum_squares(int a, int b);
    int main(void)
    const int MIN = -1000;
    const int MAX = +1000;
    int start;
    int stop;
    double answer;
    printf("This program computes the sum of the squares of ");
    printf("integers in a range.\nThe lower bound should not be ");
    printf("less than -1000 and\nthe upper bound should not be ");
    printf("more than +1000.\n");
    printf("Enter the limits (enter 0 for both limits to quit):\n");
    printf("lower limit: ");
    start = get_int();
    printf("upper limit: ");
    stop = get_int();
    while(start != 0 || stop != 0)
    if(bad_limits(start, stop, MIN, MAX))
    printf("Please try again.\n");
    else
    answer = sum_squares(start, stop); //// FOR SUM REASON answer EQUALS 0 NOT MATTER WHAT. errrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
    // printf("\nanswer = %d\n", answer);
    printf("The sum of the squares of the integers from ");
    printf("%d to %d is %d\n", start, stop, answer);
    printf("Enter the limits (enter 0 for both limits to quit):\n");
    printf("lower limit: ");
    start = get_int();
    printf("upper limit: ");
    stop = get_int();
    printf("Done.\n");
    return 0;
    int get_int(void)
    int input;
    char ch;
    while(scanf("%d", &input) != 1)
    while((ch = getchar()) != '\n')
    putchar(ch); //dispose of bad input
    printf(" is not an integer.\nPlease enter an ");
    printf("integer value, such as 25, -178, or 3: ");
    return input;
    double sum_squares(int a, int b)
    double total = 0;
    int i;
    for(i = a; i <= b; i++)
    total += (i * i);
    // printf("\ni = %d total = %f\n", i, total);
    // printf("\nreturning total = %f\n", total);
    return total;
    bool bad_limits(int begin, int end, int low, int high)
    bool not_good = false;
    if(begin > end)
    printf("%s isn't smaller than %d.\n", begin, end);
    not_good = true;
    if(begin < low || end < low)
    printf("Values must be %d or greater.\n", low);
    not_good = true;
    if(begin > high || end > high)
    printf("Values must be %d or less.\n", high);
    not_good = true;
    return not_good;
    the problem is this
    answer = sum_squares(start, stop); //// FOR SUM REASON (answer) EQUALS 0 NOT MATTER WHAT. errrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
    what's wrong in this function ???
    double sum_squares(int a, int b)
    double total = 0;
    int i;
    for(i = a; i <= b; i++)
    total += (i * i);
    printf("\ni = %d total = %f\n", i, total);
    //printf("\nreturning total = %f\n", total);
    return total;
    Last edited by grimx (2010-08-06 04:41:08)

    grimx wrote: total += (i * i);
    I believe this will interpret the result of (i * i) as a double.  This is not what you want, I imagine.  Try making total an int, long or long long and returning that.
    Last edited by saline (2010-08-06 04:51:18)

  • Problem with _mm_loadl_epi64

    Hi,
    I'm using the mmloadl_epi64 intrinsic to get a movq instruction however it gives different results when compiled Debug or Performance. I Performance mode it seems OK however Debug generates incorrect leaq instruction.
    Expected output is:
    loadl_epi64 b2b2b2b2b2b2b2b2 0
    loadl_epi64 b1b1b1b1b1b1b1b1 0
    loadl_epi64 b1b1b1b1b2b2b2b2 0
    In Debug I get:
    loadl_epi64 7fff6fc7f640 0
    loadl_epi64 7fff6fc7f648 0
    loadl_epi64 7fff6fc7f644 0
    Any help appreciated.
    Thanks, Colin
    Here's the code.
    #include <stdlib.h>
    #include <stdio.h>
    #include <sunmedia_intrin.h>
    void extract(__m64 *b1) {
    union {
    __m128i ll;
    unsigned long l[2];
    } p1, p2;
    p1.ll = mmloadl_epi64((__m128i *)b1);
    printf("loadl_epi64 %8lx %8lx\n", (unsigned long) p1.l[0], p1.l[1]);
    int main(int argc, char** argv) {
    union {
    __m128i b;
    __m64 b8[2];
    char bt[16];
    } s;
    __m128i b1 = {0xb2b2b2b2b2b2b2b2, 0xb1b1b1b1b1b1b1b1};
    s.b = b1;
    extract(s.b8);
    extract(s.b8 + 1);
    extract((__m64 *) (s.bt + 4));
    getchar();
    return (EXIT_SUCCESS);
    Edited by: colinhercus on Apr 14, 2008 7:54 AM
    Edited by: colinhercus on Apr 14, 2008 8:02 AM
    I'm using Sun Studio 12 with patch 126997-04
    Edited by: colinhercus on Apr 14, 2008 8:31 AM
    After posting this I found patch 126997-05 and it has cured the problem.
    Edited by: colinhercus on Apr 14, 2008 8:53 AM
    I'm confusing myself now. The problem described still exists in 126997-05. The problem goes away if the intrinsic is placed in main rather than in a subroutine.

    Check if 'free goods' check box is ticked.

  • Problem calling a Java Method from C++

    hi everyone,
    i'm using JNI and i'm trying to call a Java method from C++, this is the code:
    SocketC.java
    public class SocketC
    private native void conectaServidor();
    private void recibeBuffer()
    System.out.println("HELLO!!!");
    public static void main(String args[])
    SocketC SC = new SocketC();
    SC.conectaServidor();
    static {
    System.loadLibrary("Server_TCP");
    Server_TCP.cpp
    char* recibirSock()
         int _flag = 1;
         while(_flag != 0)
              memset(buffer,0,sizeof(buffer));//Et la, celle pour recevoir
              recv(sock,buffer,sizeof(buffer),0);
              printf(" Mensaje del cliente: %s\n",buffer);
              _flag = strcmp(buffer,"salir");
         }//fin while
         return buffer;
    void enviarSock()
         int _flag = 1;
         getchar();
         while(_flag != 0)
              memset(buffer,0,sizeof(buffer));//procedimiento para enviar
              printf("\n Escriba: ");
              gets(buffer);
         //     err=scanf("%s",buffer);
              send(sock,buffer,sizeof(buffer),0);
              _flag = strcmp(buffer,"salir");
         }//fin while
    }//fin enviarSock
    DWORD servicio(LPVOID lpvoid)//
         char *buf;
         printf("\n Cliente aceptado!!!!!\n");
         buf=recibirSock();
         return 0;
    JNIEXPORT void JNICALL Java_SocketC_conectaServidor(JNIEnv *env, jobject obj)
    //void main()
    /*this is the problem i'm calling the method recibeBuffer*/
         jclass cls = env->GetObjectClass(obj);
         jmethodID mmid = env->GetMethodID(cls, "recibeBuffer", "(V)V");
         if (mmid == 0)
              return;
         env->CallVoidMethod(obj, mmid); //llama a Java
         WSAStartup(MAKEWORD(2,0),&wsa);//MAKEWORD dit qu'on utilise la version 2 de winsock
         printf("TCP conexion Sockets\n\n");
         //estimez vous heureux que je foute pas de copyright ;)
         system("TITLE TCP Conexion Sockets (Version server)");
         //fo avouer que c'est plus joli
         int port;
         printf("Port : ");//On demande juste le port, pas besoin d'ip on est sur un server
         scanf("%i",&port);
         sinserv.sin_family=AF_INET;     //Je ne connais pas d'autres familles
         sinserv.sin_addr.s_addr=INADDR_ANY;//Pas besoin d'ip pour le server
         sinserv.sin_port=htons(port);
         server=socket(AF_INET,SOCK_STREAM,0);//On construit le server
         //SOCK_STREAM pour le TCP
         bind(server,(SOCKADDR*)&sinserv,sizeof(sinserv));
         //On lie les parametres du socket avec le socket lui meme
         listen(server,SOMAXCONN);//On se met � �couter avec server, 0 pour n'accepter qu'une seule connection
         printf(" Servidor conectado.");
         while(1)
              sinsize=sizeof(sin);
              if((sock=accept(server,(SOCKADDR*)&sin,&sinsize))!=INVALID_SOCKET)
              {//accept : acepta cualquier conexion
                   if (hReadThread = CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE)
                   servicio, 0, 0, &dwThreadID))
                        printf("\nHOLA!");
                        GetExitCodeThread(hReadThread,&dwExitCode);
                        CloseHandle (hReadThread);
                   else
                        // Could not create the read thread.
                        printf("No se pudo crear");
                        exit(0);
    when i'm running the proyect i get this error:
    C:\POT Files\UCAB\tesis\esmart\french>java SocketC
    Exception in thread "main" java.lang.NoSuchMethodError: recibeBuffer
    at SocketC.conectaServidor(Native Method)
    at SocketC.main(SocketC.java:16)
    i don't know why this is happening i got declare the method recibeBuffer in my SocketC.java class, but doesn;t work can anyone help me?
    PD: sorry for my bad english i'm from Venezuela

    Next time please paste your code between &#91;code&#93; tags with the code button just above the edit message area.
    To answer your question, you wrote the wrong method signature. It should be:jmethodID mmid = env->GetMethodID(cls, "recibeBuffer", "()V");Regards

  • Problems reading from / writing to files in C on XCode 3

    Hi all,
    I'm a newcomer to C, having been learning for about a week and a half. All going well so far.
    I'm working through Dave Mark's 'Learn C on the Macintosh' e-book, and am up to Chapter 10, 'Working with Files.' Herein lies the problem.
    I can't get any of the file-related commands to work. The most basic, it seems, is 'fopen()'. There's a very simple demo program which is supposed to open an accompanying file ("My Data File.txt") which is in there with main.c and so on. Nothing happens, though. I've tried it with a 'w' mode parameter which should create the file if it doesn't already exist, but Spotlight can't find it if it is indeed being made.
    I'm using a fairly vanilla install of XCode 3, so I shouldn't have messed up the settings anywhere along the way. I've tried all of the different path types in the 'Get Info' dialogs, but still nothing.
    I guess that it's something very basic that I've missed or not understood. If any of you could take the time to help me out, it'd be much appreciated.
    If there's any further information you need, please just let me know.
    Many thanks,
    Pete.

    Ok I'm new to c programming and xcode and I have this same problem but the suggestions have not remedied my problem. I get this warning:
    "warning: no rule to process file '$(PROJECT_DIR)/operations.txt' of type text for architecture i386"
    This is my code
    #include <stdio.h>
    #include <math.h>
    int main()
    char filename[128],fvalue1[128];
    int x=0;
    FILE *input;
    printf("Enter name of file: ");
    fgets(filename,128,stdin);
    if((input = fopen(filename,"r"))==NULL)
    printf("Failed to open file.\n");
    x=1;
    if(x!=1)
    fgets(fvalue1,128,input);
    fclose(input);
    fflush(stdin);
    printf("\n\nPress enter to continue...");
    getchar();
    return(0);
    I think its a setting but I dont know what else to try.
    Any further input on this would be greatly appreciated. thanx

  • A problem with threads

    I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
    Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
    My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
    Thank you in advance,
    Lefty

    This was one solution from the socket programming forum, have you tried this??
    public Thread MyThread extends Thread{
         boolean active = true;          
         public void run(){
              ss.setSoTimeout(90);               
              while (active){                   
                   try{                       
                        serverSocket = ss.accept();
                   catch (SocketTimeoutException ste){
                   // do nothing                   
         // interrupt thread           
         public void deactivate(){               
              active = false;
              // you gotta sleep for a time longer than the               
              // accept() timeout to make sure that timeout is finished.               
              try{
                   sleep(91);               
              }catch (InterruptedException ie){            
              interrupt();
    }

Maybe you are looking for