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



Joined: 24 Jun 2008
Posts: 14

PostPosted: Tue Jun 24, 2008 16:21    Post subject: GCC 4.3.0 Reply with quote

I'm getting errors while running "make install"

Code:

[nordock@localhost linnwnx2]$ make install
g++  -march=athlon-xp   -c -o nwnx2lib.o nwnx2lib.cpp
nwnx2lib.cpp: In function âvoid Configure()â:
nwnx2lib.cpp:362: warning: deprecated conversion from string constant to âchar*â
nwnx2lib.cpp:369: warning: deprecated conversion from string constant to âchar*â
nwnx2lib.cpp:374: error: âatoiâ was not declared in this scope
nwnx2lib.cpp:379: error: âatoiâ was not declared in this scope
make: *** [nwnx2lib.o] Error 1


The section of the nwnx2lib.cpp file this refers to is:
Code:

void Configure() {
   FILE *logfp;
   char *logfilename,logfqpn[256];

   // Directory to stuff plugin logfiles
   if(nwnxConfig.exists("LogDir","logdir")) {
      logDir = (char*)(nwnxConfig["LogDir"]["logdir"].c_str());
   } else {
      printf("CONFIG: nwnx2.ini: [LogDir]logdir is missing!  Using current directory\n");
      logDir = ".";
   }

   // Logfilename
   if(nwnxConfig.exists("NWNX","logfile")) {
      logfilename= (char*)(nwnxConfig["NWNX"]["logfile"].c_str());
   } else {
      logfilename= "nwnx2.txt";
   }

   // Global debug level
   if(nwnxConfig.exists("Debug","debuglevel")) {
      debuglevel = atoi(nwnxConfig["Debug"]["debuglevel"].c_str());
   }

   // Extender debug level
   if(nwnxConfig.exists("NWNX","debuglevel")) {
      xdbglevel = atoi(nwnxConfig["NWNX"]["debuglevel"].c_str());
   } else {
      xdbglevel = debuglevel;
   }

   // Turn off NWNX!INIT enforcement
   if(nwnxConfig.exists("NWNX","disablenwnxinit") &&
      toupper(nwnxConfig["NWNX"]["disablenwnxinit"].c_str()[0])=='Y') {
      nwnxinitdisabled=1;
   }

   // create Fully Qualified Path Name
   sprintf(logfqpn,"%s/%s",logDir,logfilename);

   // open it for writing
   if((logfp=fopen(logfqpn,"w"))==NULL) {
      printf("WARNING! Unable to open \"%s\" for write, using stdout\n",
            logfqpn);
   } else {
      logFile = logfp;
   }

}

I'm using linnwnx2-2.5.3-rc1 on a Fedora 9 OS setup with GCC 4.3.0. I have compiled NWNX2 on my older Fedora 7 system with no errors.

Is this a compiler issue with GCC 4.3.0?
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Tue Jun 24, 2008 17:38    Post subject: Reply with quote

You don't need to run make install. Just run:

./configure
make

And copy the .so files into your NWN directory. Then you can run:

make clean
make distclean

To clean up the compile directory.


Last edited by Fireboar on Sat Jul 05, 2008 22:24; edited 1 time in total
Back to top
View user's profile Send private message
Abraxsis



Joined: 24 Jun 2008
Posts: 14

PostPosted: Wed Jun 25, 2008 0:41    Post subject: Reply with quote

Fireboar wrote:
You don't need to run make install. Just run:

./configure
make

The errors are the same.

I deleted the linwnx2 directory, unpacked it again, and ran ./configure & make to be certain, but still the same errors I posted above (except of course in a fresh unpack -mcpu=i386 was used in the g++ command instead of -march=athlon-xp for this specific systems athlon 32 bit processor).

Given the warnings/errors, I am still wondering if changes in GCC 4.3.0 are the cause.
Back to top
View user's profile Send private message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Wed Jun 25, 2008 4:28    Post subject: Reply with quote

Sounds like your includes are broken?

atoi is a fairly standard function.
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Wed Jun 25, 2008 7:19    Post subject: Reply with quote

This happens due to a change in GCC 4.3:
http://www.cyrius.com/journal/2007/05/10#gcc-4.3-include
I will upload a fix for this to SVN today, in the meantime you can add the following line to includes in nwnx2lib.cpp:
Code:
#include <stdlib.h>
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Abraxsis



Joined: 24 Jun 2008
Posts: 14

PostPosted: Thu Jun 26, 2008 1:02    Post subject: Reply with quote

I thought changes in GCC 4.3.0 were probably causing these errors.

I added #include <stdlib.h> to nwnx2lib.cpp and compiled with the following errors:
Code:

[nordock@localhost linnwnx2]$ make install
g++  -march=athlon-xp   -c -o nwnx2lib.o nwnx2lib.cpp
nwnx2lib.cpp: In function âvoid Configure()â:
nwnx2lib.cpp:363: warning: deprecated conversion from string constant to âchar*â
nwnx2lib.cpp:370: warning: deprecated conversion from string constant to âchar*â
g++  -march=athlon-xp   -c -o NWNXBase.o NWNXBase.cpp
NWNXBase.cpp: In member function âint CNWNXBase::ParamLog(int, const char*, char*)â:
NWNXBase.cpp:89: error: âstrlenâ was not declared in this scope
NWNXBase.cpp:90: error: âstrcpyâ was not declared in this scope
NWNXBase.cpp: In member function âvoid CNWNXBase::BaseConf()â:
NWNXBase.cpp:119: error: âatoiâ was not declared in this scope
make: *** [NWNXBase.o] Error 1


Then I added #include <stdlib.h> to NWNXBase.cpp which took care of a few more errors and gave the following output:
Code:

