osqzss / bladeGPS

Real-time GPS signal simulator for bladeRF
MIT License
142 stars 66 forks source link

gpssim.c uses conio.h which isn't available on linux so can't compile #13

Closed nzkarit closed 6 years ago

nzkarit commented 8 years ago

gpssim.c uses conio.h, which from my googling is Windows only. When you run make on linux you get the following error:

user@ubuntu:~/bladeGPS$ make
gcc -O3 -Wall -I../bladeRF/host/libraries/libbladeRF/include   -c -o gpssim.o gpssim.c
gpssim.c:19:19: fatal error: conio.h: No such file or directory
compilation terminated.
<builtin>: recipe for target 'gpssim.o' failed
make: *** [gpssim.o] Error 1
osqzss commented 8 years ago

Sorry for the trouble. I'm not a Linux person, and the code was only tested on the Windows. You can find the source code for the "khbit" and "getch" equivalents for Linux on the net.

zimler commented 8 years ago

@nzkarit does this help at all? https://sourceforge.net/projects/linux-conioh/ or this http://stackoverflow.com/questions/29335758/using-kbhit-and-getch-on-linux

keith-citrenbaum commented 8 years ago

I've forked this repo and got it compiling and running on Linux with only a few tweaks, mostly just using ncurses for getch (from ncurses-dev) and adding a little khbit function, plus a small change to the Makefile to link to the ncurses lib.

I haven't coded in C for many years now, so there's probably some improvements that can be made to whatever I do.

I'm going to clean it up a bit this weekend and see if osqzss wants to pull it, but if you're interested in playing with it now it's available here:

https://github.com/keith-citrenbaum/bladeGPS

I'm going to also try to get it cycling on OS X as well this weekend.

Robert-steve commented 8 years ago

@keith-citrenbaum there seems to be an issue with your code while using the interactive mode. No key can be pressed, I can't even exit the program using Ctrl+C.

keith-citrenbaum commented 8 years ago

Ack! You're right @Robert-steve. I just tested it with the static mode, not interactive. I'll take a look at it this evening.

Robert-steve commented 8 years ago

I think that it would be better to use getchar() instead of getch(). I will test and give some feedback.

TachyonZZ commented 6 years ago

Anyone ever able to compile this in Linux with functional interactive mode? I tried keith-citrenbaum's code however I continued to run into ncurses errors. I also tried to run the windows complied version in wine (with ubuntu) and couldn't get it to initialize the bladeRF. I think wine can work, but I'd rather find a way to run this natively in linux if possible, thank you.

osqzss commented 6 years ago

Try to build from the latest source. It's not working quite right but can be some help. I couldn't figure out the way to clear the STDIN buffer after reading a single character with getchar().

TachyonZZ commented 6 years ago

Indeed this works thank you very much!

osqzss commented 6 years ago

I have added a little more touch. It works much better.

TachyonZZ commented 6 years ago

I just compiled it on raspbian and got some warnings: tmax.mm, hh, etc "may be used uninitialized in this function" However it appears to run fine. I couldn't get a fix but that could have been because I was lazy and used the 2 year old brdc file in the directory as opposed to grabbing a new one and setting an appropriate time. (I get some live sky leakage where I'm at.) I have been able to get a fix using raspbian with gps-sdr-sim and bladerf, so it definitely works with the pi. Anyway thanks again.

szakacsm commented 4 years ago

gpssim.c uses conio.h, which from my googling is Windows only. When you run make on linux you get the following error:

user@ubuntu:~/bladeGPS$ make
gcc -O3 -Wall -I../bladeRF/host/libraries/libbladeRF/include   -c -o gpssim.o gpssim.c
gpssim.c:19:19: fatal error: conio.h: No such file or directory
compilation terminated.
<builtin>: recipe for target 'gpssim.o' failed
make: *** [gpssim.o] Error 1

Hello, I have problem with installation: cd ../../../bladeGPS: no directiory which folder should I navigate?

safayetmuntasirnahin commented 3 years ago

I can't compile a program containing conio.h I use linux mint ulyana I wrote the code in visual studio code. Can any one help me?