Duke4.net Forums: mkpalette fails to build - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

mkpalette fails to build

User is offline   bioman 

#1

Hello,

I'm trying to build new utils from sources but there are some issues:

Quote

make utils POLYMER=0 NOASM=1 WITHOUT_GTK=1 USE_LIBVPX=0 RELEASE=0 DEBUGANYWAY=1
Build started using "gcc -ggdb -O0 -DDEBUGGINGAIDS=2 -DNOSDLPARACHUTE -W -Wall -Werror-implicit-function-declaration -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=2 -fjump-tables -Wno-unused-result -Wextra -Wno-char-subscripts -Iinclude -DLUNATIC_ENABLE -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DHAVE_INTTYPES -DRENDERTYPESDL=1 -Wstrict-overflow=1 -DUSE_OPENGL -DNOASM -Wimplicit -fno-exceptions -fno-rtti"
Built object obj.gnu/kextract.o
Built object obj.gnu/compat.o
Built object obj.gnu/compat_tools.o
Built executable kextract
Built object obj.gnu/kgroup.o
Built executable kgroup
Built object obj.gnu/transpal.o
Built object obj.gnu/pragmas.o
Built executable transpal
Built object obj.gnu/wad2art.o
Built executable wad2art
Built object obj.gnu/wad2map.o
Built executable wad2map
Built object obj.gnu/kmd2tool.o
Built executable kmd2tool
Built object obj.gnu/md2tool.o
Built executable md2tool
src/util/generateicon.c: In function 'writeicon':
src/util/generateicon.c:25:9: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'intptr_t' [-Wformat]
Built object obj.gnu/generateicon.o
Built object obj.gnu/kplib.o
Built object obj.gnu/cache1d.o
Built executable generateicon
Built object obj.gnu/cacheinfo.o
Built executable cacheinfo
Built object obj.gnu/arttool.o
Built executable arttool
Built object obj.gnu/givedepth.o
Built executable givedepth
Built object obj.gnu/mkpalette.o
obj.gnu/mkpalette.o: In function `convertHSVtoRGB':
/home/bm/eduke32_20120405-2592/build/src/util/mkpalette.c:107: undefined reference to `floor'
collect2: ld returned 1 exit status
Built object obj.gnu/unpackssi.o
Built executable unpackssi
Built object obj.gnu/bsuite.o
Built executable bsuite
Build successful:
ls: cannot access mkpalette: No such file or directory
-rwxr-xr-x 1 bm bm 83922 Apr 8 02:47 arttool
-rwxr-xr-x 1 bm bm 22666 Apr 8 02:47 bsuite
-rwxr-xr-x 1 bm bm 34605 Apr 8 02:47 cacheinfo
-rwxr-xr-x 1 bm bm 157753 Apr 8 02:47 generateicon
-rwxr-xr-x 1 bm bm 16839 Apr 8 02:47 givedepth
-rwxr-xr-x 1 bm bm 33709 Apr 8 02:47 kextract
-rwxr-xr-x 1 bm bm 34985 Apr 8 02:47 kgroup
-rwxr-xr-x 1 bm bm 16494 Apr 8 02:47 kmd2tool
-rwxr-xr-x 1 bm bm 42679 Apr 8 02:47 md2tool
-rwxr-xr-x 1 bm bm 43517 Apr 8 02:47 transpal
-rwxr-xr-x 1 bm bm 16204 Apr 8 02:47 unpackssi
-rwxr-xr-x 1 bm bm 44279 Apr 8 02:47 wad2art
-rwxr-xr-x 1 bm bm 95471 Apr 8 02:47 wad2map
make: *** [finish] Error 2


Note: with CLANG=1 it compiles without errors.

Otherwise 'generateicon' give me also a Segmentation fault, here a backtrace:

Quote

Reading symbols from /home/bm/eduke32_20120405-2592/build/generateicon...done.
(gdb) run test.png
Starting program: /home/bm/eduke32_20120405-2592/build/generateicon test.png

