svifylabs / fog

Automatically exported from code.google.com/p/fog
1 stars 0 forks source link

windows MinGW release version can't compile #36

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
D:\Work\Library\fog\Fog\Build>mingw32-make
Scanning dependencies of target Fog
[  0%] Building CXX object CMakeFiles/Fog.dir/Fog/Core/Collection/Util.cpp.obj
In file included from D:/Work/Library/fog/Fog/Fog/Core/C++/IntrinMMX.h:12:0,
                 from D:/Work/Library/fog/Fog/Fog/Core/C++/StdHeaders.h:35,
                 from D:/Work/Library/fog/Fog/Fog/Core/C++/Base.h:21,
                 from D:/Work/Library/fog/Fog/Fog/Core/Global/Global.h:11,
                 from D:/Work/Library/fog/Fog/Fog/Core/Collection/Util.h:11,
                 from D:\Work\Library\fog\Fog\Fog\Core\Collection\Util.cpp:12:
d:\mingw\bin\../lib/gcc/i686-pc-mingw32/4.6.1/include/mmintrin.h:32:3: error: #e
rror "MMX instruction set not enabled"
In file included from D:/Work/Library/fog/Fog/Fog/Core/C++/StdHeaders.h:35:0,
                 from D:/Work/Library/fog/Fog/Fog/Core/C++/Base.h:21,
                 from D:/Work/Library/fog/Fog/Fog/Core/Global/Global.h:11,
                 from D:/Work/Library/fog/Fog/Fog/Core/Collection/Util.h:11,
                 from D:\Work\Library\fog\Fog\Fog\Core\Collection\Util.cpp:12:
D:/Work/Library/fog/Fog/Fog/Core/C++/IntrinMMX.h:128:3: error: '__m64' does not
name a type
In file included from D:/Work/Library/fog/Fog/Fog/Core/Global/Global.h:13:0,
                 from D:/Work/Library/fog/Fog/Fog/Core/Collection/Util.h:11,
                 from D:\Work\Library\fog\Fog\Fog\Core\Collection\Util.cpp:12:
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1453:3: error: expected identifier
 before '*' token
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1453:3: warning: 'cdecl' attribute
 only applies to function types [-Wattributes]
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1453:80: error: ISO C++ forbids de
claration of 'Range' with no type [-fpermissive]
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1453:80: error: 'Range' declared a
s function returning a function
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1534:3: error: expected identifier
 before '*' token
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1534:3: warning: 'cdecl' attribute
 only applies to function types [-Wattributes]
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1534:80: error: ISO C++ forbids de
claration of 'Range' with no type [-fpermissive]
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1534:80: error: 'Range' declared a
s function returning a function
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1722:3: error: expected identifier
 before '*' token
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1722:3: warning: 'cdecl' attribute
 only applies to function types [-Wattributes]
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1722:119: error: ISO C++ forbids d
eclaration of 'TransformF' with no type [-fpermissive]
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1722:119: error: 'TransformF' decl
ared as function returning a function
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1734:3: error: expected identifier
 before '*' token
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1734:3: warning: 'cdecl' attribute
 only applies to function types [-Wattributes]
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1734:87: error: ISO C++ forbids de
claration of 'PointF' with no type [-fpermissive]
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1734:87: error: 'PointF' declared
as function returning a function
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1747:3: error: expected identifier
 before '*' token
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1747:3: warning: 'cdecl' attribute
 only applies to function types [-Wattributes]
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1747:119: error: ISO C++ forbids d
eclaration of 'TransformD' with no type [-fpermissive]
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1747:119: error: 'TransformD' decl
ared as function returning a function
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1764:3: error: expected identifier
 before '*' token
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1764:3: warning: 'cdecl' attribute
 only applies to function types [-Wattributes]
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1764:87: error: ISO C++ forbids de
claration of 'PointD' with no type [-fpermissive]
D:/Work/Library/fog/Fog/Fog/Core/Global/Api.h:1764:87: error: 'PointD' declared
as function returning a function
mingw32-make[2]: *** [CMakeFiles/Fog.dir/Fog/Core/Collection/Util.cpp.obj] Error
 1
mingw32-make[1]: *** [CMakeFiles/Fog.dir/all] Error 2
mingw32-make: *** [all] Error 2

D:\Work\Library\fog\Fog\Build>

Am I missing something?

Original issue reported on code.google.com by weasley...@gmail.com on 12 Oct 2011 at 5:43

GoogleCodeExporter commented 8 years ago
D:\Work\Library\fog\Fog\Scripts>mkdir ..\Build
子目录或文件 ..\Build 已经存在。

D:\Work\Library\fog\Fog\Scripts>cd ..\Build