[nordock@localhost linnwnx2]$ make install
g++  -march=athlon-xp   -c -o NWNXBase.o NWNXBase.cpp
NWNXBase.cpp: In member function âint CNWNXBase::ParamLog(int, const char*, char*)â:
NWNXBase.cpp:90: error: âstrlenâ was not declared in this scope
NWNXBase.cpp:91: error: âstrcpyâ was not declared in this scope
make: *** [NWNXBase.o] Error 1


There is still something missing, however you're definitely making headway towards compiling with GCC 4.3.0.
Back to top
View user's profile Send private message
Skywing



Joined: 03 Jan 2008
Posts: 321

PostPosted: Thu Jun 26, 2008 2:26    Post subject: Reply with quote

Try <string.h> for those remainders, perhaps?
Back to top
View user's profile Send private message
Abraxsis



Joined: 24 Jun 2008
Posts: 14

PostPosted: Sat Jun 28, 2008 0:03    Post subject: Reply with quote

Adding <string.h> to NWNXBase.cpp allowed the compile to continue, but not finish.

Code:

[nordock@localhost linnwnx2]$ make install
make -C db
make[1]: Entering directory `/home/nordock/linnwnx2/db'
g++  -march=athlon-xp  -I..  -c -o NWNXmysql.o NWNXmysql.cpp
In file included from NWNXmysql.h:17,
                 from NWNXmysql.cpp:20:
../db/dbmysql.h:27:25: error: mysql/mysql.h: No such file or directory
In file included from NWNXmysql.h:17,
                 from NWNXmysql.cpp:20:
../db/dbmysql.h:40: error: âMYSQLâ does not name a type
../db/dbmysql.h:41: error: ISO C++ forbids declaration of âMYSQL_RESâ with no type
../db/dbmysql.h:41: error: expected â;â before â*â token
NWNXmysql.cpp: In constructor âCNWNXmysql::CNWNXmysql()â:
NWNXmysql.cpp:23: warning: deprecated conversion from string constant to âchar*â
make[1]: *** [NWNXmysql.o] Error 1
make[1]: Leaving directory `/home/nordock/linnwnx2/db'
make: *** [db] Error 2


It is looking like several of the code files will need to be reviewed for missing includes of various types to bring nwnx2 compliant with GCC 4.3.0.
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sat Jun 28, 2008 1:01    Post subject: Reply with quote

Are you compiling in DEBUG or RELEASE mode?
The reason for asking is that RELEASE mode is more likely to work than DEBUG mode.
At least that my experience with the win32 branch. Several configuration dependencies are missing from the DEBUG configuration, that are present in the RELEASE one.

Cheers
Gryphyn
Back to top
View user's profile Send private message
Abraxsis



Joined: 24 Jun 2008
Posts: 14

PostPosted: Sat Jun 28, 2008 6:19    Post subject: Reply with quote

Release.

These errors are due to changes in GCC 4.3.0.
Back to top
View user's profile Send private message
reverett



Joined: 28 Jul 2008
Posts: 3

PostPosted: Wed Jul 30, 2008 3:26    Post subject: Reply with quote

Abraxsis, did you ever get the issue resolved?? I am have the exact same issue and was wondering if you got it fixed.

Thanks
Back to top
View user's profile Send private message Yahoo Messenger
Abraxsis



Joined: 24 Jun 2008
Posts: 14

PostPosted: Fri Aug 01, 2008 4:39    Post subject: Reply with quote

No, not yet. I've been too busy.

I have two older FC7 servers, so this hasn’t been a priority.
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Tue Aug 26, 2008 23:07    Post subject: Reply with quote

The compiling issue has been resolved. The updated files are on SVN.
You can get just the updated file:
http://nwn.virusman.ru/trac/nwnx2-linux/browser/trunk/NWNXBase.h?rev=160
Changeset/diff:
http://nwn.virusman.ru/trac/nwnx2-linux/changeset/160
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Abraxsis



Joined: 24 Jun 2008
Posts: 14

PostPosted: Fri Aug 29, 2008 14:13    Post subject: Reply with quote

<Tips Helm>

I'll compile them on the Fedora 9 server this weekend.

Thank you.
Back to top
View user's profile Send private message
Lobito



Joined: 11 Feb 2009
Posts: 8

PostPosted: Sat Feb 14, 2009 22:33    Post subject: Reply with quote

Hellou all, i'm newbie in this, but i was following this forum a lot of time, and well, i have the same problem like Abraxis. I'm using Fedora Core 10 and i have this problem:

make -C db
make[1]: se ingresa al directorio `/home/Lobito/Escritorio/nwndedicado/db'
g++ -g -mcpu=i386 -I.. -c -o NWNXmysql.o NWNXmysql.cpp
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
En el fichero incluído de NWNXmysql.h:17,
de NWNXmysql.cpp:20:
../db/dbmysql.h:27:25: error: mysql/mysql.h: No existe el fichero o el directorio
In file included from NWNXmysql.h:17,
from NWNXmysql.cpp:20:
../db/dbmysql.h:40: error: ‘MYSQL’ does not name a type
../db/dbmysql.h:41: error: ISO C++ prohíbe la declaración de ‘MYSQL_RES’ sin tipo
../db/dbmysql.h:41: error: expected ‘;’ before ‘*’ token
NWNXmysql.cpp: In constructor ‘CNWNXmysql::CNWNXmysql()’:
NWNXmysql.cpp:23: aviso: conversión obsoleta de una constante de cadena a ‘char*’
make[1]: *** [NWNXmysql.o] Error 1
make[1]: se sale del directorio `/home/Lobito/Escritorio/nwndedicado/db'
make: *** [db] Error 2


If you can help me it would be gr8 , thanks : )
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
Goto page 1, 2  Next
Page 1 of 2

 
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