Program received signal SIGSEGV, Segmentation fault.
0x000000000040cb9c in kpzload (filnam=0x7fffffffe9f9 "test.png", pic=0x0, bpl=0x7fffffffe5b4, xsiz=0x7fffffffe580, ysiz=0x7fffffffe584) at src/kplib.c:3302
3302 (*pic) = 0;
(gdb) q


Linux x86-64.
1

User is offline   Hendricks266 

  • Weaponized Autism

  #2

View Postbioman, on 07 April 2012 - 05:03 PM, said:

Built object obj.gnu/mkpalette.o
obj.gnu/mkpalette.o: In function `convertHSVtoRGB':
/home/bm/eduke32_20120405-2592/build/src/util/mkpalette.c:107: undefined reference to `floor'
collect2: ld returned 1 exit status

That is very strange, considering floor() is part of math.h and the C standard library.

http://www.cplusplus...ry/cmath/floor/

I don't know what to say, other than verify your compiler setup and version (and version integrity across components and libraries).

EDIT: Maybe try replacing line 107 of mkpalette.c with:

i = floor( (double) hsv->h );


View Postbioman, on 07 April 2012 - 05:03 PM, said:

Otherwise 'generateicon' give me also a Segmentation fault, here a backtrace:

Verified, but that is not a proper backtrace because you did not input the "bt" command. Here is one:

Program received signal SIGSEGV, Segmentation fault.
0x0040bb49 in kpzload (filnam=0x3e2cc3 "EDuke32_icon_21_large_opaque\\", pic=0x0, bpl=0x22ff28, xsiz=0x22ff2c, ysiz=0x22ff30) at src/kplib.c:3302
3302        (*pic) = 0;
(gdb) bt
#0  0x0040bb49 in kpzload (filnam=0x3e2cc3 "EDuke32_icon_21_large_opaque\\", pic=0x0, bpl=0x22ff28, xsiz=0x22ff2c, ysiz=0x22ff30) at src/kplib.c:3302
#1  0x0040172c in main (argc=3, argv=0x3e2d68) at src/util/generateicon.c:67
(gdb)


Thanks for posting what you did, though! It is still very helpful.

This is code in Ken's kplib.c, not generateicon itself. I will ask on IRC and if necessary talk to Ken himself for help. I will report back.

This post has been edited by Hendricks266: 07 April 2012 - 07:22 PM

0

User is offline   LoneFox 

#3

View PostHendricks266, on 07 April 2012 - 07:07 PM, said:

That is very strange, considering floor() is part of math.h and the C standard library.

http://www.cplusplus...ry/cmath/floor/

I don't know what to say, other than verify your compiler setup and version (and version integrity across components and libraries).

EDIT: Maybe try replacing line 107 of mkpalette.c with:

i = floor( (double) hsv->h );


Actually this is typical symptom of forgetting -lm
A patch to fix it:
diff -bur eduke32-2592-orig/build/Makefile eduke32-2592/build/Makefile
--- eduke32-2592-orig/build/Makefile    2012-03-26 08:04:21.000000000 +0300
+++ eduke32-2592/build/Makefile 2012-04-08 07:21:19.000000000 +0300
@@ -58,7 +58,7 @@
     OURCFLAGS+= -DLUNATIC_ENABLE
 endif

-UTILLIBS=  # -lpthread
+UTILLIBS= -lm # -lpthread
 UTILADDOBJS=
 ifneq (0,$(NEDMALLOC))
     UTILADDOBJS+= $(OBJ)/nedmalloc.$o

1

User is offline   Plagman 

  • Former VP of Media Operations

#4

I fixed the crash in generateicon, BTW; it should run fine as of 2596.
1

User is offline   Hendricks266 

  • Weaponized Autism

  #5

As of r2597 mkpalette should build correctly. Thanks for the help and the reports!
0

User is offline   bioman 

#6

Hi,

Is there a reason that utilities try to link against SDL mixer ?

http://pastebin.com/ptX9Q6Fg
r2849
Linux 64 bits
0

User is offline   Hendricks266 

  • Weaponized Autism

  #7

^This should be fixed in r2974.
0

User is offline   bioman 

#8

Ok, thanks.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options