logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
nwnx compile errors in 32bit Ubuntu 14.04.1

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support
View previous topic :: View next topic  
Author Message
pdwalker



Joined: 09 Aug 2005
Posts: 22

PostPosted: Fri Dec 26, 2014 14:53    Post subject: nwnx compile errors in 32bit Ubuntu 14.04.1 Reply with quote

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
View user's profile Send private message
pdwalker



Joined: 09 Aug 2005
Posts: 22

PostPosted: Fri Dec 26, 2014 15:09    Post subject: forget install.sh, use compile.sh Reply with quote

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
View user's profile Send private message
Squatting Monk



Joined: 28 Jun 2007
Posts: 76

PostPosted: Sun Dec 28, 2014 5:08    Post subject: Reply with quote

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
View user's profile Send private message
pdwalker



Joined: 09 Aug 2005
Posts: 22

PostPosted: Mon Dec 29, 2014 8:52    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group