Search code examples
embeddedatmelcpputest

How to add a static library CppUTests to my project atmel studio


I'm using Atmel Studio 6.1.2 SP2. I'm setting up CppUTest for our embedded system project. I created a static CPP library for the CppUTest Framework which copiled successfuly after a small change. Now I'm including this library to a test project. A C++ application project.

enter image description here

The issue I'm facing now is that even though the intellisense is auto completing my include, that means that it sees where the library is, I get "No chuch file or directory" error when compiling.

In GccApplication1.cpp I have this:

#include <avr32/io.h>
#include <CommandLineTestRunner.h>

int main(int ac, const char** av)
{
    /* These checks are here to make sure assertions outside test runs don't crash */
    CHECK(true);
    LONGS_EQUAL(1, 1);

    return CommandLineTestRunner::RunAllTests(ac, av);
}

And the error is that it can't find the CommandLineTestRunner.h. I tried with "" and <> but it doesn't see it.

Any ideas? For more information. I'm following the steps from Atmel, here is the tutorial:


Solution

  • Adding the library only tells the linker that the file is available to be linked with the rest of your object code. What appears to be missing is telling the compiler where it can find the header files for the library. If you add the library path to your include list you should be good to go.