Page 1 of 1

Fail to compile CORE_glib project in VisualMagic solution

Posted: 2014-11-27T06:26:49-07:00
by Jean-Robert
Hi all,

When I try to build the CORE_glib project, I've got 2 error messages :
#1 :
>..\..\glib\gio\giomodule.c(926) : error C2065: 'GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS' : undeclared identifier
#2 :
>..\..\glib\gio\gdbusprivate.c(2059) : error C2065: 'HW_PROFILE_INFOA' : undeclared identifier

I've checked and it seems these identifiers are not declared in any included header files.

My configuration is :
Version :ImageMagic 6.9.0
Solution name : VisualDynamicMT.sln
IDE : Visual Studio 2005
System : Win7 x64 SP1

Could you help me please ?

Regards

Jean-Robert

Re: Fail to compile CORE_glib project in VisualMagic solution

Posted: 2014-12-18T05:09:03-07:00
by dlemstra
It is finding those defines in the header files from the Microsoft Windows SDK on my machine. Can you try installing it?

Re: Fail to compile CORE_glib project in VisualMagic solution

Posted: 2014-12-18T10:24:42-07:00
by Jean-Robert
Hi,

The problem is that giomodule.c and gdbusprivate.c both include "config.h", but the compiler find the wrong one !
In the additional include directories of the CORE_glib project, "..\..\jpeg" directory comes before "..\..\glib\glib" directory. So the compiler inlcudes the "config.h" which is inside the jpeg project folder instead of the glib one.
I've fixed the problem by copying a version of "config.h" from "\glib\glib" directory into "\glib\gio" directory.

However, I've still a problem, this time during the linking. See the error below :

3>------ Build started: Project: CORE_glib, Configuration: Release Win32 ------
3>Linking...
3> Creating library ..\lib\CORE_RL_glib_.lib and object ..\lib\CORE_RL_glib_.exp
3>gwin32directorymonitor.obj : error LNK2019: unresolved external symbol _ReadDirectoryChangesW referenced in function _g_win32_directory_monitor_callback@12
3>..\bin\CORE_RL_glib_.dll : fatal error LNK1120: 1 unresolved externals
3>Build log was saved at "file://c:\Home\Projects\Test\ImageMagick\ImageMagick-6.9.0\VisualMagick\Release\CORE_glib\BuildLog.htm"
3>CORE_glib - 2 error(s), 0 warning(s)


Do you know where is the definition for _ReadDirectoryChangesW ( missing source file ? , reference to some external libs ? )

Re: Fail to compile CORE_glib project in VisualMagic solution

Posted: 2014-12-18T12:45:36-07:00
by dlemstra
It looks like that header is also coming from the Microsoft Windows SDK.

Re: Fail to compile CORE_glib project in VisualMagic solution

Posted: 2014-12-19T02:42:34-07:00
by Jean-Robert
I've found a way to compile the glib project :
It is necessary to change the additional include directories setting and move the related jpeg folders at the end of the list : "..\..\jpeg" and "..\..\jpeg\simd". Many source files of the glib project includes the (wrong) "config.h" from the jpeg project instead of the config.h from the glib project.

The svn repository should be updated with these changes in order to make the windows projects compilable. ( tests with VS2005 )

Thanks

Re: Fail to compile CORE_glib project in VisualMagic solution

Posted: 2014-12-19T05:03:09-07:00
by dlemstra
I am planning to improve the way configure.exe works and creates the project files. I will make sure to include these fixes.