[Solved - False] undefined reference createMemoryReadFile()

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

[Solved - False] undefined reference createMemoryReadFile()

Post by mant »

I get undefined reference to createMemoryReadFile in dynamic linking version.
Static build works fine.
I build the lib with: mingw32-make NDEBUG=1 sharedlib_win32 -j4
(I'm using msys2 with gcc 7.2.0, windows 10 x64)
But it seems working with debug version of dynamic lib because I've just discovered NDEBUG=1 and before there was no issues.
Last edited by mant on Fri Dec 15, 2017 5:18 am, edited 1 time in total.
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Dynamic linking version doesn't have createMemoryReadFil

Post by CuteAlien »

Check if you get following warning when compiling Irrlicht:
"Compiling with __STRICT_ANSI__ not supported. g++ does set this when compiling with -std=c++11 or -std=c++0x. Use instead -std=gnu++11 or -std=gnu++0x. Or use -U__STRICT_ANSI__ to disable strict ansi."
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
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

Re: Dynamic linking version doesn't have createMemoryReadFil

Post by mant »

I tried adding -std=gnu++11 to CXXFLAGS in Makefile and the linking error is still the same.
I'm gonna try building with Code::Blocks.
Update: same error with config Release fast math dll
C::B project already defined -U__STRICT_ANSI__
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Dynamic linking version doesn't have createMemoryReadFil

Post by CuteAlien »

Guess I have to experiment a little if I can reproduce. I don't have gcc 7 yet on Windows, maybe something changed. Which Irrlicht version are you using?
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
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

Re: Dynamic linking version doesn't have createMemoryReadFil

Post by mant »

I'm using 1.8.4, you can try MSYS2 to use the same environment like I have.
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Dynamic linking version doesn't have createMemoryReadFil

Post by CuteAlien »

I'm not sure why you mention C::B - you do build from console, right?

I spend some time building it on my existing system.
So some stuff which might be trouble...
- You should also have "make" usually which tends to works slightly better I think. At least if you have installed msys (mingw alone does only have the mingw32-make I think).
- To ensure you don't have old builds and/or mixed versions first call: make clean
- Check if you get any other build errors. For example in my case MinGW did set CC to cc. Which does not exist. So I had to build with: make CC=gcc NDEBUG=1 sharedlib_win32
- The build-file for all Makefiles doesn't seem to support win32 builds (or I couldn't figure it out). It seems you have to build examples one-by-one
- The example build is like: make NDEBUG=1 all_win32
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
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

Re: Dynamic linking version doesn't have createMemoryReadFil

Post by mant »

I did make clean before building the lib, and I've tried many times rebuild Irrlicht DLL from scratch (delete the whole folder and extract again)
Something I didn't make clear is that building the lib itself doesn't introduce any errors.
The error occurs when building my app. I use createMemoryReadFile.
I mention C::B because I tried that too (delete folder, extract, open with C::B and build)
Is there any possibility that some developer make createMemoryReadFile not public when exporting DLL symbols to prevent usage?
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Dynamic linking version doesn't have createMemoryReadFil

Post by CuteAlien »

Please call "make NDEBUG=1 all_win32" inside examples/21.Quake3Explorer just to ensure it fails there as well. That example uses createMemoryReadFile (and does link here).
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
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

Re: Dynamic linking version doesn't have createMemoryReadFil

Post by mant »

The makefile of example 21 doesn't define NDEBUG, there is no effects for that.
And currently there is: CXXFLAGS = -g -Wall
So I removed -g and run. It runs fine. But my project still gets error.
Maybe it's because of CEGUI, both dynamic and static CEGUI libs link to the same static Irrlicht library.
So I'm gonna make CEGUI libs compile with dynamic lib and see.
Linking order may also cause this.
Thanks CuteAlien.
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

Re: [Solved - False] undefined reference createMemoryReadFil

Post by mant »

Solved, I link both dynamic and static lib because the linker is complaining about the function without "imp" in its name.
I notice that "imp" should present if we're compiling with dynamic Irrlicht.
Luckily, linker only links what it needs from the static lib so that's fine.
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: [Solved - False] undefined reference createMemoryReadFil

Post by CuteAlien »

Hm, interesting that Makefiles in examples miss NDEBUG. Really have to go over all make systems some day (there's a bunch of other problems as well).
But good it works for now :-)
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