Hi
I have downloaded the source version (mathgl-2.1.3.1.tar.gz) to my Win7 computer.Using CMake2.8.12-gui, I tried to compilied the mathgl. After CMake-gui program generated correctly makefiles for MinGW, I used mingw32-make.exe program to build mathgl. However, I got some problems when the mingw32-make created shared library——libmgl.dll.
Hi
I have downloaded the source version (mathgl-2.1.3.1.tar.gz) to my Win7 computer.Using CMake2.8.12-gui, I tried to compilied the mathgl. After CMake-gui program generated correctly makefiles for MinGW, I used mingw32-make.exe program to build mathgl. However, I got some problems when the mingw32-make created shared library——libmgl.dll.
Linking CXX shared library libmgl.dll
cd /d R:\debug-mathgl\src && "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E
cmake_link_script CMakeFiles\mgl.dir\link.txt --verbose=1
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E remove -f CMakeFiles\mgl.dir
/objects.a
C:\MinGW\bin\ar.exe cr CMakeFiles\mgl.dir/objects.a @CMakeFiles\mgl.dir\objects1
.rsp
C:\MinGW\bin\g++.exe -shared -o libmgl.dll -Wl,--out-implib,libmgl.dll.a -Wl
,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive CMakeFiles\ mgl.dir/objects.a -Wl,--no-whole-archive -lpthread -lglu32 -lopengl32 C:\MinGW\m
sys\1.0\home\grandpollux\libpng\build_r\libpng12_static.a C:\MinGW\msys\1.0\loca
l\bin\zlib1.dll C:\MinGW\msys\1.0\local\bin\zlib1.dll -lkernel32 -luser32 -lgdi3
2 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
Creating library file: libmgl.dll.a
CMakeFiles\mgl.dir/objects.a(data_png.cpp.obj):data_png.cpp:(.text+0x51b): undef
ined reference to
png_init_io' CMakeFiles\mgl.dir/objects.a(data_png.cpp.obj):data_png.cpp:(.text+0xca6): undef ined reference to
png_init_io'CMakeFiles\mgl.dir/objects.a(export.cpp.obj):export.cpp:(.text+0xba): undefined
reference to
png_init_io' CMakeFiles\mgl.dir/objects.a(export.cpp.obj):export.cpp:(.text+0x266): undefined reference to
png_init_io'collect2: ld returned 1 exit status
mingw32-make[2]: *** [src/libmgl.dll] Error 1
I have no idea what this is, and couldn't find anything relevant..
Thanks,
Most probably, you don't install libpng, and ignore errors produced by cmake.
Try to build with flag "-lpng" instead of "-lpng12"