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 
 
Problems compiling nwnx2
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support
View previous topic :: View next topic  
Author Message
MetaPhaze



Joined: 03 Jun 2007
Posts: 29
Location: USA

PostPosted: Mon Sep 13, 2010 19:42    Post subject: Problems compiling nwnx2 Reply with quote

make
g++ -mtune=i386 -pipe -Iinclude -DHAVE_CONFIG_H -c -o nwnx2lib.o nwnx2lib.cpp
nwnx2lib.cpp: In function 'void PayLoad(const char**, const char**)':
nwnx2lib.cpp:215: error: 'free' was not declared in this scope
nwnx2lib.cpp:223: error: 'free' was not declared in this scope
nwnx2lib.cpp: In function 'void Configure()':
nwnx2lib.cpp:508: warning: deprecated conversion from string constant to 'char*'
nwnx2lib.cpp:515: warning: deprecated conversion from string constant to 'char*'
nwnx2lib.cpp:520: error: 'atoi' was not declared in this scope
nwnx2lib.cpp:525: error: 'atoi' was not declared in this scope
nwnx2lib.cpp: In function 'void Log(int, const char*, ...)':
nwnx2lib.cpp:618: warning: format not a string literal and no format arguments
nwnx2lib.cpp:624: warning: format not a string literal and no format arguments
nwnx2lib.cpp: In constructor 'startstop::startstop()':
nwnx2lib.cpp:650: warning: format '%p' expects type 'void*', but argument 2 has type 'long unsigned int'
nwnx2lib.cpp:650: warning: format '%p' expects type 'void*', but argument 3 has type 'long unsigned int'
nwnx2lib.cpp:652: warning: format '%p' expects type 'void*', but argument 2 has type 'long unsigned int'
nwnx2lib.cpp:652: warning: format '%p' expects type 'void*', but argument 3 has type 'long unsigned int'
make: *** [nwnx2lib.o] Error 1

gcc --version
gcc (Gentoo 4.4.3-r2 p1.2) 4.4.3
Copyright (C) 2010 Free Software Foundation, Inc.

running on gentoo.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Tue Sep 14, 2010 0:27    Post subject: Reply with quote

The latest version compiles with gcc 4.3 but not as far as I know with gcc 4.4. I'd try installing gcc 4.3 and doing

Code:
export CC=gcc-4.3
export CXX=g++-4.3
./configure
make


(My experience with autotools is limited, so there's probably a better way but this one works.)
Back to top
View user's profile Send private message
MetaPhaze



Joined: 03 Jun 2007
Posts: 29
Location: USA

PostPosted: Tue Sep 14, 2010 3:47    Post subject: Reply with quote

make
g++ -mtune=i386 -pipe -Iinclude -DHAVE_CONFIG_H -c -o nwnx2lib.o nwnx2lib.cpp
nwnx2lib.cpp: In function 'void PayLoad(const char**, const char**)':
nwnx2lib.cpp:215: error: 'free' was not declared in this scope
nwnx2lib.cpp:223: error: 'free' was not declared in this scope
nwnx2lib.cpp: In function 'void Configure()':
nwnx2lib.cpp:508: warning: deprecated conversion from string constant to 'char*'
nwnx2lib.cpp:515: warning: deprecated conversion from string constant to 'char*'
nwnx2lib.cpp:520: error: 'atoi' was not declared in this scope
nwnx2lib.cpp:525: error: 'atoi' was not declared in this scope
nwnx2lib.cpp: In function 'void Log(int, const char*, ...)':
nwnx2lib.cpp:618: warning: format not a string literal and no format arguments
nwnx2lib.cpp:624: warning: format not a string literal and no format arguments
nwnx2lib.cpp: In constructor 'startstop::startstop()':
nwnx2lib.cpp:650: warning: format '%p' expects type 'void*', but argument 2 has type 'long unsigned int'
nwnx2lib.cpp:650: warning: format '%p' expects type 'void*', but argument 3 has type 'long unsigned int'
nwnx2lib.cpp:652: warning: format '%p' expects type 'void*', but argument 2 has type 'long unsigned int'
nwnx2lib.cpp:652: warning: format '%p' expects type 'void*', but argument 3 has type 'long unsigned int'
make: *** [nwnx2lib.o] Error 1

gcc --version
gcc (Gentoo 4.3.4 p1.1, pie-10.1.5) 4.3.4
Copyright (C) 2008 Free Software Foundation, Inc.


same thing
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
drake127



Joined: 26 Jan 2010
Posts: 28

PostPosted: Tue Sep 14, 2010 4:07    Post subject: Reply with quote

Unable to reproduce, have you run ./configure?

You see, you are missing free and atoi definitions which is weird. Try to add
#include <stdlib.h> to nwnx2lib.cpp.
Back to top
View user's profile Send private message
MetaPhaze



Joined: 03 Jun 2007
Posts: 29
Location: USA

PostPosted: Tue Sep 14, 2010 15:28    Post subject: Reply with quote

added #include <stdlib.h> to nwnx2lib.cpp

make
i686-pc-linux-gnu-g++ -mtune=i386 -pipe -Iinclude -DHAVE_CONFIG_H -c -o nwnx2lib.o nwnx2lib.cpp
nwnx2lib.cpp: In function 'void Configure()':
nwnx2lib.cpp:509: warning: deprecated conversion from string constant to 'char*'
nwnx2lib.cpp:516: warning: deprecated conversion from string constant to 'char*'
nwnx2lib.cpp: In function 'void Log(int, const char*, ...)':
nwnx2lib.cpp:619: warning: format not a string literal and no format arguments
nwnx2lib.cpp:625: warning: format not a string literal and no format arguments
nwnx2lib.cpp: In constructor 'startstop::startstop()':
nwnx2lib.cpp:651: warning: format '%p' expects type 'void*', but argument 2 has type 'long unsigned int'
nwnx2lib.cpp:651: warning: format '%p' expects type 'void*', but argument 3 has type 'long unsigned int'
nwnx2lib.cpp:653: warning: format '%p' expects type 'void*', but argument 2 has type 'long unsigned int'
nwnx2lib.cpp:653: warning: format '%p' expects type 'void*', but argument 3 has type 'long unsigned int'
nwnx2lib.cpp: Assembler messages:
nwnx2lib.cpp:463: Warning: indirect jmp without `*'
nwnx2lib.cpp:497: Warning: indirect jmp without `*'
i686-pc-linux-gnu-g++ -mtune=i386 -pipe -Iinclude -DHAVE_CONFIG_H -c -o NWNXBase.o NWNXBase.cpp
NWNXBase.cpp: In member function 'int CNWNXBase::ParamLog(int, const char*, char*)':
NWNXBase.cpp:94: error: 'strlen' was not declared in this scope
NWNXBase.cpp:95: error: 'strcpy' was not declared in this scope
NWNXBase.cpp: In member function 'void CNWNXBase::BaseConf()':
NWNXBase.cpp:124: error: 'atoi' was not declared in this scope
make: *** [NWNXBase.o] Error 1

to reproduce it you'd probably have to be running gentoo or lfs
and have compiled all of your own binaries for the whole system with gcc 4.3.4
if we can't find a solution i may just have to drop back a few versions on some programs.
I have run ./configure
like
./configure --prefix="/home/nwn" --with-extraplugins="plugins/leto"
i have tried autoconf as well... configure runs fine and produces
./configure --prefix=/home/nwn --with-extraplugins="plugins/leto"
checking for gcc... i686-pc-linux-gnu-gcc-4.3.4
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether i686-pc-linux-gnu-gcc-4.3.4 accepts -g... yes
checking for i686-pc-linux-gnu-gcc-4.3.4 option to accept ISO C89... none needed
checking how to run the C preprocessor... i686-pc-linux-gnu-gcc-4.3.4 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking size of void *... 4
checking for a sed that does not truncate output... /bin/sed
checking whether the C compiler accepts the -mtune=i386 flag... yes
checking for gcc... (cached) i686-pc-linux-gnu-gcc-4.3.4
checking whether we are using the GNU C compiler... (cached) yes
checking whether i686-pc-linux-gnu-gcc-4.3.4 accepts -g... (cached) yes
checking for i686-pc-linux-gnu-gcc-4.3.4 option to accept ISO C89... (cached) none needed
checking whether we are using the GNU C++ compiler... yes
checking whether i686-pc-linux-gnu-g++ accepts -g... yes
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for bzero... yes
checking for getspnam... yes
checking for inflateEnd in -lz... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating plugins/areas/Makefile
config.status: creating plugins/chat/Makefile
config.status: creating plugins/defenses/Makefile
config.status: creating plugins/events/Makefile
config.status: creating plugins/fixes/Makefile
config.status: creating plugins/funcs/Makefile
config.status: creating plugins/functions/Makefile
config.status: creating plugins/hashset/Makefile
config.status: creating plugins/mnx/Makefile
config.status: creating plugins/odmbc/Makefile
config.status: creating plugins/profiler/Makefile
config.status: creating plugins/reset/Makefile
config.status: creating plugins/resman/Makefile
config.status: creating plugins/ruby/Makefile
config.status: creating plugins/spells/Makefile
config.status: creating plugins/structs/Makefile
config.status: creating plugins/system/Makefile
config.status: creating plugins/tmi/Makefile
config.status: creating plugins/tweaks/Makefile
config.status: creating plugins/weapons/Makefile
config.status: creating plugins/leto/Makefile
config.status: creating config.h
config.status: config.h is unchanged
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
drake127



Joined: 26 Jan 2010
Posts: 28

PostPosted: Tue Sep 14, 2010 20:25    Post subject: Reply with quote

Include also following:

#include <stdio.h>
#include <string.h>

If you see next similar errors, look for another undeclared function, type it to google and proper include header should pop out.

However this is weird ... I can't believe it would miss so many "core" headers. Does anybody else excperience same issue?
Back to top
View user's profile Send private message
MetaPhaze



Joined: 03 Jun 2007
Posts: 29
Location: USA

PostPosted: Thu Sep 16, 2010 22:54    Post subject: Reply with quote

The only one that seemed to be missing was <stdlib.h>
string.h and stdio.h are there already

still getting

make
g++ -mtune=i386 -pipe -Iinclude -DHAVE_CONFIG_H -c -o nwnx2lib.o nwnx2lib.cpp
nwnx2lib.cpp: In function 'void Configure()':
nwnx2lib.cpp:509: warning: deprecated conversion from string constant to 'char*'
nwnx2lib.cpp:516: warning: deprecated conversion from string constant to 'char*'
nwnx2lib.cpp: In function 'void Log(int, const char*, ...)':
nwnx2lib.cpp:619: warning: format not a string literal and no format arguments
nwnx2lib.cpp:625: warning: format not a string literal and no format arguments
nwnx2lib.cpp: In constructor 'startstop::startstop()':
nwnx2lib.cpp:651: warning: format '%p' expects type 'void*', but argument 2 has type 'long unsigned int'
nwnx2lib.cpp:651: warning: format '%p' expects type 'void*', but argument 3 has type 'long unsigned int'
nwnx2lib.cpp:653: warning: format '%p' expects type 'void*', but argument 2 has type 'long unsigned int'
nwnx2lib.cpp:653: warning: format '%p' expects type 'void*', but argument 3 has type 'long unsigned int'
nwnx2lib.cpp: Assembler messages:
nwnx2lib.cpp:463: Warning: indirect jmp without `*'
nwnx2lib.cpp:497: Warning: indirect jmp without `*'
g++ -mtune=i386 -pipe -Iinclude -DHAVE_CONFIG_H -c -o NWNXBase.o NWNXBase.cpp
NWNXBase.cpp: In member function 'int CNWNXBase::ParamLog(int, const char*, char*)':
NWNXBase.cpp:94: error: 'strlen' was not declared in this scope
NWNXBase.cpp:95: error: 'strcpy' was not declared in this scope
NWNXBase.cpp: In member function 'void CNWNXBase::BaseConf()':
NWNXBase.cpp:124: error: 'atoi' was not declared in this scope
make: *** [NWNXBase.o] Error 1
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
drake127



Joined: 26 Jan 2010
Posts: 28

PostPosted: Fri Sep 17, 2010 4:57    Post subject: Reply with quote

Well, THAT's weird. Are you sure you don't have corrupted compiler (if it's gentoo, try to set different profile by gcc-config) or/and includes? Try adding
using namespace std;
after all includes (and before function declarations) but I wouldn't expect it to work.

I incidentally do have Gentoo (Hardened 4.4.4-r2 though) and I am not encountering your errors (it doesn't compile since it's hardened profile trying to prevent "unsafe" actions).

You may have messed up include directory or you are using some terrible profile. If I expect you can compile your own programs could you try to compile following (I didn't test it so there can be some typos - just try it, fix what you can and we'll see).

Code:
#include <cstdlib>
using namespace std;
int main() { return atoi("0"); }

Code:
#include <cstdlib>
using namespace std;
int main() { return _atoi("0"); }

Code:
#include <stdlib.h>
int main() { return atoi("0"); }

Code:
#include <stdlib.h>
using namespace std;
int main() { return atoi("0"); }

Code:
#include <stdlib.h>
int main() { return _atoi("0"); }


Edit: Yeah, try to add #include <cstdlib>
Back to top
View user's profile Send private message
MetaPhaze



Joined: 03 Jun 2007
Posts: 29
Location: USA

PostPosted: Sat Sep 18, 2010 6:31    Post subject: Reply with quote

nwn@xxxxx ~/nwnx $ g++ test_one.cpp
nwn@xxxxx ~/nwnx $ g++ test_two.cpp
test_two.cpp: In function 'int main()':
test_two.cpp:3: error: '_atoi' was not declared in this scope
nwn@xxxxx ~/nwnx $ g++ test_three.cpp
nwn@xxxxx ~/nwnx $ g++ test_four.cpp
nwn@xxxxx ~/nwnx $ g++ test_five.cpp
test_five.cpp: In function 'int main()':
test_five.cpp:2: error: '_atoi' was not declared in this scope
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
MetaPhaze



Joined: 03 Jun 2007
Posts: 29
Location: USA

PostPosted: Sat Sep 18, 2010 15:43    Post subject: Reply with quote

drake127 wrote:
Well, THAT's weird. Are you sure you don't have corrupted compiler (if it's gentoo, try to set different profile by gcc-config) or/and includes? Try adding
using namespace std;
after all includes (and before function declarations) but I wouldn't expect it to work.

I incidentally do have Gentoo (Hardened 4.4.4-r2 though) and I am not encountering your errors (it doesn't compile since it's hardened profile trying to prevent "unsafe" actions).

You may have messed up include directory or you are using some terrible profile. If I expect you can compile your own programs could you try to compile following (I didn't test it so there can be some typos - just try it, fix what you can and we'll see).

Code:
#include <cstdlib>
using namespace std;
int main() { return atoi("0"); }

Code:
#include <cstdlib>
using namespace std;
int main() { return _atoi("0"); }

Code:
#include <stdlib.h>
int main() { return atoi("0"); }

Code:
#include <stdlib.h>
using namespace std;
int main() { return atoi("0"); }

Code:
#include <stdlib.h>
int main() { return _atoi("0"); }


Edit: Yeah, try to add #include <cstdlib>


gcc-config -l
[1] i686-pc-linux-gnu-4.3.4
[2] i686-pc-linux-gnu-4.4.3 *
xxxxx ~ # eselect profile list
Available profile symlink targets:
[1] default/linux/x86/10.0 *
[2] default/linux/x86/10.0/desktop
[3] default/linux/x86/10.0/desktop/gnome
[4] default/linux/x86/10.0/desktop/kde
[5] default/linux/x86/10.0/developer
[6] default/linux/x86/10.0/server
[7] hardened/linux/x86/10.0
[8] selinux/2007.0/x86
[9] selinux/2007.0/x86/hardened
[10] selinux/v2refpolicy/x86
[11] selinux/v2refpolicy/x86/desktop
[12] selinux/v2refpolicy/x86/developer
[13] selinux/v2refpolicy/x86/hardened
[14] selinux/v2refpolicy/x86/server
xxxxx ~ # make -v
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-pc-linux-gnu

pretty sure the compilers good, i don't have any problems anywhere else
i've tried a fresh unpack of the code and i've switched compiler profiles between the two you see above... nothing
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
virusman



Joined: 30 Jan 2005
Posts: 1018
Location: Russia

PostPosted: Sun Nov 07, 2010 22:36    Post subject: Reply with quote

http://www.cyrius.com/journal/gcc/gcc-4.4-include
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
virusman



Joined: 30 Jan 2005
Posts: 1018
Location: Russia

PostPosted: Thu Nov 25, 2010 17:15    Post subject: Reply with quote

I've just downloaded Ubuntu Server 10.10 with gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5) and compiled NWNX without any problems.
So the problem is probably not related to GCC 4.4.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
eeriegeek



Joined: 07 Jan 2008
Posts: 59

PostPosted: Fri Nov 26, 2010 1:29    Post subject: Reply with quote

Just for another data point: within the last month I've downloaded the svn release and built it without problems on both Fedora Core 7 with gcc 4.1.2 and Fedora Core 12 with gcc 4.4.4.
Back to top
View user's profile Send private message
MetaPhaze



Joined: 03 Jun 2007
Posts: 29
Location: USA

PostPosted: Tue Dec 28, 2010 23:12    Post subject: Reply with quote

Alright, I've managed to get past the building now... it builds find but during run time I have other problems.

Note, there is nothing wrong with my compiler, I've rebuilt every package on my system, that's 1,286 packages... and they all work fine...

here are the problems i'm having now... any way to strace this issue? gdb?

NWNX2lib: Init
NWNX2lib: org SetString() at 0x81f41b4, new SetString() at 0xb7776caf
NWNX2lib: org GetObj() at 0x81f40bc, new GetObj() at 0xb7776cd6
* Parsing configuration...
NWN Extender v2.7.1-dev
(c) 2004 by the APS/NWNX Linux Conversion Group
(c) 2007-2009 by virusman and Acaos
Based on the Win32 version (c) 2003 by Ingmar Stieger (Papillon)
and Jeroen Broekhuizen
visit us at http://www.avlis.org

* Searching for signatures...
* Loading modules...
HASHSET plugin registered.
FIXES plugin registered.
LETO plugin registered.
AREAS plugin registered.
FUNCTIONS plugin registered.
MNX plugin registered.
TMI plugin registered.
ERROR: dlopen: ./nwnx_weapons.so: ./nwnx_weapons.so: undefined symbol: WeaponsStrCommandLookup
EVENTS plugin registered.
ERROR: dlopen: ./nwnx_tweaks.so: ./nwnx_tweaks.so: undefined symbol: TweaksStrCommandLookup
ODBC plugin registered.
PROFILER plugin registered.
RESMAN plugin registered.
ERROR: dlopen: ./nwnx_funcs.so: ./nwnx_funcs.so: undefined symbol: FuncsStrCommandLookup
ERROR: dlopen: ./nwnx_defenses.so: ./nwnx_defenses.so: undefined symbol: DefensesStrCommandLookup
RESETPLUGIN plugin registered.
CHAT plugin registered.
ERROR: dlopen: ./nwnx_structs.so: ./nwnx_structs.so: undefined symbol: StructsStrCommandLookup
ERROR: dlopen: ./nwnx_spells.so: ./nwnx_spells.so: undefined symbol: SpellsStrCommandLookup
* NWNX2 activated.
Neverwinter Nights Server
Build:8109
Copyright BioWare Corp 1998-2004

Server: Loading...
Server: Running...

Server: Loading module "mystrixonline_com_v3_1".

the server loads fine, doesn't crash, and throws other errors like these...

............................................................................................................................................................................................................................................................................................................................................................................................................................................................
Server: Module loaded
INIT(S): valid ret=0x082041ec
INIT(O): valid ret=0x08203e79
INIT(S): reset ignored ret=0x082041ec
* Library SYSTEM!GETSYSTEMTIME does not exist.
* Library SYSTEM!GETSYSTEMTIME does not exist.
* Library SYSTEM!GETSYSTEMTIME does not exist.
* Library SYSTEM!GETSYSTEMTIME does not exist.
* Library SYSTEM!GETSYSTEMTIME does not exist.
* Library SYSTEM!GETSYSTEMTIME does not exist.
* Library SYSTEM!GETSYSTEMTIME does not exist.
* Library SYSTEM!GETSYSTEMTIME does not exist.
* Library SYSTEM!GETSYSTEMTIME does not exist.
* Library SYSTEM!GETSYSTEMTIME does not exist.
* Library SYSTEM!GETSYSTEMTIME does not exist.
* Library SYSTEM!GETSYSTEMTIME does not exist.
* Library SYSTEM!GETSYSTEMTIME does not exist.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
MetaPhaze



Joined: 03 Jun 2007
Posts: 29
Location: USA

PostPosted: Tue Dec 28, 2010 23:13    Post subject: Reply with quote

svn update
At revision 367.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support All times are GMT + 2 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
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