View previous topic :: View next topic |
Author |
Message |
pdwalker
Joined: 09 Aug 2005 Posts: 22
|
Posted: Fri Dec 26, 2014 14:53 Post subject: nwnx compile errors in 32bit Ubuntu 14.04.1 |
|
|
Relevant compiler output:
Code: | make -C plugins/spells PLUGIN_CFLAGS="-mtune=i386 -pipe -g -mno-accumulate-outgoing-args -Iinclude -DHAVE_CONFIG_H" PLUGIN_CPPFLAGS="-mtune=i386 -pipe -mno-accumulate-outgoing-args -Iinclude -DHAVE_CONFIG_H" PLUGIN_LFLAGS="-w -fPIC -shared -W -Wall "
make[1]: Entering directory `/home/pdwalker/src/nwnx2-linux/plugins/spells'
gcc -mtune=i386 -pipe -g -mno-accumulate-outgoing-args -Wall -Werror -Wno-error=unused-but-set-variable -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include -mtune=i386 -pipe -mno-accumulate-outgoing-args -Wall -Werror -Wno-error=unused-but-set-variable -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include -c -o funcs/f_GetSpellOption.o funcs/f_GetSpellOption.c
funcs/f_GetSpellOption.c: In function ‘Func_GetSpellOption’:
funcs/f_GetSpellOption.c:31:27: error: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess]
snprintf(value, sizeof(value), "%d", val);
^
cc1: all warnings being treated as errors
make[1]: *** [funcs/f_GetSpellOption.o] Error 1
make[1]: Leaving directory `/home/pdwalker/src/nwnx2-linux/plugins/spells'
make: *** [plugins/spells] Error 2 |
More information on what that warning/error actually is: http://stackoverflow.com/questions/19202368/snprintf-error-argument-to-sizeof-is-the-same-as-destination
Any thoughts on how to resolve that?
The module defenses also gives the same error in one of its files.
Thanks in advance. |
|
Back to top |
|
|
pdwalker
Joined: 09 Aug 2005 Posts: 22
|
Posted: Fri Dec 26, 2014 15:09 Post subject: forget install.sh, use compile.sh |
|
|
I was following the instructions from here: http://www.nwnx.org/phpBB2/viewtopic.php?t=2152
When I used compile.sh instead of install.sh, my compile problems disappeared and everything seems to have built properly. |
|
Back to top |
|
|
Squatting Monk
Joined: 28 Jun 2007 Posts: 76
|
Posted: Sun Dec 28, 2014 5:08 Post subject: |
|
|
Looks like I need to update my guide. I'd run into this and found that the compile errors could be fixed quite simply, but the fix broke other things. Thanks for figuring this out! |
|
Back to top |
|
|
pdwalker
Joined: 09 Aug 2005 Posts: 22
|
Posted: Mon Dec 29, 2014 8:52 Post subject: |
|
|
As much as I'd like to claim credit, I found the advice to use compile.sh instead of install.sh in another post. Unfortunately, I didn't save the link.
Glad to have brought it to your attention though.
Thanks for all the work you guys do. It's really appreciated. |
|
Back to top |
|
|
|