This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Error: L6218E: Undefined symbol nchecksum_of (referred from epa_protocol.o).

Hello,
I have linking problem in my project. Nonetheless I defined correctly my include paths, linker is printing message L6218E: Undefined symbol nchecksum_of (referred from epa_protocol.o). In file epa_protocol.c are included all files, including checksum.h. I have no idea what's goin wrong.

Do you have idea how to solve the problem?

This is declaration of function in header checksum.h


/*
 * checksum.h
 *
 *  Created on: Mar 18, 2016
 *      Author: nenad
 */

#ifndef NEON_LIB_INCLUDE_LIB_CHECKSUM_H_
#define NEON_LIB_INCLUDE_LIB_CHECKSUM_H_

#include <stddef.h>
#include <stdint.h>

uint8_t nchecksum_of(const void * data, size_t size);

#endif /* NEON_LIB_INCLUDE_LIB_CHECKSUM_H_ */

this file's called in appropriate .c file like this


#include "lib/checksum.h"

uint8_t nchecksum_of(const void * data, size_t size)
{
        unsigned int                            checksum_;
        unsigned int                            idx;
        const uint8_t   *                       data_ = data;

        for (checksum_ = 0, idx = 0; idx < size; idx++) {
                checksum_ += *data_++;
        }

        return (-(uint8_t)checksum_);
}

here is declaration part of epa_protocol.c


#include "lib/bits.h"
#include "lib/checksum.h"
#include "port/compiler.h"
#include "usbd_cdc_if.h"
#include "ppbuff.h"