6

Working with embedded C-projects. There are libraries, include files and so on - for micro controllers. No need for me to use GCC for a host machine and OS (Linux Mint 64 bit). As a rule...

But now I'm trying to compile mspdebug project from a Github - with a GCC of course. And I get an error at the very begin of make:

mspdebug$ make
cc  -DUSE_READLINE  -O1 -Wall -Wno-char-subscripts -ggdb -I. -Isimio -Iformats -Itransport -Idrivers -Iutil -Iui -DLIB_DIR=\"/usr/local/lib/\"  -o util/btree.o -c util/btree.c
util/btree.c:19:20: fatal error: assert.h: No such file or directory
 #include <assert.h>
                    ^
compilation terminated.

I search for the includes in all possible paths (I've got the list of them via gcc -v command) - there are no assert.h file, as well, as stdio.h and so on. Except virtual box directories there is only one place (where GCC does not search includes): /usr/lib/syslinux/com32/include

AFAIK, all standard libs and includes are installed with the GCC. So I try to reinstall GCC (4.8.4) - nothing changes.

What is the normal way to give GCC all standard environment it needs?

drvlas
  • 423
  • 3
  • 7
  • 18

2 Answers2

4

Thanks to the right direction set by Sam Varshavchik I found the info in the stackoverflow. So I did the following:

1) installed build-essential:

sudo apt-get install build-essential

2) installed libusb (since my try to build the package revealed the absence of usb.h):

sudo apt-get install libusb-dev

And it is OK! The mspdebug (v.023) is compiled and successfully tested!

So, Linux Mint 17.2 (at least) requires installing some libs to a GCC, the most basic is build-essential.

Community
  • 1
  • 1
drvlas
  • 423
  • 3
  • 7
  • 18
3

assert.h is not part of gcc, it's a part of glibc.

Most likely, your Linux distribution puts the system headers into a separate package that you need to install.

Fedora, for examples, puts the header files in the glibc-headers package. However, you can't be using Fedora, because Fedora's gcc package has a dependency on glibc-headers, to make sure that it gets pulled in.

Whatever Linux distribution you're using, you need to research which distribution package will install the system header files you need to build stuff with.

Sam Varshavchik
  • 114,536
  • 5
  • 94
  • 148
  • Sam, I use Linux Mint 17.2. OK, will search that package. Just was puzzled with the very possibility of separate installing of GCC and standard libs. I will report the result. Thank you! – drvlas Dec 26 '15 at 05:53
  • I was having this issue on Fedora and had to change -target i386-linux-none to -target i386-linux-gnu – Mi G Mar 11 '23 at 16:41