Fail to compile CORE_glib project in VisualMagic solution

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Jean-Robert
Posts: 3
Joined: 2014-11-27T05:59:36-07:00
Authentication code: 6789

Fail to compile CORE_glib project in VisualMagic solution

Post 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
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Fail to compile CORE_glib project in VisualMagic solution

Post by dlemstra »

It is finding those defines in the header files from the Microsoft Windows SDK on my machine. Can you try installing it?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Jean-Robert
Posts: 3
Joined: 2014-11-27T05:59:36-07:00
Authentication code: 6789

Re: Fail to compile CORE_glib project in VisualMagic solution

Post 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 ? )
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Fail to compile CORE_glib project in VisualMagic solution

Post by dlemstra »

It looks like that header is also coming from the Microsoft Windows SDK.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Jean-Robert
Posts: 3
Joined: 2014-11-27T05:59:36-07:00
Authentication code: 6789

Re: Fail to compile CORE_glib project in VisualMagic solution

Post 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
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Fail to compile CORE_glib project in VisualMagic solution

Post 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.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply