Loading ...
Sorry, an error occurred while loading the content.

ClearSilver installing failed?

Expand Messages
  • Jacky Wang
    Hi there, I know that it may be a dumb question, but ClearSilver installing doesn t work for me. :( It will be great if somebody here can help me out. Assuming
    Message 1 of 9 , Aug 30, 2011
    View Source
    • 0 Attachment
      Hi there,

      I know that it may be a dumb question, but ClearSilver installing doesn't work for me. :(

      It will be great if somebody here can help me out.

      Assuming that the latest version is 0.10.5 (from http://www.clearsilver.net/downloads/), I did the conventional steps "./configure && make && sudo make install". However it throws error msg as the following:

      Running cs regression tests
      Failed Regression Test: test_crc.cs
      See test_crc.cs.out and test_crc.cs.err

      Does anyone happen to know how to solve it?

      And therefore I skipped the error msg and copied the cs/cs.h and libneo_cs.a to the corresponding directories (/usr/local/*), but still seeing the following errors when compiling the code:

      $ gcc -I /usr/local/include/ClearSilver -L /usr/local/include hello.c
      /tmp/ccxRdPgS.o: In function `main':
      hello.c:(.text+0x3d): undefined reference to `hdf_init'
      hello.c:(.text+0x53): undefined reference to `hdf_set_value'
      hello.c:(.text+0x5f): undefined reference to `hdf_init'
      hello.c:(.text+0x75): undefined reference to `hdf_set_value'
      hello.c:(.text+0x88): undefined reference to `cs_init'
      hello.c:(.text+0x9e): undefined reference to `cs_parse_string'
      hello.c:(.text+0xc7): undefined reference to `cs_render'
      hello.c:(.text+0xdd): undefined reference to `hdf_set_value'
      hello.c:(.text+0xfe): undefined reference to `cs_render'
      hello.c:(.text+0x10f): undefined reference to `cs_destory'
      hello.c:(.text+0x120): undefined reference to `hdf_destory'
      hello.c:(.text+0x131): undefined reference to `hdf_destory'
      collect2: ld returned 1 exit status

      The hello.c is as following:
      #include <stdio.h>
      #include "ClearSilver/ClearSilver.h"

      NEOERR* callback(void *ctx, char *output) {
      printf("%s\n", output);
      }

      int main(int argc, char* argv[]) {
      CSPARSE *tmpl = NULL; // CS template
      HDF *hdf1, *hdf2; // HDF

      // setup HDF
      hdf_init(&hdf1);
      hdf_set_value(hdf1, "name", "Jacky");
      hdf_init(&hdf2);
      hdf_set_value(hdf2, "name", "Alpha");

      // parse cs template
      cs_init(&tmpl, hdf1);
      cs_parse_string(tmpl, "Hello, <?cs var:name ?>", 24);

      // register rendering callback
      CSOUTFUNC cb = &callback;

      // render cs with hdf2
      tmpl->hdf = hdf2;
      cs_render(tmpl, NULL, cb);

      // render cs with modified hdf1
      hdf_set_value(hdf1, "name", "Sally");
      tmpl->hdf = hdf1;
      cs_render(tmpl, NULL, cb);

      // destroy cs template
      cs_destory(&tmpl);
      hdf_destory(&hdf1);
      hdf_destory(&hdf2);

      printf("hello\n");
      }

      Any ideas?

      Thanks in advance.

      Best,
      Jacky
    • 马亮
      what is in the test_crc.cs.out and test_crc.cs.err ? At 2011-08-30 18:28:52, Jacky Wang wrote: Hi there, I know that it may be a
      Message 2 of 9 , Aug 30, 2011
      View Source
      • 0 Attachment

        what is in the test_crc.cs.out and test_crc.cs.err ?

        At 2011-08-30 18:28:52,"Jacky Wang" <jacky.chao.wang@...> wrote:
         

        Hi there,

        I know that it may be a dumb question, but ClearSilver installing doesn't work for me. :(

        It will be great if somebody here can help me out.

        Assuming that the latest version is 0.10.5 (from http://www.clearsilver.net/downloads/), I did the conventional steps "./configure && make && sudo make install". However it throws error msg as the following:

        Running cs regression tests
        Failed Regression Test: test_crc.cs
        See test_crc.cs.out and test_crc.cs.err

        Does anyone happen to know how to solve it?

        And therefore I skipped the error msg and copied the cs/cs.h and libneo_cs.a to the corresponding directories (/usr/local/*), but still seeing the following errors when compiling the code:

        $ gcc -I /usr/local/include/ClearSilver -L /usr/local/include hello.c
        /tmp/ccxRdPgS.o: In function `main':
        hello.c:(.text+0x3d): undefined reference to `hdf_init'
        hello.c:(.text+0x53): undefined reference to `hdf_set_value'
        hello.c:(.text+0x5f): undefined reference to `hdf_init'
        hello.c:(.text+0x75): undefined reference to `hdf_set_value'
        hello.c:(.text+0x88): undefined reference to `cs_init'
        hello.c:(.text+0x9e): undefined reference to `cs_parse_string'
        hello.c:(.text+0xc7): undefined reference to `cs_render'
        hello.c:(.text+0xdd): undefined reference to `hdf_set_value'
        hello.c:(.text+0xfe): undefined reference to `cs_render'
        hello.c:(.text+0x10f): undefined reference to `cs_destory'
        hello.c:(.text+0x120): undefined reference to `hdf_destory'
        hello.c:(.text+0x131): undefined reference to `hdf_destory'
        collect2: ld returned 1 exit status

        The hello.c is as following:
        #include <stdio.h>
        #include "ClearSilver/ClearSilver.h"

        NEOERR* callback(void *ctx, char *output) {
        printf("%s\n", output);
        }

        int main(int argc, char* argv[]) {
        CSPARSE *tmpl = NULL; // CS template
        HDF *hdf1, *hdf2; // HDF

        // setup HDF
        hdf_init(&hdf1);
        hdf_set_value(hdf1, "name", "Jacky");
        hdf_init(&hdf2);
        hdf_set_value(hdf2, "name", "Alpha");

        // parse cs template
        cs_init(&tmpl, hdf1);
        cs_parse_string(tmpl, "Hello, <?cs var:name ?>", 24);

        // register rendering callback
        CSOUTFUNC cb = &callback;

        // render cs with hdf2
        tmpl->hdf = hdf2;
        cs_render(tmpl, NULL, cb);

        // render cs with modified hdf1
        hdf_set_value(hdf1, "name", "Sally");
        tmpl->hdf = hdf1;
        cs_render(tmpl, NULL, cb);

        // destroy cs template
        cs_destory(&tmpl);
        hdf_destory(&hdf1);
        hdf_destory(&hdf2);

        printf("hello\n");
        }

        Any ideas?

        Thanks in advance.

        Best,
        Jacky



      • Jacky Wang
        $ cat test_crc.cs.err 4c4
        Message 3 of 9 , Aug 31, 2011
        View Source
        • 0 Attachment
          $ cat test_crc.cs.err
          4c4
          < -2128917020
          ---
          > 2166050276
          $ cat test_crc.cs.out
          Parsing test_crc.cs
          419156592
          1357503972
          2166050276

          Thanks,
          J

          On Tue, Aug 30, 2011 at 7:07 PM, 马亮 <bigmaliang@...> wrote:

          what is in the test_crc.cs.out and test_crc.cs.err ?


          At 2011-08-30 18:28:52,"Jacky Wang" <jacky.chao.wang@...> wrote:
           

          Hi there,

          I know that it may be a dumb question, but ClearSilver installing doesn't work for me. :(

          It will be great if somebody here can help me out.

          Assuming that the latest version is 0.10.5 (from http://www.clearsilver.net/downloads/), I did the conventional steps "./configure && make && sudo make install". However it throws error msg as the following:

          Running cs regression tests
          Failed Regression Test: test_crc.cs
          See test_crc.cs.out and test_crc.cs.err

          Does anyone happen to know how to solve it?

          And therefore I skipped the error msg and copied the cs/cs.h and libneo_cs.a to the corresponding directories (/usr/local/*), but still seeing the following errors when compiling the code:

          $ gcc -I /usr/local/include/ClearSilver -L /usr/local/include hello.c
          /tmp/ccxRdPgS.o: In function `main':
          hello.c:(.text+0x3d): undefined reference to `hdf_init'
          hello.c:(.text+0x53): undefined reference to `hdf_set_value'
          hello.c:(.text+0x5f): undefined reference to `hdf_init'
          hello.c:(.text+0x75): undefined reference to `hdf_set_value'
          hello.c:(.text+0x88): undefined reference to `cs_init'
          hello.c:(.text+0x9e): undefined reference to `cs_parse_string'
          hello.c:(.text+0xc7): undefined reference to `cs_render'
          hello.c:(.text+0xdd): undefined reference to `hdf_set_value'
          hello.c:(.text+0xfe): undefined reference to `cs_render'
          hello.c:(.text+0x10f): undefined reference to `cs_destory'
          hello.c:(.text+0x120): undefined reference to `hdf_destory'
          hello.c:(.text+0x131): undefined reference to `hdf_destory'
          collect2: ld returned 1 exit status

          The hello.c is as following:
          #include <stdio.h>
          #include "ClearSilver/ClearSilver.h"

          NEOERR* callback(void *ctx, char *output) {
          printf("%s\n", output);
          }

          int main(int argc, char* argv[]) {
          CSPARSE *tmpl = NULL; // CS template
          HDF *hdf1, *hdf2; // HDF

          // setup HDF
          hdf_init(&hdf1);
          hdf_set_value(hdf1, "name", "Jacky");
          hdf_init(&hdf2);
          hdf_set_value(hdf2, "name", "Alpha");

          // parse cs template
          cs_init(&tmpl, hdf1);
          cs_parse_string(tmpl, "Hello, <?cs var:name ?>", 24);

          // register rendering callback
          CSOUTFUNC cb = &callback;

          // render cs with hdf2
          tmpl->hdf = hdf2;
          cs_render(tmpl, NULL, cb);

          // render cs with modified hdf1
          hdf_set_value(hdf1, "name", "Sally");
          tmpl->hdf = hdf1;
          cs_render(tmpl, NULL, cb);

          // destroy cs template
          cs_destory(&tmpl);
          hdf_destory(&hdf1);
          hdf_destory(&hdf2);

          printf("hello\n");
          }

          Any ideas?

          Thanks in advance.

          Best,
          Jacky




        • 马亮
          sorry for my mistake, seems your compile command is not correct. first, you should copy libneo_cgi.a libneo_cs.a libneo_utl.a into /usr/local/lib then, you
          Message 4 of 9 , Aug 31, 2011
          View Source
          • 0 Attachment
            sorry for my mistake, seems your compile command is not correct.

            first, you should copy libneo_cgi.a libneo_cs.a libneo_utl.a into /usr/local/lib
            then, you need to change compile command into
            $ gcc -I /usr/local/include/ClearSilver -L /usr/local/lib  -lneo_cgi -lneo_cs -lneo_utl  hello.c 

            Suggest you use the svn version code, which you need to pay some attention on build streamparser library first.



            At 2011-08-31 10:07:01,"马亮" <bigmaliang@...> wrote:
             


            what is in the test_crc.cs.out and test_crc.cs.err ?

            At 2011-08-30 18:28:52,"Jacky Wang" <jacky.chao.wang@...> wrote:
             

            Hi there,

            I know that it may be a dumb question, but ClearSilver installing doesn't work for me. :(

            It will be great if somebody here can help me out.

            Assuming that the latest version is 0.10.5 (from http://www.clearsilver.net/downloads/), I did the conventional steps "./configure && make && sudo make install". However it throws error msg as the following:

            Running cs regression tests
            Failed Regression Test: test_crc.cs
            See test_crc.cs.out and test_crc.cs.err

            Does anyone happen to know how to solve it?

            And therefore I skipped the error msg and copied the cs/cs.h and libneo_cs.a to the corresponding directories (/usr/local/*), but still seeing the following errors when compiling the code:

            $ gcc -I /usr/local/include/ClearSilver -L /usr/local/include hello.c
            /tmp/ccxRdPgS.o: In function `main':
            hello.c:(.text+0x3d): undefined reference to `hdf_init'
            hello.c:(.text+0x53): undefined reference to `hdf_set_value'
            hello.c:(.text+0x5f): undefined reference to `hdf_init'
            hello.c:(.text+0x75): undefined reference to `hdf_set_value'
            hello.c:(.text+0x88): undefined reference to `cs_init'
            hello.c:(.text+0x9e): undefined reference to `cs_parse_string'
            hello.c:(.text+0xc7): undefined reference to `cs_render'
            hello.c:(.text+0xdd): undefined reference to `hdf_set_value'
            hello.c:(.text+0xfe): undefined reference to `cs_render'
            hello.c:(.text+0x10f): undefined reference to `cs_destory'
            hello.c:(.text+0x120): undefined reference to `hdf_destory'
            hello.c:(.text+0x131): undefined reference to `hdf_destory'
            collect2: ld returned 1 exit status

            The hello.c is as following:
            #include <stdio.h>
            #include "ClearSilver/ClearSilver.h"

            NEOERR* callback(void *ctx, char *output) {
            printf("%s\n", output);
            }

            int main(int argc, char* argv[]) {
            CSPARSE *tmpl = NULL; // CS template
            HDF *hdf1, *hdf2; // HDF

            // setup HDF
            hdf_init(&hdf1);
            hdf_set_value(hdf1, "name", "Jacky");
            hdf_init(&hdf2);
            hdf_set_value(hdf2, "name", "Alpha");

            // parse cs template
            cs_init(&tmpl, hdf1);
            cs_parse_string(tmpl, "Hello, <?cs var:name ?>", 24);

            // register rendering callback
            CSOUTFUNC cb = &callback;

            // render cs with hdf2
            tmpl->hdf = hdf2;
            cs_render(tmpl, NULL, cb);

            // render cs with modified hdf1
            hdf_set_value(hdf1, "name", "Sally");
            tmpl->hdf = hdf1;
            cs_render(tmpl, NULL, cb);

            // destroy cs template
            cs_destory(&tmpl);
            hdf_destory(&hdf1);
            hdf_destory(&hdf2);

            printf("hello\n");
            }

            Any ideas?

            Thanks in advance.

            Best,
            Jacky





          • Jacky Wang
            Thanks for the reply! - I successfully compiled the file with your command yet it gave me a segmentation fault in the runtime. - how to build streamparser
            Message 5 of 9 , Aug 31, 2011
            View Source
            • 0 Attachment
              Thanks for the reply!

              - I successfully compiled the file with your command yet it gave me a segmentation fault in the runtime.
              - how to build streamparser using the svn version?  I got a build error.

              Best,
              J

              2011/8/31 马亮 <bigmaliang@...>
              sorry for my mistake, seems your compile command is not correct.

              first, you should copy libneo_cgi.a libneo_cs.a libneo_utl.a into /usr/local/lib
              then, you need to change compile command into
              $ gcc -I /usr/local/include/ClearSilver -L /usr/local/lib  -lneo_cgi -lneo_cs -lneo_utl  hello.c 

              Suggest you use the svn version code, which you need to pay some attention on build streamparser library first.




              At 2011-08-31 10:07:01,"马亮" <bigmaliang@...> wrote:
               


              what is in the test_crc.cs.out and test_crc.cs.err ?

              At 2011-08-30 18:28:52,"Jacky Wang" <jacky.chao.wang@...> wrote:
               

              Hi there,

              I know that it may be a dumb question, but ClearSilver installing doesn't work for me. :(

              It will be great if somebody here can help me out.

              Assuming that the latest version is 0.10.5 (from http://www.clearsilver.net/downloads/), I did the conventional steps "./configure && make && sudo make install". However it throws error msg as the following:

              Running cs regression tests
              Failed Regression Test: test_crc.cs
              See test_crc.cs.out and test_crc.cs.err

              Does anyone happen to know how to solve it?

              And therefore I skipped the error msg and copied the cs/cs.h and libneo_cs.a to the corresponding directories (/usr/local/*), but still seeing the following errors when compiling the code:

              $ gcc -I /usr/local/include/ClearSilver -L /usr/local/include hello.c
              /tmp/ccxRdPgS.o: In function `main':
              hello.c:(.text+0x3d): undefined reference to `hdf_init'
              hello.c:(.text+0x53): undefined reference to `hdf_set_value'
              hello.c:(.text+0x5f): undefined reference to `hdf_init'
              hello.c:(.text+0x75): undefined reference to `hdf_set_value'
              hello.c:(.text+0x88): undefined reference to `cs_init'
              hello.c:(.text+0x9e): undefined reference to `cs_parse_string'
              hello.c:(.text+0xc7): undefined reference to `cs_render'
              hello.c:(.text+0xdd): undefined reference to `hdf_set_value'
              hello.c:(.text+0xfe): undefined reference to `cs_render'
              hello.c:(.text+0x10f): undefined reference to `cs_destory'
              hello.c:(.text+0x120): undefined reference to `hdf_destory'
              hello.c:(.text+0x131): undefined reference to `hdf_destory'
              collect2: ld returned 1 exit status

              The hello.c is as following:
              #include <stdio.h>
              #include "ClearSilver/ClearSilver.h"

              NEOERR* callback(void *ctx, char *output) {
              printf("%s\n", output);
              }

              int main(int argc, char* argv[]) {
              CSPARSE *tmpl = NULL; // CS template
              HDF *hdf1, *hdf2; // HDF

              // setup HDF
              hdf_init(&hdf1);
              hdf_set_value(hdf1, "name", "Jacky");
              hdf_init(&hdf2);
              hdf_set_value(hdf2, "name", "Alpha");

              // parse cs template
              cs_init(&tmpl, hdf1);
              cs_parse_string(tmpl, "Hello, <?cs var:name ?>", 24);

              // register rendering callback
              CSOUTFUNC cb = &callback;

              // render cs with hdf2
              tmpl->hdf = hdf2;
              cs_render(tmpl, NULL, cb);

              // render cs with modified hdf1
              hdf_set_value(hdf1, "name", "Sally");
              tmpl->hdf = hdf1;
              cs_render(tmpl, NULL, cb);

              // destroy cs template
              cs_destory(&tmpl);
              hdf_destory(&hdf1);
              hdf_destory(&hdf2);

              printf("hello\n");
              }

              Any ideas?

              Thanks in advance.

              Best,
              Jacky






            • 马亮
              - I successfully compiled the file with your command yet it gave me a segmentation fault in the runtime. This may because of your hello.c has illgeal
              Message 6 of 9 , Aug 31, 2011
              View Source
              • 0 Attachment
                - I successfully compiled the file with your command yet it gave me a segmentation fault in the runtime.
                This may because of your hello.c has illgeal operation, you can use
                $ gcc -g -I /usr/local/include/ClearSilver -L /usr/local/lib  -lneo_cgi -lneo_cs -lneo_utl  hello.c
                to compile it with debug info, and then use gdb to debug it(this is more than clearsilver, try to get some information from google).


                - how to build streamparser using the svn version?  I got a build error.
                Here is scrapt from my clearsilver build script:
                cd /usr/local/src &&
                svn checkout http://clearsilver.googlecode.com/svn/trunk/ clearsilver
                cd clearsilver &&
                svn checkout http://streamhtmlparser.googlecode.com/svn/trunk/ streamhtmlparser
                cd streamhtmlparser && ./configure && make && make install
                cd ../ && ./autogen.sh --disable-wdb --disable-perl --disable-ruby --disable-java --disable-python && mkdir libs

                At 2011-09-01 10:25:20,"Jacky Wang" <jacky.chao.wang@...> wrote:
                Thanks for the reply!

                - I successfully compiled the file with your command yet it gave me a segmentation fault in the runtime.
                - how to build streamparser using the svn version?  I got a build error.

                Best,
                J

                2011/8/31 马亮 <bigmaliang@...>
                sorry for my mistake, seems your compile command is not correct.

                first, you should copy libneo_cgi.a libneo_cs.a libneo_utl.a into /usr/local/lib
                then, you need to change compile command into
                $ gcc -I /usr/local/include/ClearSilver -L /usr/local/lib  -lneo_cgi -lneo_cs -lneo_utl  hello.c 

                Suggest you use the svn version code, which you need to pay some attention on build streamparser library first.




                At 2011-08-31 10:07:01,"马亮" <bigmaliang@...> wrote:
                 


                what is in the test_crc.cs.out and test_crc.cs.err ?

                At 2011-08-30 18:28:52,"Jacky Wang" <jacky.chao.wang@...> wrote:
                 

                Hi there,

                I know that it may be a dumb question, but ClearSilver installing doesn't work for me. :(

                It will be great if somebody here can help me out.

                Assuming that the latest version is 0.10.5 (from http://www.clearsilver.net/downloads/), I did the conventional steps "./configure && make && sudo make install". However it throws error msg as the following:

                Running cs regression tests
                Failed Regression Test: test_crc.cs
                See test_crc.cs.out and test_crc.cs.err

                Does anyone happen to know how to solve it?

                And therefore I skipped the error msg and copied the cs/cs.h and libneo_cs.a to the corresponding directories (/usr/local/*), but still seeing the following errors when compiling the code:

                $ gcc -I /usr/local/include/ClearSilver -L /usr/local/include hello.c
                /tmp/ccxRdPgS.o: In function `main':
                hello.c:(.text+0x3d): undefined reference to `hdf_init'
                hello.c:(.text+0x53): undefined reference to `hdf_set_value'
                hello.c:(.text+0x5f): undefined reference to `hdf_init'
                hello.c:(.text+0x75): undefined reference to `hdf_set_value'
                hello.c:(.text+0x88): undefined reference to `cs_init'
                hello.c:(.text+0x9e): undefined reference to `cs_parse_string'
                hello.c:(.text+0xc7): undefined reference to `cs_render'
                hello.c:(.text+0xdd): undefined reference to `hdf_set_value'
                hello.c:(.text+0xfe): undefined reference to `cs_render'
                hello.c:(.text+0x10f): undefined reference to `cs_destory'
                hello.c:(.text+0x120): undefined reference to `hdf_destory'
                hello.c:(.text+0x131): undefined reference to `hdf_destory'
                collect2: ld returned 1 exit status

                The hello.c is as following:
                #include <stdio.h>
                #include "ClearSilver/ClearSilver.h"

                NEOERR* callback(void *ctx, char *output) {
                printf("%s\n", output);
                }

                int main(int argc, char* argv[]) {
                CSPARSE *tmpl = NULL; // CS template
                HDF *hdf1, *hdf2; // HDF

                // setup HDF
                hdf_init(&hdf1);
                hdf_set_value(hdf1, "name", "Jacky");
                hdf_init(&hdf2);
                hdf_set_value(hdf2, "name", "Alpha");

                // parse cs template
                cs_init(&tmpl, hdf1);
                cs_parse_string(tmpl, "Hello, <?cs var:name ?>", 24);

                // register rendering callback
                CSOUTFUNC cb = &callback;

                // render cs with hdf2
                tmpl->hdf = hdf2;
                cs_render(tmpl, NULL, cb);

                // render cs with modified hdf1
                hdf_set_value(hdf1, "name", "Sally");
                tmpl->hdf = hdf1;
                cs_render(tmpl, NULL, cb);

                // destroy cs template
                cs_destory(&tmpl);
                hdf_destory(&hdf1);
                hdf_destory(&hdf2);

                printf("hello\n");
                }

                Any ideas?

                Thanks in advance.

                Best,
                Jacky








              • Jacky Wang
                Thanks for the comments! However: /usr/bin/ld: ../libs//libstreamhtmlparser.a(libstreamhtmlparser_la-htmlparser.o): relocation R_X86_64_32S against `.rodata
                Message 7 of 9 , Aug 31, 2011
                View Source
                • 0 Attachment
                  Thanks for the comments!

                  However:

                  /usr/bin/ld: ../libs//libstreamhtmlparser.a(libstreamhtmlparser_la-htmlparser.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
                  ../libs//libstreamhtmlparser.a: could not read symbols: Bad value

                  :(

                  On Wed, Aug 31, 2011 at 7:42 PM, 马亮 <bigmaliang@...> wrote:
                  - I successfully compiled the file with your command yet it gave me a segmentation fault in the runtime.
                  This may because of your hello.c has illgeal operation, you can use
                  $ gcc -g -I /usr/local/include/ClearSilver -L /usr/local/lib  -lneo_cgi -lneo_cs -lneo_utl  hello.c
                  to compile it with debug info, and then use gdb to debug it(this is more than clearsilver, try to get some information from google).



                  - how to build streamparser using the svn version?  I got a build error.
                  Here is scrapt from my clearsilver build script:
                  cd /usr/local/src &&
                  svn checkout http://clearsilver.googlecode.com/svn/trunk/ clearsilver
                  cd clearsilver &&
                  svn checkout http://streamhtmlparser.googlecode.com/svn/trunk/ streamhtmlparser
                  cd streamhtmlparser && ./configure && make && make install
                  cd ../ && ./autogen.sh --disable-wdb --disable-perl --disable-ruby --disable-java --disable-python && mkdir libs


                  At 2011-09-01 10:25:20,"Jacky Wang" <jacky.chao.wang@...> wrote:
                  Thanks for the reply!

                  - I successfully compiled the file with your command yet it gave me a segmentation fault in the runtime.
                  - how to build streamparser using the svn version?  I got a build error.

                  Best,
                  J

                  2011/8/31 马亮 <bigmaliang@...>
                  sorry for my mistake, seems your compile command is not correct.

                  first, you should copy libneo_cgi.a libneo_cs.a libneo_utl.a into /usr/local/lib
                  then, you need to change compile command into
                  $ gcc -I /usr/local/include/ClearSilver -L /usr/local/lib  -lneo_cgi -lneo_cs -lneo_utl  hello.c 

                  Suggest you use the svn version code, which you need to pay some attention on build streamparser library first.




                  At 2011-08-31 10:07:01,"马亮" <bigmaliang@...> wrote:
                   


                  what is in the test_crc.cs.out and test_crc.cs.err ?

                  At 2011-08-30 18:28:52,"Jacky Wang" <jacky.chao.wang@...> wrote:
                   

                  Hi there,

                  I know that it may be a dumb question, but ClearSilver installing doesn't work for me. :(

                  It will be great if somebody here can help me out.

                  Assuming that the latest version is 0.10.5 (from http://www.clearsilver.net/downloads/), I did the conventional steps "./configure && make && sudo make install". However it throws error msg as the following:

                  Running cs regression tests
                  Failed Regression Test: test_crc.cs
                  See test_crc.cs.out and test_crc.cs.err

                  Does anyone happen to know how to solve it?

                  And therefore I skipped the error msg and copied the cs/cs.h and libneo_cs.a to the corresponding directories (/usr/local/*), but still seeing the following errors when compiling the code:

                  $ gcc -I /usr/local/include/ClearSilver -L /usr/local/include hello.c
                  /tmp/ccxRdPgS.o: In function `main':
                  hello.c:(.text+0x3d): undefined reference to `hdf_init'
                  hello.c:(.text+0x53): undefined reference to `hdf_set_value'
                  hello.c:(.text+0x5f): undefined reference to `hdf_init'
                  hello.c:(.text+0x75): undefined reference to `hdf_set_value'
                  hello.c:(.text+0x88): undefined reference to `cs_init'
                  hello.c:(.text+0x9e): undefined reference to `cs_parse_string'
                  hello.c:(.text+0xc7): undefined reference to `cs_render'
                  hello.c:(.text+0xdd): undefined reference to `hdf_set_value'
                  hello.c:(.text+0xfe): undefined reference to `cs_render'
                  hello.c:(.text+0x10f): undefined reference to `cs_destory'
                  hello.c:(.text+0x120): undefined reference to `hdf_destory'
                  hello.c:(.text+0x131): undefined reference to `hdf_destory'
                  collect2: ld returned 1 exit status

                  The hello.c is as following:
                  #include <stdio.h>
                  #include "ClearSilver/ClearSilver.h"

                  NEOERR* callback(void *ctx, char *output) {
                  printf("%s\n", output);
                  }

                  int main(int argc, char* argv[]) {
                  CSPARSE *tmpl = NULL; // CS template
                  HDF *hdf1, *hdf2; // HDF

                  // setup HDF
                  hdf_init(&hdf1);
                  hdf_set_value(hdf1, "name", "Jacky");
                  hdf_init(&hdf2);
                  hdf_set_value(hdf2, "name", "Alpha");

                  // parse cs template
                  cs_init(&tmpl, hdf1);
                  cs_parse_string(tmpl, "Hello, <?cs var:name ?>", 24);

                  // register rendering callback
                  CSOUTFUNC cb = &callback;

                  // render cs with hdf2
                  tmpl->hdf = hdf2;
                  cs_render(tmpl, NULL, cb);

                  // render cs with modified hdf1
                  hdf_set_value(hdf1, "name", "Sally");
                  tmpl->hdf = hdf1;
                  cs_render(tmpl, NULL, cb);

                  // destroy cs template
                  cs_destory(&tmpl);
                  hdf_destory(&hdf1);
                  hdf_destory(&hdf2);

                  printf("hello\n");
                  }

                  Any ideas?

                  Thanks in advance.

                  Best,
                  Jacky









                • David Jeske
                  Can you share some information about the environment you are trying to compile/install in? The test_crc.cs error is showing a sign error in output, which
                  Message 8 of 9 , Sep 3, 2011
                  View Source
                  • 0 Attachment
                    Can you share some information about the environment you are trying to compile/install in? 

                    The test_crc.cs  error is showing a sign error in output, which might be related to using a 64bit compile instead of 32bit, or a subtle change to some system library. The best way to help figure this out is for us to know what environment you are using. (uname -a, what distro?)
                  • Jacky Wang
                    Thank you David! I replied the information in another thread. Current I ve seen is:
                    Message 9 of 9 , Sep 4, 2011
                    View Source
                    • 0 Attachment
                      Thank you David!

                      I replied the information in another thread.

                      Current I've seen is:

                      <......
                      ranlib ../libs/libneo_cgi.a
                      gcc -g -O2 -pthread -Wall -I..  -I/home/chaowang/workspace/tmp/clearsilver_trunk/streamhtmlparser/src -fPIC -o static.o -c static.c
                      static.c: In function ‘main’:
                      static.c:78: warning: ignoring return value of ‘chdir’, declared with attribute warn_unused_result
                      gcc -o cs_static.cgi static.o -L../libs/  -lneo_cgi -lneo_cs -lneo_utl -lstreamhtmlparser  -lz
                      gcc -shared -fPIC -o cs_static.cso static.o -L../libs/  -lneo_cgi -lneo_cs -lneo_utl -lstreamhtmlparser  -lz
                      /usr/bin/ld: ../libs//libstreamhtmlparser.a(libstreamhtmlparser_la-htmlparser.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
                      ../libs//libstreamhtmlparser.a: could not read symbols: Bad value
                      collect2: ld returned 1 exit status
                      make[1]: *** [cs_static.cso] Error 1
                      make[1]: Leaving directory `/clearsilver_trunk/cgi'
                      make: *** [cs] Error 1

                      $ uname -a
                      Linux laptop 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:07:13 UTC 2011 x86_64 GNU/Linux

                      Many thanks!
                      Jacky

                      On Sat, Sep 3, 2011 at 4:16 PM, David Jeske <davidj@...> wrote:
                      Can you share some information about the environment you are trying to compile/install in? 

                      The test_crc.cs  error is showing a sign error in output, which might be related to using a 64bit compile instead of 32bit, or a subtle change to some system library. The best way to help figure this out is for us to know what environment you are using. (uname -a, what distro?)

                    Your message has been successfully submitted and would be delivered to recipients shortly.