Topic: segment error

When I build the benchmark.c within the project, tests works well.
But when I copy the benchmark.c to a new project,and create a makefile to build it, I got some errors.
1.the definition of HAVE_ECC
    Even I include ecc.h in the source file, I have to add "#define HAVE_ECC" to avoid the compile error.
2.segment err
    I modify the benchmark.c only to test the ECC function.In bench_eccKeyGen(),the var "i" in the for loop is always zero,so I get a dead loop
    If I move the local var "i" to a global var, it seems work ,but got a segment err!
So,It seems that ,only include the HeadFiles and load the Lib file cannot use the wolfssl correct!
Is there any step I missed or something need to pay attention?
smile  smile  smile

Share

Re: segment error

Hi Blink,

When compiling a standalone application that uses the wolfSSL library, you'll need to make sure it is compiled using the same preprocessor defines as the library was compiled with.  If you used the autoconf system (./configure, make, make install) to build and install the library, you can simply include the <wolfssl/options.h> header in your application to pull in the same preprocessor defines.

Best Regards,
Chris

Re: segment error

Thank you your help!
I found the segment error's reason is that my PC is x86_64,when I using command "linux32" to enter x86 mode and rebuild ,the error goes away!

Share