error: '_strcmpi' was not declared in this scope

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
bp2
Posts: 2
Joined: Tue Oct 08, 2019 7:27 pm

error: '_strcmpi' was not declared in this scope

Post by bp2 »

I downloaded irrlicht-1.8.4 on Windows, went into source/Irrlicht and run make win32 because I want to compile the sources with MinGW.
I get this error:

Code: Select all

g++ -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing -g -D_DEBUG -I../../include -Izlib -Ijpeglib -Ilibpng -DIRRLICHT_EXPORTS=1 -DNO_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ -DNO_IRR_COMPILE_WITH_DIRECT3D_9_ -DIRR_COMPILE_WITH_DX9_DEV_PACK -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL  -c -o CIrrDeviceWin32.o CIrrDeviceWin32.cpp
CIrrDeviceWin32.cpp: In member function 'void irr::CIrrDeviceWin32::getWindowsVersion(irr::core::stringc&)':
CIrrDeviceWin32.cpp:1611:40: error: '_strcmpi' was not declared in this scope
CIrrDeviceWin32.cpp:1613:43: error: '_strcmpi' was not declared in this scope
CIrrDeviceWin32.cpp:1615:43: error: '_strcmpi' was not declared in this scope
<builtin>: recipe for target `CIrrDeviceWin32.o' failed
make: *** [CIrrDeviceWin32.o] Error 1
How can I resolve this error?
bp2
Posts: 2
Joined: Tue Oct 08, 2019 7:27 pm

Re: error: '_strcmpi' was not declared in this scope

Post by bp2 »

I commented the lines of code where there is _strcmpi (in hope that I will not need this piece of code) then the compilation continues. I run make staticlib_win32 because I would like to try to make a static compilation. I get the file ../../lib/Win32-gcc/libIrrlicht.a of 55 Mo but when I try to use it:

Code: Select all

g++ -static -mwindows -I../../include ../../lib/Win32-gcc/libIrrlicht.a main.cpp -o ex01.exe
/tmp/cciRcIRh.o:main.cpp:(.text+0x76): undefined reference to `createDevice'
collect2: error: ld returned 1 exit status
What did I do wrong?
CuteAlien
Admin
Posts: 9652
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: error: '_strcmpi' was not declared in this scope

Post by CuteAlien »

Somehow you compile in strict ansi mode. But I'm not quite sure why as I don't see it from your compile-flags. It happens when people compile with -std=c++0x instead of -std=gnu++0x (so often the case when trying to use c++11), but you set neither. Maybe newer g++ somehow has that as default now? Which g++ version are you using. I'm testing here currently with g++ 6.3.0 on MinGW, which I guess is somewhat outdated.

The other error - yeah it doesn't link. Not sure if you can set relative paths for linker. Usually you set the path with -Lpath and then only use the name like -lIrrlicht (without lib and .a). Maybe that's it (thought I would expect other errors then...).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
netpipe
Posts: 669
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Re: error: '_strcmpi' was not declared in this scope

Post by netpipe »

use strcasecmp in its place on linux
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
CuteAlien
Admin
Posts: 9652
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: error: '_strcmpi' was not declared in this scope

Post by CuteAlien »

MinGW should be using the Windows API, not unix and this function is only used in the Win32 device. But I guess we could just get rid of it there and use our core::stringc class (it's not a speed relevant place anyway). No need to keep a potential problem around for 3 lines which can be done otherwise.

edit: All uses of _strcmpi are now removed from the engine (r5962, will be in Irrlicht 1.9).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply