[riot-notifications] [RIOT-OS/RIOT] Reference errors when using multiple folders in C. (#16520)

Jacco Veldscholten notifications at github.com
Tue Jun 1 23:06:54 CEST 2021


#### Description
Im receiving reference errors when im trying to use multiple folders in RIOT OS. What is the correct way to use multiple folders with software?
Currently my root structure is:

- tests.h
- tests.c
- Unity
- - unity.h
- - unity.c

Im trying to include unity.h from tests.h. With the following code:

**tests.h**
`#include "Unity/unity.h"`

But im getting references errors from the compiler that it does not reconigze the functions that from unity.h that are called from tests.h.

I did not edit the makefile, This might be a issue?

#### Steps to reproduce the issue
Create root structure with functions:

- tests.h
- tests.c
- Unity
- - unity.h
- - unity.c


**tests.h:**
```
#include "Unity/unity.h"


void test_true_should_be_true(void);
int TestSuite(void);

void setUp(void);
void tearDown(void);
```

**tests.c**
`#include "tests.h"

void setUp(void){}
void tearDown(void){}

void test_true_should_be_true(void){
    TEST_ASSERT_TRUE(1);
}

int TestSuite(void){
    UNITY_BEGIN();
    RUN_TEST(test_true_should_be_true);
    return UNITY_END();
}`

The Unity file is from Unity tests (http://www.throwtheswitch.org/unity)



#### Versions
arm-none-aebi 9.2.1 Toolchain Riot Docker Container



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/16520
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210601/a87d9e33/attachment.htm>


More information about the notifications mailing list