Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: asking for kind help and support

Threaded View

  1. #1
    Junior Member
    Join Date
    Oct 2018

    asking for kind help and support

    first I would like to thank you in advance for your kind and valuable help. Here is my question I am trying to use the library made by for wavelet transform applcation for viberation data to detect annomalies and fault more specifically for industrial bearing. But when I tried to compile the liberery for Teensy 3.6 using Arduino 1.8.5 I got an error as i mention below. all the liberery as well the implimenation files are made of C code what i mean using .c. anyone who can suggest me the solution? I guess the problem is with the linker and compiler.
    // here is the sample code to test simple with simple imput data
    void loop() {

    wave_object obj;
    wt_object wt;
    double *inp, *out, *diff;
    int N, i, J;
    char *name = "db4";
    obj = wave_init(name);// Initialize the wavelet
    N = 14; //Length of Signal
    inp = (double*)malloc(sizeof(double)* N); //Input signal
    out = (double*)malloc(sizeof(double)* N);
    diff = (double*)malloc(sizeof(double)* N);
    //wmean = mean(temp, N);
    for (i = 0; i < N; ++i) {
    inp[i] = i;
    J = 1; //Decomposition Levels
    wt = wt_init(obj, "dwt", N, J);// Initialize the wavelet transform object
    setDWTExtension(wt, "sym");// Options are "per" and "sym". Symmetric is the default option
    setWTConv(wt, "direct");
    dwt(wt, inp);// Perform DWT
    //DWT output can be accessed using wt->output vector. Use wt_summary to find out how to extract appx and detail coefficients
    for (i = 0; i < wt->outlength; ++i) {

    idwt(wt, out);// Perform IDWT (if needed)
    // Test Reconstruction
    for (i = 0; i < wt->siglength; ++i) {
    diff[i] = out[i] - inp[i];

    Serial.println(absmax(diff, wt->siglength)); // If Reconstruction succeeded then the output should be a small value.


    double absmax(double *array, int N) {
    double max;
    int i;
    max = 0.0;
    for (i = 0; i < N; ++i) {
    if (fabs(array[i]) >= max) {
    max = fabs(array[i]);
    return max;

    // here are the Generated error when I tried to compiled
    c:/program files (x86)/arduino/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-closer.o): In function `_close_r':

    closer.c.text._close_r+0xc): undefined reference to `_close'

    c:/program files (x86)/arduino/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-lseekr.o): In function `_lseek_r':

    lseekr.c.text._lseek_r+0x12): undefined reference to `_lseek'

    c:/program files (x86)/arduino/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-readr.o): In function `_read_r':

    readr.c.text._read_r+0x12): undefined reference to `_read'

    c:/program files (x86)/arduino/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-fstatr.o): In function `_fstat_r':

    fstatr.c.text._fstat_r+0x10): undefined reference to `_fstat'

    c:/program files (x86)/arduino/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-isattyr.o): In function `_isatty_r':

    isattyr.c.text._isatty_r+0xc): undefined reference to `_isatty'

    collect2.exe: error: ld returned 1 exit status

    Error compiling for board Teensy 3.6.
    Last edited by ermias; 12-03-2018 at 06:19 PM. Reason: to include the sample code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts