Author Topic: NSS Compiler on linux?  (Read 2179 times)

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
NSS Compiler on linux?
« on: August 09, 2014, 09:22:43 pm »


               Can anyone point me in the direction of a ubuntu compatible nss to ncs compiler?

I tried grabbing the one from here

http://sourceforge.n...files/NWNTools/

But I keep getting
./nwnnsscomp: cannot execute binary file: Exec format error

When I try to execute it via ./nwnnsscomp

I've tried with sudo prefixing it and I get


./nwnnsscomp: 1: ./nwnnsscomp: â–’â–’â–’â–’: not found
./nwnnsscomp: 2: ./nwnnsscomp: Syntax error: Unterminated quoted string


tried a few variations

./nwnnsscomp: 1: ./nwnnsscomp: â–’â–’â–’â–’: not found
./nwnnsscomp: 2: ./nwnnsscomp: Syntax error: Unterminated quoted string
ubuntu@ip-10-180-232-33:/var/lib/jenkins/jobs/Rhun_Live/workspace$ sudo ./nwnnsscomp -c "nss/*.nss"
./nwnnsscomp: 1: ./nwnnsscomp: â–’â–’â–’â–’: not found
./nwnnsscomp: 2: ./nwnnsscomp: Syntax error: Unterminated quoted string
ubuntu@ip-10-180-232-33:/var/lib/jenkins/jobs/Rhun_Live/workspace$ sudo ./nwnnsscomp -c nss/*.nss
./nwnnsscomp: 1: ./nwnnsscomp: â–’â–’â–’â–’: not found
./nwnnsscomp: 2: ./nwnnsscomp: Syntax error: Unterminated quoted string



Can someone lend a hand?
               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
NSS Compiler on linux?
« Reply #1 on: August 10, 2014, 01:47:18 pm »


               

That error usually means you are trying to run a 64bit binary on a 32bit OS.  Try "file nwnnsscomp" and "uname -m" and see if you have architecture differences. 


 


I did not see any binaries in those tarballs so did you compile it yourself? It would be hard to see how you would have gotten a 64 bit binary if you built it on your 32bit machine... That it behaves differently when run with sudo is pretty odd. Maybe it's there's some security layer trying to keep you from running unkown binaries?


 


I have a modified and working version of that compiler which you can try if you want. It's got a couple of bug fixes and enhancements, but may run on your ubuntu. PM me if you want to try it.


 


Note also, the version I started with does not work with multiple scripts at a time. You need to put it in a loop to do a whole directory.  You might try that with your sudo version.



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
NSS Compiler on linux?
« Reply #2 on: August 10, 2014, 03:00:06 pm »


               I downloaded this :
http://sourceforge.n...Compiler 1.0.1/

Had trouble compiling it myself - so I just used the compiled version they supplied.

I am using 64bit Ubuntu 14.04 - So I should in theory be able to run 32bit executables if I have the i386 libraries installed.

Yeah- if you could pvt me a link or e-mail me your compiler it would be greatly appreciated - I will IM u my e-mail.

Cheers
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
NSS Compiler on linux?
« Reply #3 on: August 10, 2014, 03:03:43 pm »


               Suddenly occurs to me that that binary might be a tarball
               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
NSS Compiler on linux?
« Reply #4 on: August 10, 2014, 03:13:00 pm »


               

No, it's not a tarball. It's a Mach PPC binary for pre-x86 Macs.  Different kind of architectural incompatibility '<img'>



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
NSS Compiler on linux?
« Reply #5 on: August 10, 2014, 03:20:59 pm »


               Compiling the src from that source forge page gives me the same sort of errors.

I ran a ./configure to see what criteria I satisfy and dont satisfy.



ubuntu@ip-10-180-232-33:~/nwntools/nwntools-2.3.2$ ./configure

checking build system type... x86_64-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking for a BSD-compatible install... /usr/bin/install -c

checking whether build environment is sane... yes

checking for gawk... gawk

checking whether make sets $(MAKE)... yes

checking for g++... g++

checking for C++ compiler default output file name... a.out

checking whether the C++ compiler works... yes

checking whether we are cross compiling... no

checking for suffix of executables...

checking for suffix of object files... o

checking whether we are using the GNU C++ compiler... yes

checking whether g++ accepts -g... yes

checking for style of include used by make... GNU

checking dependency style of g++... gcc3

checking for gcc... gcc

checking whether we are using the GNU C compiler... yes

checking whether gcc accepts -g... yes

checking for gcc option to accept ANSI C... none needed

checking dependency style of gcc... gcc3

checking for ranlib... ranlib

checking for bison... bison -y

checking bison version: 3.0.2

setting bison lalr1 yychar variable name to yylooka

checking for a Python interpreter with version >= 2.2... python

checking for python... /usr/bin/python

checking for python version... 2.7

checking for python platform... linux2

checking for python script directory... ${prefix}/lib/python2.7/site-packages

checking for python extension module directory... ${exec_prefix}/lib/python2.7/site-packages

checking for ebuild... no

checking for rpmbuild... rpmbuild

checking how to run the C preprocessor... gcc -E

checking for egrep... 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 malloc.h usability... yes

checking malloc.h presence... yes

checking for malloc.h... yes

checking stddef.h usability... yes

checking stddef.h presence... yes

checking for stddef.h... yes

checking libiberty.h usability... no

checking libiberty.h presence... no

checking for libiberty.h... no

checking libgen.h usability... yes

checking libgen.h presence... yes

checking for libgen.h... yes

checking ctype.h usability... yes

checking ctype.h presence... yes

checking for ctype.h... yes

checking assert.h usability... yes

checking assert.h presence... yes

checking for assert.h... yes

checking stdarg.h usability... yes

checking stdarg.h presence... yes

checking for stdarg.h... yes

checking for stdbool.h that conforms to C99... yes

checking for _Bool... yes

checking for an ANSI C-conforming const... yes

checking for inline... inline

checking whether byte ordering is bigendian... no

checking for size_t... yes

checking whether struct tm is in sys/time.h or time.h... time.h

checking for stricmp... no

checking for strcasecmp... yes

checking for strnicmp... no

checking for strncasecmp... yes

checking for _snprintf... no

checking for snprintf... yes

checking for strlwr... no

checking for alloca... no

checking for malloc... yes

checking for memcmp... yes

checking for realloc... yes

checking for free... yes

checking for stdtod... no

checking for vprintf... yes

checking for memmove... yes

checking for memset... yes

checking for pow... no

checking for sqrt... no

checking for strchr... yes

checking for strrchr... yes

checking for strtol... yes

checking for basename... yes

configure: creating ./config.status

config.status: creating _MathLib/Makefile

config.status: creating _NscLib/Makefile

config.status: creating _NwnLib/Makefile

config.status: creating _NmcLib/Makefile

config.status: creating Makefile

config.status: creating nwntools.spec

config.status: creating nwnnsscomp/Makefile

config.status: creating nwnnsscomp/python/Makefile

config.status: creating nwnmdlcomp/Makefile

config.status: creating config.h

config.status: executing depfiles commands

ubuntu@ip-10-180-232-33:~/nwntools/nwntools-2.3.2$ make

make all-recursive

make[1]: Entering directory `/home/ubuntu/nwntools/nwntools-2.3.2'

Making all in _MathLib

make[2]: Entering directory `/home/ubuntu/nwntools/nwntools-2.3.2/_MathLib'

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT Frustum.o -MD -MP -MF ".deps/Frustum.Tpo" -c -o Frustum.o Frustum.cpp; \

then mv -f ".deps/Frustum.Tpo" ".deps/Frustum.Po"; else rm -f ".deps/Frustum.Tpo"; exit 1; fi

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT Matrix.o -MD -MP -MF ".deps/Matrix.Tpo" -c -o Matrix.o Matrix.cpp; \

then mv -f ".deps/Matrix.Tpo" ".deps/Matrix.Po"; else rm -f ".deps/Matrix.Tpo"; exit 1; fi

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT Quaternion.o -MD -MP -MF ".deps/Quaternion.Tpo" -c -o Quaternion.o Quaternion.cpp; \

then mv -f ".deps/Quaternion.Tpo" ".deps/Quaternion.Po"; else rm -f ".deps/Quaternion.Tpo"; exit 1; fi

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT Vector2.o -MD -MP -MF ".deps/Vector2.Tpo" -c -o Vector2.o Vector2.cpp; \

then mv -f ".deps/Vector2.Tpo" ".deps/Vector2.Po"; else rm -f ".deps/Vector2.Tpo"; exit 1; fi

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT Vector3.o -MD -MP -MF ".deps/Vector3.Tpo" -c -o Vector3.o Vector3.cpp; \

then mv -f ".deps/Vector3.Tpo" ".deps/Vector3.Po"; else rm -f ".deps/Vector3.Tpo"; exit 1; fi

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT Vector4.o -MD -MP -MF ".deps/Vector4.Tpo" -c -o Vector4.o Vector4.cpp; \

then mv -f ".deps/Vector4.Tpo" ".deps/Vector4.Po"; else rm -f ".deps/Vector4.Tpo"; exit 1; fi

rm -f libmath.a

ar cru libmath.a Frustum.o Matrix.o Quaternion.o Vector2.o Vector3.o Vector4.o

ranlib libmath.a

make[2]: Leaving directory `/home/ubuntu/nwntools/nwntools-2.3.2/_MathLib'

Making all in _NwnLib

make[2]: Entering directory `/home/ubuntu/nwntools/nwntools-2.3.2/_NwnLib'

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT NwnBifFile.o -MD -MP -MF ".deps/NwnBifFile.Tpo" -c -o NwnBifFile.o NwnBifFile.cpp; \

then mv -f ".deps/NwnBifFile.Tpo" ".deps/NwnBifFile.Po"; else rm -f ".deps/NwnBifFile.Tpo"; exit 1; fi

NwnBifFile.cpp: In member function ‘bool CNwnBifFile::Open(const char*)’:

NwnBifFile.cpp:119:47: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]

fread (&m_sHeader, 1, sizeof (m_sHeader), fp);

^

NwnBifFile.cpp:141:65: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]

fread (m_pasRes, 1, m_sHeader .ulCount * sizeof (Resource), fp);

^

NwnBifFile.cpp: In member function ‘unsigned char* CNwnBifFile::LoadRes(UINT32, UINT32*, bool*)’:

NwnBifFile.cpp:229:44: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]

fread (pauchData, 1, psRes ->ulLength, fp);

^

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT NwnDefines.o -MD -MP -MF ".deps/NwnDefines.Tpo" -c -o NwnDefines.o NwnDefines.cpp; \

then mv -f ".deps/NwnDefines.Tpo" ".deps/NwnDefines.Po"; else rm -f ".deps/NwnDefines.Tpo"; exit 1; fi

NwnDefines.cpp: In function ‘unsigned char* NwnLoadFile(const char*, UINT32*)’:

NwnDefines.cpp:341:33: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]

fread (pauchData, 1, lSize, fp);

^

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT NwnKeyFile.o -MD -MP -MF ".deps/NwnKeyFile.Tpo" -c -o NwnKeyFile.o NwnKeyFile.cpp; \

then mv -f ".deps/NwnKeyFile.Tpo" ".deps/NwnKeyFile.Po"; else rm -f ".deps/NwnKeyFile.Tpo"; exit 1; fi

NwnKeyFile.cpp: In member function ‘CNwnBifFile* CNwnKeyFile::OpenBif(int)’:

NwnKeyFile.cpp:325:10: warning: converting ‘false’ to pointer type ‘CNwnBifFile*’ [-Wconversion-null]

return false;

^

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT NwnLoader.o -MD -MP -MF ".deps/NwnLoader.Tpo" -c -o NwnLoader.o NwnLoader.cpp; \

then mv -f ".deps/NwnLoader.Tpo" ".deps/NwnLoader.Po"; else rm -f ".deps/NwnLoader.Tpo"; exit 1; fi

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT NwnModuleFile.o -MD -MP -MF ".deps/NwnModuleFile.Tpo" -c -o NwnModuleFile.o NwnModuleFile.cpp; \

then mv -f ".deps/NwnModuleFile.Tpo" ".deps/NwnModuleFile.Po"; else rm -f ".deps/NwnModuleFile.Tpo"; exit 1; fi

NwnModuleFile.cpp: In member function ‘bool CNwnModuleFile::Open(const char*)’:

NwnModuleFile.cpp:127:47: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]

fread (&m_sHeader, 1, sizeof (m_sHeader), fp);

^

NwnModuleFile.cpp:161:64: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]

fread (m_pasRes, m_sHeader .ulResCount, sizeof (Resource), fp);

^

NwnModuleFile.cpp:163:69: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]

fread (m_pasPosition, m_sHeader .ulResCount, sizeof (Position), fp);

^

NwnModuleFile.cpp:165:61: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]

fread (m_pauchStrings, m_sHeader .ulStringTotalSize, 1, fp);

^

NwnModuleFile.cpp: In member function ‘unsigned char* CNwnModuleFile::LoadRes(const CNwnModuleFile::Resource*, UINT32*, bool*)’:

NwnModuleFile.cpp:291:44: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]

fread (pauchData, 1, psPos ->ulLength, fp);

^

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT NwnStdLoader.o -MD -MP -MF ".deps/NwnStdLoader.Tpo" -c -o NwnStdLoader.o NwnStdLoader.cpp; \

then mv -f ".deps/NwnStdLoader.Tpo" ".deps/NwnStdLoader.Po"; else rm -f ".deps/NwnStdLoader.Tpo"; exit 1; fi

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT NwnDialogTlkFile.o -MD -MP -MF ".deps/NwnDialogTlkFile.Tpo" -c -o NwnDialogTlkFile.o NwnDialogTlkFile.cpp; \

then mv -f ".deps/NwnDialogTlkFile.Tpo" ".deps/NwnDialogTlkFile.Po"; else rm -f ".deps/NwnDialogTlkFile.Tpo"; exit 1; fi

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT NwnMdlDecomp.o -MD -MP -MF ".deps/NwnMdlDecomp.Tpo" -c -o NwnMdlDecomp.o NwnMdlDecomp.cpp; \

then mv -f ".deps/NwnMdlDecomp.Tpo" ".deps/NwnMdlDecomp.Po"; else rm -f ".deps/NwnMdlDecomp.Tpo"; exit 1; fi

NwnMdlDecomp.cpp: In member function ‘void CNwnMdlNodeHeader::Decompile(CNwnStream*, CNwnMdlModel*, CNwnMdlGeometryHeader*, CNwnMdlNodeHeader*, bool, bool, bool, unsigned char*, unsigned char*)’:

NwnMdlDecomp.cpp:495:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pszText = "dummy";

^

NwnMdlDecomp.cpp:498:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pszText = "light";

^

NwnMdlDecomp.cpp:501:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pszText = "emitter";

^

NwnMdlDecomp.cpp:504:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pszText = "camera";

^

NwnMdlDecomp.cpp:507:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pszText = "reference";

^

NwnMdlDecomp.cpp:510:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pszText = "trimesh";

^

NwnMdlDecomp.cpp:513:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pszText = "skin";

^

NwnMdlDecomp.cpp:516:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pszText = "animmesh";

^

NwnMdlDecomp.cpp:519:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pszText = "danglymesh";

^

NwnMdlDecomp.cpp:522:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pszText = "aabb";

^

NwnMdlDecomp.cpp:525:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pszText = "unknown";

^

NwnMdlDecomp.cpp:540:11: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pszText = "NULL";

^

NwnMdlDecomp.cpp:613:66: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

" texturenames %d", pLight ->m_apszTextureNames .GetCount ());

^

NwnMdlDecomp.cpp:613:66: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

NwnMdlDecomp.cpp:628:60: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

" flaresizes %d", pLight ->m_afFlareSizes .GetCount ());

^

NwnMdlDecomp.cpp:628:60: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

NwnMdlDecomp.cpp:643:68: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

" flarepositions %d", pLight ->m_afFlarePositions .GetCount ());

^

NwnMdlDecomp.cpp:643:68: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

NwnMdlDecomp.cpp:658:72: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

" flarecolorshifts %d", pLight ->m_avFlareColorShifts .GetCount ());

^

NwnMdlDecomp.cpp:658:72: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

NwnMdlDecomp.cpp:1186:60: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

" texindices%d %d", ti, pMesh ->m_sFaces .GetCount ());

^

NwnMdlDecomp.cpp:1186:60: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

NwnMdlDecomp.cpp:1344:16: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pszText = "invalidnodeindex";

^

NwnMdlDecomp.cpp: In function ‘void AABBEntryDecomp(CNwnStream*, NwnMdlAABBEntry*, unsigned char*, int)’:

NwnMdlDecomp.cpp:1755:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

pszDepth = " aabb";

^

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT NwnMdlGeometry.o -MD -MP -MF ".deps/NwnMdlGeometry.Tpo" -c -o NwnMdlGeometry.o NwnMdlGeometry.cpp; \

then mv -f ".deps/NwnMdlGeometry.Tpo" ".deps/NwnMdlGeometry.Po"; else rm -f ".deps/NwnMdlGeometry.Tpo"; exit 1; fi

In file included from NwnMdlGeometry.cpp:43:0:

NwnModel.h:76:67: warning: ‘__cdecl__’ attribute ignored [-Wattributes]

void *pData, bool fIsGeometryHeader, UINT32 ulFlags, int nOffset);

^

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT NwnMdlNodes.o -MD -MP -MF ".deps/NwnMdlNodes.Tpo" -c -o NwnMdlNodes.o NwnMdlNodes.cpp; \

then mv -f ".deps/NwnMdlNodes.Tpo" ".deps/NwnMdlNodes.Po"; else rm -f ".deps/NwnMdlNodes.Tpo"; exit 1; fi

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT NwnMdlR2A.o -MD -MP -MF ".deps/NwnMdlR2A.Tpo" -c -o NwnMdlR2A.o NwnMdlR2A.cpp; \

then mv -f ".deps/NwnMdlR2A.Tpo" ".deps/NwnMdlR2A.Po"; else rm -f ".deps/NwnMdlR2A.Tpo"; exit 1; fi

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT NwnMdlSerialize.o -MD -MP -MF ".deps/NwnMdlSerialize.Tpo" -c -o NwnMdlSerialize.o NwnMdlSerialize.cpp; \

then mv -f ".deps/NwnMdlSerialize.Tpo" ".deps/NwnMdlSerialize.Po"; else rm -f ".deps/NwnMdlSerialize.Tpo"; exit 1; fi

rm -f libnwn.a

ar cru libnwn.a NwnBifFile.o NwnDefines.o NwnKeyFile.o NwnLoader.o NwnModuleFile.o NwnStdLoader.o NwnDialogTlkFile.o NwnMdlDecomp.o NwnMdlGeometry.o NwnMdlNodes.o NwnMdlR2A.o NwnMdlSerialize.o

ranlib libnwn.a

make[2]: Leaving directory `/home/ubuntu/nwntools/nwntools-2.3.2/_NwnLib'

Making all in _NscLib

make[2]: Entering directory `/home/ubuntu/nwntools/nwntools-2.3.2/_NscLib'

bison -y --defines=NscParser.h --skeleton=lalr1.cc NscParser.ypp

NscParser.ypp: warning: 11 shift/reduce conflicts [-Wconflicts-sr]

if test -f y.tab.h; then \

to=`echo "NscParser_H" | sed \

-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \

-e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \

sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|NscParser.h|" \

y.tab.h >NscParser.ht; \

rm -f y.tab.h; \

if cmp -s NscParser.ht NscParser.h; then \

rm -f NscParser.ht ;\

else \

mv NscParser.ht NscParser.h; \

fi; \

fi

if test -f y.output; then \

mv y.output NscParser.output; \

fi

sed '/^#/ s|y\.tab\.c|NscParser.cpp|' y.tab.c >NscParser.cppt && mv NscParser.cppt NscParser.cpp

rm -f y.tab.c

make all-am

make[3]: Entering directory `/home/ubuntu/nwntools/nwntools-2.3.2/_NscLib'

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT NscCodeGenerator.o -MD -MP -MF ".deps/NscCodeGenerator.Tpo" -c -o NscCodeGenerator.o NscCodeGenerator.cpp; \

then mv -f ".deps/NscCodeGenerator.Tpo" ".deps/NscCodeGenerator.Po"; else rm -f ".deps/NscCodeGenerator.Tpo"; exit 1; fi

In file included from NscCodeGenerator.h:50:0,

from NscCodeGenerator.cpp:42:

NscContext.h: In member function ‘void CNscContext::GenerateError(const char*, const char*, __va_list_tag*)’:

NscContext.h:672:26: warning: format not a string literal and no format arguments [-Wformat-security]

printf(prefix);

^

NscContext.h:675:25: warning: format not a string literal and no format arguments [-Wformat-security]

printf(error);

^

NscCodeGenerator.cpp: In member function ‘bool CNscCodeGenerator::GenerateOutput(CNwnStream*, CNwnStream*)’:

NscCodeGenerator.cpp:585:26: warning: format ‘%d’ expects argument of type ‘int’, but argument 7 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

m_asLines .GetCount ());

^

NscCodeGenerator.cpp:664:52: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

pExtra ->nArgCount, szType, pSymbol ->szString);

^

NscCodeGenerator.cpp:664:52: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

NscCodeGenerator.cpp:708:50: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

nLoaderStart, nLoaderEnd, 0, szType, "#loader");

^

NscCodeGenerator.cpp:708:50: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

NscCodeGenerator.cpp:716:51: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

nGlobalsStart, nGlobalsEnd, 0, "v", "#globals");

^

NscCodeGenerator.cpp:716:51: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

NscCodeGenerator.cpp:727:46: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

nRetValPos, 0xffffffff, 0, "i", "#retval");

^

NscCodeGenerator.cpp:743:60: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

pSymbol ->nStackOffset * 4, szType, pSymbol ->szString);

^

NscCodeGenerator.cpp:743:60: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

NscCodeGenerator.cpp:758:59: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

pSymbol ->nStackOffset * 4, szType, pSymbol ->szString);

^

NscCodeGenerator.cpp:758:59: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

NscCodeGenerator.cpp:770:63: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

m_asLines .nCompiledStart, m_asLines .nCompiledEnd);

^

NscCodeGenerator.cpp:770:63: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘size_t {aka long unsigned int}’ [-Wformat=]

In file included from NscCodeGenerator.h:50:0,

from NscCodeGenerator.cpp:42:

NscContext.h: In member function ‘void CNscContext::GenerateError(const char*, const char*, __va_list_tag*)’:

NscContext.h:665:51: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]

asprintf (&prefix,"%s: ", pszType);

^

NscContext.h:670:57: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]

m_pStreamTop ->nLine, pszType);

^

NscContext.h:674:47: warning: ignoring return value of ‘int vasprintf(char**, const char*, __va_list_tag*)’, declared with attribute warn_unused_result [-Wunused-result]

vasprintf (&error,pszText, marker);

^

if g++ -DHAVE_CONFIG_H -I. -I. -I.. -fno-default-inline -g -O2 -MT NscCompiler.o -MD -MP -MF ".deps/NscCompiler.Tpo" -c -o NscCompiler.o NscCompiler.cpp; \

then mv -f ".deps/NscCompiler.Tpo" ".deps/NscCompiler.Po"; else rm -f ".deps/NscCompiler.Tpo"; exit 1; fi

In file included from NscCompiler.cpp:42:0:

NscContext.h: In member function ‘void CNscContext::GenerateError(const char*, const char*, __va_list_tag*)’:

NscContext.h:672:26: warning: format not a string literal and no format arguments [-Wformat-security]

printf(prefix);

^

NscContext.h:675:25: warning: format not a string literal and no format arguments [-Wformat-security]

printf(error);

^

NscCompiler.cpp: In function ‘bool NscCompilerInitialize(CNwnLoader*, int, bool)’:

NscCompiler.cpp:110:33: error: ‘INT_TYPE’ was not declared in this scope

NscAddToken ("int", INT_TYPE);

^

NscCompiler.cpp:111:33: error: ‘FLOAT_TYPE’ was not declared in this scope

NscAddToken ("float", FLOAT_TYPE);

^

NscCompiler.cpp:112:33: error: ‘OBJECT_TYPE’ was not declared in this scope

NscAddToken ("object", OBJECT_TYPE);

^

NscCompiler.cpp:113:33: error: ‘STRING_TYPE’ was not declared in this scope

NscAddToken ("string", STRING_TYPE);

^

NscCompiler.cpp:114:33: error: ‘STRUCT_TYPE’ was not declared in this scope

NscAddToken ("struct", STRUCT_TYPE);

^

NscCompiler.cpp:115:33: error: ‘VOID_TYPE’ was not declared in this scope

NscAddToken ("void", VOID_TYPE);

^

NscCompiler.cpp:116:33: error: ‘VECTOR_TYPE’ was not declared in this scope

NscAddToken ("vector", VECTOR_TYPE);

^

NscCompiler.cpp:117:33: error: ‘ACTION_TYPE’ was not declared in this scope

NscAddToken ("action", ACTION_TYPE);

^

NscCompiler.cpp:119:33: error: ‘BREAK’ was not declared in this scope

NscAddToken ("break", BREAK);

^

NscCompiler.cpp:120:33: error: ‘CASE’ was not declared in this scope

NscAddToken ("case", CASE);

^

NscCompiler.cpp:121:33: error: ‘CONTINUE’ was not declared in this scope

NscAddToken ("continue", CONTINUE);

^

NscCompiler.cpp:122:33: error: ‘DEFAULT’ was not declared in this scope

NscAddToken ("default", DEFAULT);

^

NscCompiler.cpp:123:33: error: ‘DO’ was not declared in this scope

NscAddToken ("do", DO);

^

NscCompiler.cpp:124:33: error: ‘ELSE’ was not declared in this scope

NscAddToken ("else", ELSE);

^

NscCompiler.cpp:125:33: error: ‘FOR’ was not declared in this scope

NscAddToken ("for", FOR);

^

NscCompiler.cpp:126:33: error: ‘IF’ was not declared in this scope

NscAddToken ("if", IF);

^

NscCompiler.cpp:127:33: error: ‘RETURN’ was not declared in this scope

NscAddToken ("return", RETURN);

^

NscCompiler.cpp:128:33: error: ‘SWITCH’ was not declared in this scope

NscAddToken ("switch", SWITCH);

^

NscCompiler.cpp:129:33: error: ‘WHILE’ was not declared in this scope

NscAddToken ("while", WHILE);

^

NscCompiler.cpp:131:36: error: ‘NWCONST’ was not declared in this scope

NscAddToken ("const", NWCONST);

^

NscCompiler.cpp:133:33: error: ‘OBJECT_SELF_CONST’ was not declared in this scope

NscAddToken ("OBJECT_SELF", OBJECT_SELF_CONST);

^

NscCompiler.cpp:134:33: error: ‘OBJECT_INVALID_CONST’ was not declared in this scope

NscAddToken ("OBJECT_INVALID", OBJECT_INVALID_CONST);

^

NscCompiler.cpp: At global scope:

NscCompiler.cpp:376:31: error: ‘location_type’ in ‘class yy::parser’ does not name a type

void yy::parser::error (const yy::parser::location_type& l,

^

NscCompiler.cpp:376:58: error: ISO C++ forbids declaration of ‘l’ with no type [-fpermissive]

void yy::parser::error (const yy::parser::location_type& l,

^

NscCompiler.cpp:376:6: error: prototype for ‘void yy::parser::error(const int&, const string&)’ does not match any in class ‘yy::parser’

void yy::parser::error (const yy::parser::location_type& l,

^

In file included from NscContext.h:56:0,

from NscCompiler.cpp:42:

NscParser.h:302:10: error: candidates are: void yy::parser::error(const yy::parser::syntax_error&)

void error (const syntax_error& err);

^

NscParser.h:299:18: error: virtual void yy::parser::error(const string&)

virtual void error (const std::string& msg);

^

make[3]: *** [NscCompiler.o] Error 1

make[3]: Leaving directory `/home/ubuntu/nwntools/nwntools-2.3.2/_NscLib'

make[2]: *** [all] Error 2

make[2]: Leaving directory `/home/ubuntu/nwntools/nwntools-2.3.2/_NscLib'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/home/ubuntu/nwntools/nwntools-2.3.2'

make: *** [all] Error 2




the Errors are included too
               
               

               
            

Legacy_leo_x

  • Sr. Member
  • ****
  • Posts: 403
  • Karma: +0/-0
NSS Compiler on linux?
« Reply #6 on: August 10, 2014, 03:41:30 pm »


               

One option if you don't get something else working is could try building from Elven/niv's github repo: https://github.com/niv/nwn-tools. It has worked for me on 32bit Linux at least and I presume he actively uses it. 



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
NSS Compiler on linux?
« Reply #7 on: August 10, 2014, 04:20:23 pm »


               Im spinning up a 32bit instance now to see if it makes a difference.
The Elven/Niv repo was giving the same errors on the 64bit instance: Unfortuantely I built my entire CI on a 64bit server, and it cannot be downgraded - so I will have to try and build from scratch using the 64bit one as a template.
Oh well...
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
NSS Compiler on linux?
« Reply #8 on: August 10, 2014, 04:26:07 pm »


               Strange - 32bit Ubuntu gets same error

Installed Git to clone the repo
Installed Build-Essential
Installed Bison
Installed CMake

executed cmake CMakeLists.txt
then executed make

and then I get

Scanning dependencies of target nsc
[ 77%] Building CXX object _NscLib/CMakeFiles/nsc.dir/NscCodeGenerator.cpp.o
[ 80%] Building CXX object _NscLib/CMakeFiles/nsc.dir/NscCompiler.cpp.o
/home/ubuntu/nwn-tools/_NscLib/NscCompiler.cpp:376:31: error: ‘location_type’ in ‘class yy::parser’ does not name a type
void yy::parser::error (const yy::parser::location_type& l,
^
/home/ubuntu/nwn-tools/_NscLib/NscCompiler.cpp:376:58: error: ISO C++ forbids declaration of ‘l’ with no type [-fpermissive]
void yy::parser::error (const yy::parser::location_type& l,
^
/home/ubuntu/nwn-tools/_NscLib/NscCompiler.cpp:376:6: error: prototype for ‘void yy::parser::error(const int&, const string&)’ does not match any in class ‘yy::parser’
void yy::parser::error (const yy::parser::location_type& l,
^
In file included from /home/ubuntu/nwn-tools/_NscLib/NscContext.h:56:0,
from /home/ubuntu/nwn-tools/_NscLib/NscCompiler.cpp:42:
NscParser.hpp:302:10: error: candidates are: void yy::parser::error(const yy::parser::syntax_error&)
void error (const syntax_error& err);
^
NscParser.hpp:299:18: error: virtual void yy::parser::error(const string&)
virtual void error (const std::string& msg);
^
make[2]: *** [_NscLib/CMakeFiles/nsc.dir/NscCompiler.cpp.o] Error 1
make[1]: *** [_NscLib/CMakeFiles/nsc.dir/all] Error 2



Any ideas?
Is there more dependencies I am missing?
               
               

               
            

Legacy_leo_x

  • Sr. Member
  • ****
  • Posts: 403
  • Karma: +0/-0
NSS Compiler on linux?
« Reply #9 on: August 11, 2014, 10:03:16 am »


               

Not sure, I didn't get that error building on 32bit or 64bit.  Bison 2.7.12-4996, GCC 4.8.1, Ubuntu 13.10.  Could be a new version of Bison is the problem, but I'm not sure.  You could try downgrading see if that's the issue: http://askubuntu.com...in-ubuntu-14-04


 


Edit: Just tried on Ubuntu 14.04 64bit, Bison 3.0.2 and got the same error that you did.  There also seem to be some errors building the parser so if you're using Bison 3, I think downgrading will solve your problem.



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
NSS Compiler on linux?
« Reply #10 on: August 11, 2014, 02:33:44 pm »


               

Thanks - I managed to get a compiled version from meaglyn who was kind enough to email me the compiled binary.


 


I've got my CI working to the point where it can compile nss into ncs and then construct a module file outside of toolset all in Jenkins, it can then even spin up a Ubuntu server in Amazon EC2 deploy the module automatically, and start it up for debugging.


 


Seems like a somewhat good approach for collaborative mod development.



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
NSS Compiler on linux?
« Reply #11 on: November 21, 2014, 01:42:09 pm »


               

Has anyone had issues with the linux script compiler where it fails to compile if you have case statements like this?



 switch(iClass)
                    {
                        case CLASS_TYPE_WIZARD:
                                sColumn = "Wiz_Sorc";
                                sClass = "Wizard";
                                iWizSorc=1;
                        break;
                        case CLASS_TYPE_SORCERER:
                                sColumn = "Wiz_Sorc";
                                sClass = "Sorcerer";
                                iWizSorc=1;
                        break;
                        case CLASS_TYPE_BARD:
                                sColumn = "Bard";
                                sClass = "Bard";
                                iWizSorc=1;
                        break;
                        case CLASS_TYPE_RANGER:
                                sColumn = "Ranger";
                                sClass = "Ranger";
                                iWizSorc=0;
                        break;
                        case CLASS_TYPE_DRUID:
                                sColumn = "Druid";
                                sClass = "Druid";
                                iWizSorc=0;
                        break;
                        case CLASS_TYPE_CLERIC:
                                sColumn = "Cleric";
                                sClass = "Cleric";
                                iWizSorc=0;
                        break;
                        case CLASS_TYPE_PALADIN || CLASS_TYPE_DIVINECHAMPION || CLASS_TYPE_DIVINE_CHAMPION:
                                sColumn = "Paladin";
                                sClass = "Paladin";
                                iWizSorc=0;
                        break;
                        case CLASS_TYPE_PALE_MASTER || CLASS_TYPE_PALEMASTER:
                                sColumn = "Wiz_Sorc";
                                sClass = "Sorcerer";
                                iWizSorc = 1;
                        break;
                        case CLASS_TYPE_DRAGON_DISCIPLE || CLASS_TYPE_DRAGONDISCIPLE:
                                sColumn = "Wiz_Sorc";
                                sClass = "Sorcerer";
                                iWizSorc = 1;
                        break;
                    }



+ /var/lib/nwnnsscomp/nwnnsscomp -s -p /home/ubuntu/downl/nwn fae_area_exit.nss

Compiling: fae_area_exit.nss

fae_inc.nss(239): Error: Non-constant value specified for "case" statement

fae_inc.nss(244): Error: Non-constant value specified for "case" statement

fae_inc.nss(249): Error: Non-constant value specified for "case" statement

Compilation aborted with errors

Errors occurred in compiling "fae_area_exit.nss"



 


Im guessing it doesnt handle compounded 'OR' conditionals 


I could just split them over more lines I suppose



               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
NSS Compiler on linux?
« Reply #12 on: November 21, 2014, 06:20:19 pm »


               

Do case statements work that way?


 


I usually do this instead:



case CLASS_TYPE_PALADIN:
case CLASS_TYPE_DIVINECHAMPION:
case CLASS_TYPE_DIVINE_CHAMPION:
    sColumn = "Paladin";
    sClass = "Paladin";
    iWizSorc=0;
break;

               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
NSS Compiler on linux?
« Reply #13 on: November 22, 2014, 10:02:47 pm »


               

Case values have to be non evaluated constants. Henesua's code is the way to have multiple cases run the same code.


 


You have to do the same if you were using an if statement.  You would not write  "if (nType == CLASS_TYPE_PALADIN || CLASS_TYPE_DIVINECHAMPION)"


               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
NSS Compiler on linux?
« Reply #14 on: November 24, 2014, 09:38:39 am »


               

Oh, weird.


I guess because the toolset compiler allowed it I just assumed it was a valid way of doing them.


 


Odd