D:\Work\Library\fog\Fog\Build>cmake .. -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Re
lease -DFOG_BUILD_BENCH=True -DFOG_BUILD_EXAMPLES=True
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: D:/MinGW/bin/gcc.exe
-- Check for working C compiler: D:/MinGW/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: D:/MinGW/bin/g++.exe
-- Check for working CXX compiler: D:/MinGW/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
== ====================================================
== [Fog-Framework - Normal Build (Release)]
== ====================================================
-- Initializing FOG_DIR=D:/Work/Library/fog/Fog
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - not found.
-- Found Threads: TRUE
-- Performing Test FOG_CC_HAS_FMERGE_ALL_CONSTANTS
-- Performing Test FOG_CC_HAS_FMERGE_ALL_CONSTANTS - Success
-- Performing Test FOG_CC_HAS_FNO_KEEP_STATIC_CONSTS
-- Performing Test FOG_CC_HAS_FNO_KEEP_STATIC_CONSTS - Success
-- Performing Test FOG_CC_HAS_FLTO
-- Performing Test FOG_CC_HAS_FLTO - Failed
-- Performing Test FOG_CC_HAS_WINLINE
-- Performing Test FOG_CC_HAS_WINLINE - Success
-- Performing Test FOG_CC_HAS_WNO_ENUM_COMPARE
-- Performing Test FOG_CC_HAS_WNO_ENUM_COMPARE - Success
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Check size of void*
-- Check size of void* - done
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Check size of wchar_t
-- Check size of wchar_t - done
-- Looking for include files FOG_HAVE_FLOAT_H
-- Looking for include files FOG_HAVE_FLOAT_H - found
-- Looking for include files FOG_HAVE_LIMITS_H
-- Looking for include files FOG_HAVE_LIMITS_H - found
-- Looking for include files FOG_HAVE_STDARG_H
-- Looking for include files FOG_HAVE_STDARG_H - found
-- Looking for include files FOG_HAVE_STDINT_H
-- Looking for include files FOG_HAVE_STDINT_H - found
-- Configuring Fog/Core
   Adding optimized file Fog/Core/Tools/List_SSE2.cpp (SSE2)
-- Configuring Fog/G2d
   Adding optimized file Fog/G2d/Geometry/PathClipper_SSE.cpp (SSE)
   Adding optimized file Fog/G2d/Geometry/Transform_SSE.cpp (SSE)
   Adding optimized file Fog/G2d/Geometry/PathClipper_SSE2.cpp (SSE2)
   Adding optimized file Fog/G2d/Geometry/Transform_SSE2.cpp (SSE2)
   Adding optimized file Fog/G2d/Imaging/Filters/FeColorMatrix_SSE.cpp (SSE)
-- Looking for include files FOG_HAVE_LIBJPEG
-- Looking for include files FOG_HAVE_LIBJPEG - found
-- Looking for include files FOG_HAVE_LIBPNG
-- Looking for include files FOG_HAVE_LIBPNG - found
   Adding optimized file Fog/G2d/Painting/RasterPaintEngine_SSE2.cpp (SSE2)
   Adding optimized file Fog/G2d/Source/Color_SSE2.cpp (SSE2)
   Adding optimized file Fog/G2d/Tools/Region_SSE2.cpp (SSE2)
-- Configuring Fog/UI
-- Configuring Fog/Svg
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Work/Library/fog/Fog/Build

D:\Work\Library\fog\Fog\Build>cd ..\Scripts

D:\Work\Library\fog\Fog\Scripts>pause
请按任意键继续. . .

this is configure output.

Original comment by weasley...@gmail.com on 12 Oct 2011 at 5:44

GoogleCodeExporter commented 8 years ago
Hello,

this is similar to Issue #35. I fixed some errors today, but not all of them.

Marking as accepted, will be fixed soon

Original comment by kobalicek.petr on 12 Oct 2011 at 6:14

GoogleCodeExporter commented 8 years ago

Original comment by kobalicek.petr on 12 Oct 2011 at 6:14

GoogleCodeExporter commented 8 years ago
Thank you very much! I have compiled it with modified some code, mainly in 
CompileGcc.h, I commented the __attribute__((always_inline)) and 
__attribute__((cdecl)),but it's still a lot of warnings (all of them are 
inline fault), and I modified the CMakeLists.txt It's very strange that some of 
Header can not use MMX/SSE2, in CMakeLists.txt I found that you added them into 
source files' property, but it still can not pass compile, so I added -mmmx 
-msse -msse2 to all file (CMAKE_CXX_FLAGS) :(

Hopes these information could help you, thx :)

Original comment by weasley...@gmail.com on 12 Oct 2011 at 9:22

GoogleCodeExporter commented 8 years ago
Temporarily fixed by r777, but the code generated by MinGW is larger (About 
60%) and slow (about 10-15%).

Original comment by kobalicek.petr on 13 Oct 2011 at 3:06

GoogleCodeExporter commented 8 years ago
but, my other modules is compiled with mingw:( and the fog don't export
portable c interface, i can only c++ interface that can not cross compilers.
is using a c interface a plan in your todo list?

thank you anyway:)
�� 2011-10-13 ����11:07�� <fog@googlecode.com>���

