[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Illegal instruction....

From: Martin Burnicki
Subject: Re: Illegal instruction....
Date: Tue, 26 May 2020 11:01:46 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0


David J Taylor wrote:
> Trying a very simple program:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> #include <gps.h>
> #include <stdio.h>
> #include <string.h>
> int main (int argc, char **argv) {
>  struct gps_data_t gpsdata;
>        printf ("GPSD API >= 7");
> #else
>        printf ("GPSD API < 7");
> #endif
>  return 0;
> }
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> Also produces the "illegal instruction".  I seem to have three include
> files so how can I force the use of the more recent one?

This doesn't sound like the version of the include file is the problem,
and "illegal instruction" is not related to the API version but to the
machine code compiled from that source code.

If my assumption is correct you should also get the "illegal
instruction" if you remove the line

#include <gps.h>

and add one of the following instead:


> I thought
> compiling in the /home/pi/gpsd directory might do that, but I recall
> there being something about different include file locations - system
> and local?  I wonder how the build of gpsd got it right!  Changing
> <gps.h> to "gps.h" while compiling in the gpsd directory still produced
> the illegal instruction.

how do you compile the program? Using a single command line, or is there
a Makefile?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]