Page 1 of 1
[Solved - False] undefined reference createMemoryReadFile()
Posted: Wed Dec 06, 2017 3:57 pm
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.
Re: Dynamic linking version doesn't have createMemoryReadFil
Posted: Wed Dec 06, 2017 4:39 pm
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."
Re: Dynamic linking version doesn't have createMemoryReadFil
Posted: Thu Dec 07, 2017 5:59 am
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__
Re: Dynamic linking version doesn't have createMemoryReadFil
Posted: Thu Dec 07, 2017 10:55 am
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?
Re: Dynamic linking version doesn't have createMemoryReadFil
Posted: Sat Dec 09, 2017 5:48 pm
by mant
I'm using 1.8.4, you can try MSYS2 to use the same environment like I have.
Re: Dynamic linking version doesn't have createMemoryReadFil
Posted: Tue Dec 12, 2017 8:53 pm
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
Re: Dynamic linking version doesn't have createMemoryReadFil
Posted: Wed Dec 13, 2017 7:21 am
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?
Re: Dynamic linking version doesn't have createMemoryReadFil
Posted: Wed Dec 13, 2017 11:15 am
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).
Re: Dynamic linking version doesn't have createMemoryReadFil
Posted: Fri Dec 15, 2017 5:14 am
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.
Re: [Solved - False] undefined reference createMemoryReadFil
Posted: Fri Dec 15, 2017 7:53 am
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.
Re: [Solved - False] undefined reference createMemoryReadFil
Posted: Fri Dec 15, 2017 11:01 am
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 :-)