Question

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:

Was it helpful?

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.

OTHER TIPS

The "No such file or directory" error is a preprocessor error. It is telling you that the include file cannot be found in the include file path. Your IDE will have a way to specify the include path.

If you are using make, then you will want to use the -I option.

If you are using CppUTest's MakeFileWorker.mk, you will want to add define an environment variable, CPPUTEST_HOME, that specifies the directory where you installed CppUTest.

I hope that helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top