memory.h

484 views
Skip to first unread message

Adamk

unread,
Aug 6, 2012, 12:57:22 AM8/6/12
to cppu...@googlegroups.com
Hi all

I'm trying to compile CppUTest for my embedded platform and am getting the following warning:

compiling AllocLetTestFree.c
....
tests/AllocLetTestFree.c:8:20: error: memory.h: No such file or directory

As an embedded guy I don't really do C++ and am not too interested in it other than I would like to get these unit tests running on my platform for peace of mind.  My cross compiler is gcc based and has C++ compiler.  I've done some digging and can't find a memory.h include file for the C compiler but can find a memory file for the C++ compiler.  But now I'm confused because everything I can find on the C Standard Library doesn't indicate that there should be a memory.h file.

Can someone please explain to me what's going on here in relation to the CPPUTEST_USE_STD_C_LIB macro and whether the above error means that my cross compiler is going to be able to compile CppUTest?

Cheers
Adam

Bas Vodde

unread,
Aug 7, 2012, 3:54:13 AM8/7/12
to cppu...@googlegroups.com

Hi Adam,

> I'm trying to compile CppUTest for my embedded platform and am getting the following warning:
>
> compiling AllocLetTestFree.c
> ....
> tests/AllocLetTestFree.c:8:20: error: memory.h: No such file or directory
>
> As an embedded guy I don't really do C++ and am not too interested in it other than I would like to get these unit tests running on my platform for peace of mind. My cross compiler is gcc based and has C++ compiler. I've done some digging and can't find a memory.h include file for the C compiler but can find a memory file for the C++ compiler. But now I'm confused because everything I can find on the C Standard Library doesn't indicate that there should be a memory.h file.

Yes, I don't think it belongs there. I've deleted the #include in the latest CppUTest (which is now on github)

> Can someone please explain to me what's going on here in relation to the CPPUTEST_USE_STD_C_LIB macro and whether the above error means that my cross compiler is going to be able to compile CppUTest?

The memory.h is a mistake and shouldn't be there. It is deleted again (and thanks for the bug report :P).

The CPPUTEST_USE_STD_C_LIB is a switch that can be used for turning off the dependencies to the Standard C library. This is only really used for linux kernel development where you don't have standard C available. Using it without linking the kernel replacement std C libraries would lead to trouble :)

So, to resolve your problem, you can do 2 things:
- Delete the memory.h include (shouldn't impact your compilation at all!)
- Grab the latest CppUTest from https://github.com/basvodde/cpputest

Hope this helps?

Thanks!

Bas

ps. for others who are wondering. We are in the process of moving CppUTest away from sourceforge and onto github, so there are now no more commits in source forge



> Cheers
> Adam

Andreas Stenius

unread,
Aug 7, 2012, 4:15:07 AM8/7/12
to cppu...@googlegroups.com
> ps. for others who are wondering. We are in the process of moving CppUTest away from sourceforge and onto github, so there are now no more commits in source forge

Thanks for the heads up, as I was mirroring the sf repo onto my own
git server (as well as github).

Bas Vodde

unread,
Aug 7, 2012, 4:17:13 AM8/7/12
to cppu...@googlegroups.com

Yah, there will be more info about it later… but we want to prepare the issue tracker and the pages so that it will be easy for people to download some releases.

Should be later this week.

Bas

Adamk

unread,
Aug 8, 2012, 2:03:24 AM8/8/12
to cppu...@googlegroups.com
Hi Bas

Thanks for that, it has indeed fixed that problem.

I've got some other linking problems now but that may be due to my cross-compiler.  You may be hearing from me again shortly if I can't figure it out.

Cheers
Adam
Reply all
Reply to author
Forward
0 new messages