Compiling Error 'strncasecmp' not declared.

Found a bug? Please report it, but remember to follow the bug reporting guidelines.
Missing a sane feature? Let us know!
But please do NOT request ports to other systems.

Moderator: ZSNES Mods

Post Reply
darolu

Compiling Error 'strncasecmp' not declared.

Post by darolu »

Hardware
Intel Pentium 4 with HT @ 2,8Ghz
1,5 GB of RAM @ 400Mhz
ATI Radeon 5500 with 256MB VRAM
Soundblaster Live 1,5 audio card

OS
Linux 2.6.32-24-generic
#42-Ubuntu
SMP Fri Aug 20 14:24:04 UTC 2010
i686 GNU/Linux
Distributor ID: Ubuntu
Description: Ubuntu 10.04.1 LTS
Release: 10.04
Codename: lucid

I tried to compile following the instructions (for my distribution) at: http://board.zsnes.com/phpBB3/viewtopic.php?f=18&t=7371

BTW, the list of dependencies in that thread is not complete as Qt4 libraries are also needed, installing libqt4-dev packages solves this.

After configuring, when trying to compile the following error is printed:

Code: Select all

g++  -pipe -I. -I/usr/local/include -I/usr/include -D__UNIXSDL__ -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT   -D__LIBAO__ -D__OPENGL__ -DNO_DEBUGGER -DNDEBUG -march=native -O2 -fomit-frame-pointer -s -DQT_SHARED -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui   -fno-rtti -o tools/strutil.o -c tools/strutil.cpp
In file included from tools/strutil.cpp:22:
tools/strutil.h: In static member function ‘static int ci_char_traits::compare(const char*, const char*, size_t)’:
tools/strutil.h:34: error: ‘strncasecmp’ was not declared in this scope
make: *** [tools/strutil.o] Error 1
Is there a way to fix this?

Thanks in advance for your replies.
dfreer
Lurker
Posts: 139
Joined: Fri May 11, 2007 5:28 am

Re: Compiling Error 'strncasecmp' not declared.

Post by dfreer »

the instructions in your link from 2004 wrote:svn co https://svn.bountysource.com/zsnes/trunk/ zsnes
link at the top of this very page wrote:Heavy work is being done on the sound core at the moment. Please do not report any bugs from SVN until we say it is safe to do so.
But.... since that first page doesn't say "don't use SVN" like every other thread around here does, I'll cut you a break and give you this link:
http://board.zsnes.com/phpBB3/viewtopic.php?f=2&t=11513
That's the source you want to compile from.
badinsults
"Your thread will be crushed."
Posts: 1236
Joined: Wed Jul 28, 2004 1:49 am
Location: Not in Winnipeg
Contact:

Re: Compiling Error 'strncasecmp' not declared.

Post by badinsults »

Public SVN is no longer updated.

I suggest using the precompiled binaries in this thread:

http://board.zsnes.com/phpBB3/viewtopic ... 13&start=0


Which are optimized for Linux use.
<pagefault> i'd break up with my wife if she said FF8 was awesome
x24804

Re: Compiling Error 'strncasecmp' not declared.

Post by x24804 »

Not sure if you've solved this or not.

The error is this:

Code: Select all

In file included from tools/strutil.cpp:22:
tools/strutil.h: In static member function ‘static int ci_char_traits::compare(const char*, const char*, size_t)’:
tools/strutil.h:34: error: ‘strncasecmp’ was not declared in this scope
make: *** [tools/strutil.o] Error 1
You'll go into tools/strutil.h, and add the proper header that defines strncasecmp (hint: strings.h). Re-configure and make, and then you should see another error. Follow the same procedure and then it should compile fine.
SampleNick11

Re: Compiling Error 'strncasecmp' not declared.

Post by SampleNick11 »

You must to add to each file in tools subfolder the next line at beginning (you'll understand it if you know C)

Code: Select all

#include <string.h>
After this, if you have GCC 4.4, the make will run correctly.
If you haven't got the GCC, I suppose it will run correctly too.

PS: Add the line but don't remove the line "#include <string>" (or similar; without quotes).
xiaop
New Member
Posts: 1
Joined: Tue Oct 14, 2014 6:51 am

Re: Compiling Error 'strncasecmp' not declared.

Post by xiaop »

Had some issues when compiling under Slackware.

I solved it by adding the following to the code:

Code: Select all

bash-4.2# diff -r zsnes zsnes_1_51/ 
diff -r zsnes/src/parsegen.cpp zsnes_1_51/src/parsegen.cpp
21d20
< #include <string.h>
diff -r zsnes/src/tools/depbuild.cpp zsnes_1_51/src/tools/depbuild.cpp
26,27d25
< #include <unistd.h>
< #include <cstdlib>
diff -r zsnes/src/tools/strutil.cpp zsnes_1_51/src/tools/strutil.cpp
23d22
< #include <string.h>
diff -r zsnes/src/tools/strutil.h zsnes_1_51/src/tools/strutil.h
21d20
< #include <string.h>
Post Reply