Original comment by weasley...@gmail.com on 13 Oct 2011 at 3:16

GoogleCodeExporter commented 8 years ago
There is a C like interface, but it's not designed to work with a pure C code 
at this moment. It's designed mainly as a large virtual function table, where 
the base functions can be replaced by optimized ones (another effect of this is 
that many simple classes are not exported). Another idea is to simplify 
bindings to other programming languages that can accept function & function 
prototype declaration.

So you can use the slower MinGW version at this time and hope that these errors 
will be fixed by MinGW team some day. BTW: Why not to use MSVC to compile all 
your modules? It produces really good binaries;)

Original comment by kobalicek.petr on 13 Oct 2011 at 4:02

GoogleCodeExporter commented 8 years ago
thank you for your explaining :)

i want to write a bindings to lua language, but msvc has issues about
msvcrt.dll :(

maybe a simple improve can change these imcompatibles between compilers and
use c++ interface with different compilers,  that is just export a extern
"c" function to initialze the virtual function table, and all your shell
class use functions in table, so any programs use fog can just link with
this c named function, without any other dependencies. so you can compile
your program with mingw or any other compilers, but link with fog compiled
with msvc, with a single symbol, maybe named _fog_api in fog.dll's symbol
table.
�� 2011-10-14 ����12:02�� <fog@googlecode.com>���

Original comment by weasley...@gmail.com on 13 Oct 2011 at 4:46

GoogleCodeExporter commented 8 years ago
I have used MSVC build Fog.dll and MinGW successfully. I just modify the Api.h 
file, changed this line:

extern FOG_API Api _api;

to this:

extern "C" FOG_API Api _api;

maybe you can think about this change, this makes different binary can work 
together :-)

Original comment by weasley...@gmail.com on 14 Oct 2011 at 5:59

GoogleCodeExporter commented 8 years ago
This is good point.

I think that fog_api would be better and I'm going to change this early. It's 
good to know that it's possible to use mixture of compilers.

Original comment by kobalicek.petr on 14 Oct 2011 at 12:20

GoogleCodeExporter commented 8 years ago
The fog_api is now exported, thanks!

Original comment by kobalicek.petr on 16 Oct 2011 at 7:09

GoogleCodeExporter commented 8 years ago
Sorry, But, I still can't compile the MinGW version. It seems that some file 
need MMX support, but you don't add -mmmx flags to these files' command line.

D:\Work\Library\fog\Fog\Build>make
Scanning dependencies of target Fog
[  0%] Building CXX object CMakeFiles/Fog.dir/Fog/Core/Collection/Util.cpp.obj
In file included from D:/Work/Library/fog/Fog/Fog/Core/C++/IntrinMMX.h:12:0,
                 from D:/Work/Library/fog/Fog/Fog/Core/C++/StdHeaders.h:35,
                 from D:/Work/Library/fog/Fog/Fog/Core/C++/Base.h:19,
                 from D:/Work/Library/fog/Fog/Fog/Core/Global/Global.h:11,
                 from D:/Work/Library/fog/Fog/Fog/Core/Collection/Util.h:11,
                 from D:\Work\Library\fog\Fog\Fog\Core\Collection\Util.cpp:12:
d:\mingw\bin\../lib/gcc/i686-pc-mingw32/4.6.1/include/mmintrin.h:32:3: error: #e
rror "MMX instruction set not enabled"
In file included from D:/Work/Library/fog/Fog/Fog/Core/C++/StdHeaders.h:35:0,
                 from D:/Work/Library/fog/Fog/Fog/Core/C++/Base.h:19,
                 from D:/Work/Library/fog/Fog/Fog/Core/Global/Global.h:11,
                 from D:/Work/Library/fog/Fog/Fog/Core/Collection/Util.h:11,
                 from D:\Work\Library\fog\Fog\Fog\Core\Collection\Util.cpp:12:
D:/Work/Library/fog/Fog/Fog/Core/C++/IntrinMMX.h:128:3: error: '__m64' does not
name a type
make[2]: *** [CMakeFiles/Fog.dir/Fog/Core/Collection/Util.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Fog.dir/all] Error 2
make: *** [all] Error 2

Original comment by weasley...@gmail.com on 20 Oct 2011 at 3:41

GoogleCodeExporter commented 8 years ago
Ok, reopening, I'm going to look more closely at this issue

Original comment by kobalicek.petr on 20 Oct 2011 at 3:29

GoogleCodeExporter commented 8 years ago
MinGW can compile fog now, thank you. I will do some benchmark about MSVC 
version and MinGW version (and also Qt4, cairo and gdiplus).

now I only have MSVC version of Fog, the result is likely fog is the fastest 
library on windows in these four. and the second is gdiplus (just slow 1/3 with 
fog), the third is cairo (slow 3 times than fog), the last is Qt4 (very very 
slow :-(

Original comment by weasley...@gmail.com on 9 Nov 2011 at 4:45