Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make command fails #2

Closed
Derekcz opened this issue Jul 31, 2019 · 7 comments
Closed

Make command fails #2

Derekcz opened this issue Jul 31, 2019 · 7 comments

Comments

@Derekcz
Copy link

Derekcz commented Jul 31, 2019

When I run the make command in the apt-encoder-master folder, it tries to access files under a guest user that aren't present on my system;

derek@derek-pc:~/Desktop/apt-encoder-master$ make
----------Sestavování projektu:[ noaa_apt - Debug ]----------
make[1]: Entering directory '/home/derek/Desktop/apt-encoder-master'
gcc -c  "/home/guest/Dokumenty/C-code/noaa_apt/main.c" -O3 -Wall  -o ./Debug/main.c.o -I. -I. 
gcc: error: /home/guest/Dokumenty/C-code/noaa_apt/main.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
noaa_apt.mk:95: recipe for target 'Debug/main.c.o' failed
make[1]: *** [Debug/main.c.o] Error 1
make[1]: Leaving directory '/home/derek/Desktop/apt-encoder-master'
Makefile:4: recipe for target 'All' failed
make: *** [All] Error 2

Is this an issue with the encoder or am I doing something wrong?

@jryng
Copy link

jryng commented Aug 1, 2019

It's a problem with noaa_apt.mk in which it tries pointing gcc to files on the author's machine.
It compiles if you ignore the makefile and run "gcc ./main.c -O3 -Wall -o ./Debug/main.c.o -I. -I.". readline is required.

@Derekcz
Copy link
Author

Derekcz commented Aug 1, 2019

After installing libreadline-dev and running the command, I get this output:

derek@derek-pc:~/Desktop/apt-encoder-master$ sudo gcc ./main.c -O3 -Wall -o ./Debug/main.c.o -I. -I.
./main.c: In function ‘main’:
./main.c:331:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s",newimage);
         ^~~~~~~~~~~~~~~~~~~~
./main.c:357:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s",newimage);
         ^~~~~~~~~~~~~~~~~~~~
/tmp/ccXuLjzJ.o: In function `ClearConsole':
main.c:(.text+0x105): undefined reference to `rl_free_line_state'
main.c:(.text+0x10a): undefined reference to `rl_cleanup_after_signal'
main.c:(.text+0x111): undefined reference to `rl_readline_state'
main.c:(.text+0x11c): undefined reference to `rl_line_buffer'
main.c:(.text+0x127): undefined reference to `rl_mark'
main.c:(.text+0x131): undefined reference to `rl_end'
main.c:(.text+0x13b): undefined reference to `rl_point'
/tmp/ccXuLjzJ.o: In function `SoundThread':
main.c:(.text+0x1fd): undefined reference to `AptTransImageLine'
main.c:(.text+0x22d): undefined reference to `sin'
main.c:(.text+0x2c5): undefined reference to `sin'
main.c:(.text+0x48e): undefined reference to `AptTransImageLine'
main.c:(.text+0x4af): undefined reference to `sin'
main.c:(.text+0x4e5): undefined reference to `fwrite_int'
/tmp/ccXuLjzJ.o: In function `main':
main.c:(.text.startup+0x1bb): undefined reference to `OpenTgaImage'
main.c:(.text.startup+0x282): undefined reference to `wav_open'
main.c:(.text.startup+0x2b9): undefined reference to `wav_head'
main.c:(.text.startup+0x2ce): undefined reference to `pthread_create'
main.c:(.text.startup+0x2e0): undefined reference to `pthread_detach'
main.c:(.text.startup+0x3d7): undefined reference to `InitAudioDevice'
main.c:(.text.startup+0x403): undefined reference to `OpenTgaImage'
main.c:(.text.startup+0x44d): undefined reference to `readline'
main.c:(.text.startup+0x461): undefined reference to `add_history'
main.c:(.text.startup+0x8ad): undefined reference to `OpenTgaImage'
main.c:(.text.startup+0xaee): undefined reference to `OpenTgaImage'
collect2: error: ld returned 1 exit status

@tom2238
Copy link
Owner

tom2238 commented Aug 1, 2019

You can use codelite-make to regenerate Makefile.
$ codelite-make -w noaa_apt.workspace -c Debug
$ make -e -f Makefile
or
$ gcc -c "main.c" -O3 -Wall -o ./Debug/main.c.o -I. -I.
$ gcc -c "aptcode.c" -O3 -Wall -o ./Debug/aptcode.c.o -I. -I.
$ gcc -c "audioset.c" -O3 -Wall -o ./Debug/audioset.c.o -I. -I.
$ gcc -c "image.c" -O3 -Wall -o ./Debug/image.c.o -I. -I.
$ gcc -c "wavwrite.c" -O3 -Wall -o ./Debug/wavwrite.c.o -I. -I.
$ gcc -o ./Debug/noaa_apt @"noaa_apt.txt" -L. -L. -LDebug -lpthread -lm -lreadline -ltermcap -O0

@Derekcz
Copy link
Author

Derekcz commented Aug 3, 2019

Seems like I figured it out, although I still have issues with the output. The telemetry lines show up fine after decoding, but the source image is corrupted. Could you please provide a sample .tga file to make sure that the issue isn't with my method of image conversion to .tga? I use GIMP, and the only export option is whether I want the image compressed or not.

@Derekcz
Copy link
Author

Derekcz commented Aug 3, 2019

Nevermind, seems like the issue was with my flash drive. It now works fine! Thank you for your help.

@Derekcz Derekcz closed this as completed Aug 3, 2019
@tom2238
Copy link
Owner

tom2238 commented Aug 3, 2019

Thank you for your response.

@comicsansgreenki
Copy link

comicsansgreenki commented Mar 28, 2020

You can use codelite-make to regenerate Makefile.
$ codelite-make -w noaa_apt.workspace -c Debug
$ make -e -f Makefile
or
$ gcc -c "main.c" -O3 -Wall -o ./Debug/main.c.o -I. -I.
$ gcc -c "aptcode.c" -O3 -Wall -o ./Debug/aptcode.c.o -I. -I.
$ gcc -c "audioset.c" -O3 -Wall -o ./Debug/audioset.c.o -I. -I.
$ gcc -c "image.c" -O3 -Wall -o ./Debug/image.c.o -I. -I.
$ gcc -c "wavwrite.c" -O3 -Wall -o ./Debug/wavwrite.c.o -I. -I.
$ gcc -o ./Debug/noaa_apt @"noaa_apt.txt" -L. -L. -LDebug -lpthread -lm -lreadline -ltermcap -O0

I'm still having trouble rebuilding this.
codelite-make -w noaa_apt.workspace -c Debug returns:
[ERROR ] Could not load build settings configuration object (Version 2.1 / build_settings.xml)

and $ gcc -o ./Debug/noaa_apt @"noaa_apt.txt" -L. -L. -LDebug -lpthread -lm -lreadline -ltermcap -O0 returns:
/usr/lib/gcc/i686-linux-gnu/7/../../../i386-linux-gnu/Scrt1.o: In function '_start': (.text+0x28): undefined reference to 'main' collect2: error: ld returned 1 exit status
noaa_apt.txt is empty.

Sidenote: I tried omitting the debug output (-o ./Debug/noaa_apt @"noaa_apt.txt") and got the same thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants