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

Doesn't compile properly on 64-bit Ubuntu 12.10 #6

Closed
sniggyfigbat opened this issue May 16, 2013 · 9 comments · Fixed by #8
Closed

Doesn't compile properly on 64-bit Ubuntu 12.10 #6

sniggyfigbat opened this issue May 16, 2013 · 9 comments · Fixed by #8

Comments

@sniggyfigbat
Copy link

I have to admit, I'm getting a bit frustrated here: This bloody thing just doesn't work. I tried downloading it and pulling out of the tarball, and it didn't work. I tried configuring, running, making, etc, etc, but no dice. Next, therefore, I downloaded the source files, from here, and tried to run 'make linux'. After installing the relevant dependencies, I made some progress, but now I've hit a wall my technical savvy and google-fu really can't surmount: this just isn't compiling properly. Every time I attempt to make it, I get a stream of 900-odd errors complaining about 'undefined reference to' and then all of the dependencies. Yet more googling reveals that this means that the code is attempting to build before it's connected to the relevant libraries, but I really don't have the know-how to understand the (undocumented) code, and fix it. Please fix this; it's apparently a fairly common issue for programs on various versions on Ubuntu, but it's still very irritating.

@Vild
Copy link
Contributor

Vild commented May 16, 2013

Can you PasteBin or Gist the output when you run 'make linux'?
I can't help you without the error.

@sniggyfigbat
Copy link
Author

OK, I updated some packages, and now I'm getting yet another, different set of errors. Here's the pastebin (I didn't do it before, as it was over 900 lines long). Same thing happens when I sudo it.

stefan@SCBdesktop:~$ cd /usr/local/src/ImageToMap-X-master/
stefan@SCBdesktop:/usr/local/src/ImageToMap-X-master$ make linux
make -f linux.mk
make[1]: Entering directory /usr/local/src/ImageToMap-X-master' mkdir -p obj/linux/src/ gcc -Wall -Werror -std=c99 -g -s -Ospkg-config --cflags gtk+-3.0-c src/generate.c -o obj/linux/src/generate.o mkdir -p obj/linux/src/ gcc -Wall -Werror -std=c99 -g -s -Ospkg-config --cflags gtk+-3.0-c src/main.c -o obj/linux/src/main.o mkdir -p obj/linux/src/ gcc -Wall -Werror -std=c99 -g -s -Ospkg-config --cflags gtk+-3.0-c src/map_render.c -o obj/linux/src/map_render.o mkdir -p obj/linux/src/ gcc -Wall -Werror -std=c99 -g -s -Ospkg-config --cflags gtk+-3.0-c src/nbtsave.c -o obj/linux/src/nbtsave.o src/nbtsave.c: In function ‘read_region_files’: src/nbtsave.c:671:13: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result] src/nbtsave.c:684:13: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result] src/nbtsave.c:689:13: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result] cc1: all warnings being treated as errors make[1]: *** [obj/linux/src/nbtsave.o] Error 1 make[1]: Leaving directory/usr/local/src/ImageToMap-X-master'
make: *** [linux] Error 2

@Vild
Copy link
Contributor

Vild commented May 16, 2013

Thanks :)
I can bug lasarus to fix it, mean while you can just add (void) before fread on line 671, 684 and 689 in the file src/nbtsave.c

@sniggyfigbat
Copy link
Author

Still no dice, I'm afraid. I added '(void) ' (with the space) onto the beginning of each line, and got this:

stefan@SCBdesktop:/usr/local/src/ImageToMap-X-master$ sudo make linux
make -f linux.mk
make[1]: Entering directory /usr/local/src/ImageToMap-X-master' mkdir -p obj/linux/src/ gcc -Wall -Werror -std=c99 -g -s -Ospkg-config --cflags gtk+-3.0-c src/nbtsave.c -o obj/linux/src/nbtsave.o src/nbtsave.c: In function ‘read_region_files’: src/nbtsave.c:671:8: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result] src/nbtsave.c:684:8: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result] src/nbtsave.c:689:8: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result] cc1: all warnings being treated as errors make[1]: *** [obj/linux/src/nbtsave.o] Error 1 make[1]: Leaving directory/usr/local/src/ImageToMap-X-master'
make: *** [linux] Error 2

@Vild
Copy link
Contributor

Vild commented May 16, 2013

If you change it so it's:
if (fread(...)) {}
Does that work

@lasarus
Copy link
Owner

lasarus commented May 16, 2013

A simpler solution is to turn of warnings in the Makefile. Remove '-Wall' and '-Werror' and you should be fine. Otherwise WildN00b is working on the problem.

@sniggyfigbat
Copy link
Author

sorry, lasarus, your solution doesn't work at all. I just went straight back to the undefined references issue. I haven't copy-pasted all of it, as there are so many lines of error that the terminal deleted the first lines by the time it got to the end, but here's the last bit:

/usr/local/src/ImageToMap-X-master/src/nbtsave.c:89: undefined reference to deflateEnd' obj/linux/src/nbtsave.o: In functioninflatenbt':
/usr/local/src/ImageToMap-X-master/src/nbtsave.c:110: undefined reference to inflateInit2_' /usr/local/src/ImageToMap-X-master/src/nbtsave.c:112: undefined reference toinflateInit_'
/usr/local/src/ImageToMap-X-master/src/nbtsave.c:137: undefined reference to inflate' /usr/local/src/ImageToMap-X-master/src/nbtsave.c:144: undefined reference toinflateEnd'
/usr/local/src/ImageToMap-X-master/src/nbtsave.c:154: undefined reference to inflateEnd' collect2: error: ld returned 1 exit status make[1]: *** [bin/linux/ImageToMapX] Error 1 make[1]: Leaving directory/usr/local/src/ImageToMap-X-master'
make: *** [linux] Error 2

Before that it just went on about undefined references for hundreds of lines. Same thing happened with WildN00b's suggestion.

@Vild
Copy link
Contributor

Vild commented May 16, 2013

Pull the latest changes and see if it works now.

@sniggyfigbat
Copy link
Author

Redownloaded the zip, extracted the folder, ran make once, got the werror issues, remover the '-Wall -Werror' tags, straight back to the undefined references. Either I yanked the wrong thing, or nothing's changed. Sorry.

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

Successfully merging a pull request may close this issue.

3 participants