Hello all !
I use CodeBlocks and read this forum since January 2007, but this is the first time I write here.
I am the project leader from a big open source project, an image editor as powerful as GIMP or Photoshop. It's name is OVAT-Open Visual Arts Tool (http://sourceforge.net/projects/ovat/).
The project uses ImageMagick library as it's graphics engine. The problem is that there are only Visual C++ projects for compiling this library on Windows, and we want to use MinGW, because we want to use only open source tools.
One of our programmers created the project files using the program included on ImageMagick, and I imported it on CodeBlocks, changing the default compiler to MinGW. The only external library I had to include in this testing was Ghostscript (ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/gs860/ghostscript-8.60.tar.gz).
Everything compiles well until it reaches a certain point, and then many errors appear at linking time, all of them are "undefined reference to..." Maybe the solution is simple, like linking a library, but I can't find what's wrong. The developers of ImageMagick doesn't like to support "unconventional" ways to compile their library, and they don't answer my questions on their forum. See the topic (http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=9659&p=31196) I posted there.
I hope you can help me, because I waste almost two months trying to make it work.
Here is the "cake recipe":
Tools
gcc-core-3.4.5-20060117-1.tar.gz
gcc-g++-3.4.5-20060117-1.tar.gz
w32api-3.10.tar.gz
mingw-runtime-3.13.tar.gz
mingw32-make-3.81-2.tar.gz
binutils-2.17.50-20060824-1.tar.gz
gdb-6.6.tar.bz2
MSYS-1.0.10.exe
CodeBlocks (latest nightly build)
ImageMagick source (get this file (ftp://ftp.imagemagick.org/pub/ImageMagick/windows/ImageMagick-6.3.6-3.zip))
How to build
The first thing needed is to run the configure script inside MSYS, because it automatically creates the file "magick-config.h" with the correct settings. I use the following commands:
cd /c/ImageMagick
$ ./configure --disable-shared --with-quantum-depth=16 --without-perl --without-modules --enable-delegate-build
Some other delegate libraries may also need the "configure" command. You will notice that if a message about missing headers appear during the compiling process. If it happens, just change the directory inside MSYS and type "configure".
Now the worse part. We need to create the Visual C++ projects, and then import it to CodeBlocks. Inside the folder c:\ImageMagick\VisualMagick\configure\ there is a program. This program is used to create the project files. If you don't have Visual C++, or if you want to save time, you can download the Visual C++ project files from here (http://ovat.sourceforge.net/VisualMagick.zip), or even better, you can download the ready-to-go CodeBlocks workspace and project files here (http://ovat.sourceforge.net/MagickBlocks.zip).
After all of the processes above, the last thing to do is to open the CodeBlocks workspace, activate the project "All" and choose the menu item "Build->Build Workspace".
Any help is welcome.
Thanks in advance.
Daniel Stein
OVAT Project Leader
At the same paragraph I placed a link for the topic on the ImageMagick forum. Anyway, I will post the messages here.
-------------- Build: Release Win32 in CORE_Magick++ ---------------
Linking dynamic library: ..\bin\CORE_RL_Magick++_.dll
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0xbaa): undefined reference to `DrawArc'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0xc7e): undefined reference to `DrawPopClipPath'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0xd5c): undefined reference to `DrawCircle'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0xe45): undefined reference to `DrawColor'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x2274): undefined reference to `NewMagickWandFromImage'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x22a5): undefined reference to `DrawComposite'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x241a): undefined reference to `DrawEllipse'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x295c): undefined reference to `NewPixelWand'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x296d): undefined reference to `PixelSetQuantumColor'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x297c): undefined reference to `DrawSetFillColor'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x2984): undefined reference to `DestroyPixelWand'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x2b87): undefined reference to `DrawSetFillOpacity'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x2d1c): undefined reference to `DrawLine'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x2e05): undefined reference to `DrawMatte'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x2ede): undefined reference to `DrawPoint'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x2fa7): undefined reference to `DrawSetFontSize'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x328c): undefined reference to `DrawRectangle'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x3367): undefined reference to `DrawRotate'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x344a): undefined reference to `DrawRoundRectangle'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x352e): undefined reference to `DrawScale'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x35f7): undefined reference to `DrawSkewX'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x36b7): undefined reference to `DrawSkewY'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x37ce): undefined reference to `DrawSetStrokeDashArray'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x3eb7): undefined reference to `DrawSetStrokeDashOffset'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x46dc): undefined reference to `NewPixelWand'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x46ed): undefined reference to `PixelSetQuantumColor'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x46fc): undefined reference to `DrawSetStrokeColor'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x4704): undefined reference to `DestroyPixelWand'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x4847): undefined reference to `DrawSetStrokeOpacity'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x4907): undefined reference to `DrawSetStrokeWidth'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x50ac): undefined reference to `NewPixelWand'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x50bd): undefined reference to `PixelSetQuantumColor'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x50cc): undefined reference to `DrawSetTextUnderColor'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x50d4): undefined reference to `DestroyPixelWand'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x521e): undefined reference to `DrawTranslate'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x52fc): undefined reference to `DrawSetViewbox'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5aa7): undefined reference to `DrawPathLineToHorizontalAbsolute'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5b67): undefined reference to `DrawPathLineToHorizontalRelative'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5c27): undefined reference to `DrawPathLineToVerticalAbsolute'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5ce7): undefined reference to `DrawPathLineToVerticalRelative'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5d3d): undefined reference to `DrawSetTextEncoding'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5d5a): undefined reference to `DrawAnnotation'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5da3): undefined reference to `DrawPushPattern'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5de6): undefined reference to `DrawPushDefs'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5e48): undefined reference to `DrawSetFontFamily'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5e57): undefined reference to `DrawSetFontStyle'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5e66): undefined reference to `DrawSetFontWeight'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5e89): undefined reference to `DrawSetFont'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5ec7): undefined reference to `DrawPathMoveToRelative'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5f17): undefined reference to `DrawPathMoveToAbsolute'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5f67): undefined reference to `DrawPathLineToRelative'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5fb7): undefined reference to `DrawPathLineToAbsolute'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x6007): undefined reference to `DrawPathCurveToQuadraticBezierSmoothRelative'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x6057): undefined reference to `DrawPathCurveToQuadraticBezierSmoothAbsolute'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x60e3): undefined reference to `DrawPathCurveToSmoothRelative'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x6163): undefined reference to `DrawPathCurveToSmoothAbsolute'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x6186): undefined reference to `DrawPathStart'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x61bf): undefined reference to `DrawPathFinish'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x622e): undefined reference to `DrawPathEllipticArcRelative'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x62ae): undefined reference to `DrawPathEllipticArcAbsolute'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x6325): undefined reference to `DrawPathCurveToRelative'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x6395): undefined reference to `DrawPathCurveToAbsolute'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x63f7): undefined reference to `DrawPathCurveToQuadraticBezierRelative'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x6457): undefined reference to `DrawPathCurveToQuadraticBezierAbsolute'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x8fce): undefined reference to `DrawPolyline'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x905e): undefined reference to `DrawPolygon'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x90ee): undefined reference to `DrCreating library file: ..\bin\libCORE_RL_Magick++_.a
awBezier'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0xa84): undefined reference to `DrawAffine'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0xc89): undefined reference to `DrawPopDefs'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x22b9): undefined reference to `DestroyMagickWand'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x2ac4): undefined reference to `DrawSetFillRule'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x2c44): undefined reference to `DrawSetGravity'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x305b): undefined reference to `PopDrawingWand'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x310b): undefined reference to `PushDrawingWand'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x31bb): undefined reference to `DrawPopPattern'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x3f74): undefined reference to `DrawSetStrokeLineCap'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x4034): undefined reference to `DrawSetStrokeLineJoin'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x40f4): undefined reference to `DrawSetStrokeMiterLimit'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x41bb): undefined reference to `DrawSetStrokeAntialias'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x4a4b): undefined reference to `DrawSetTextAntialias'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x4b84): undefined reference to `DrawSetTextDecoration'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x560b): undefined reference to `DrawPathClose'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5dc4): undefined reference to `DrawSetClipPath'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5dfd): undefined reference to `DrawPushClipPath'
..\Release\CORE_Magick++\Magick++\lib\Drawable.o:Drawable.cpp:(.text+0x5e7d): undefined reference to `DrawSetFontStretch'
..\Release\CORE_Magick++\Magick++\lib\Image.o:Image.cpp:(.text+0x4ad1): undefined reference to `DrawAllocateWand'
..\Release\CORE_Magick++\Magick++\lib\Image.o:Image.cpp:(.text+0x4afd): undefined reference to `DestroyDrawingWand'
..\Release\CORE_Magick++\Magick++\lib\Image.o:Image.cpp:(.text+0x4b19): undefined reference to `DrawRender'
..\Release\CORE_Magick++\Magick++\lib\Image.o:Image.cpp:(.text+0x826b): undefined reference to `DrawAllocateWand'
..\Release\CORE_Magick++\Magick++\lib\Image.o:Image.cpp:(.text+0x82c3): undefined reference to `DestroyDrawingWand'
..\Release\CORE_Magick++\Magick++\lib\Image.o:Image.cpp:(.text+0x82db): undefined reference to `DrawRender'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 54 seconds)
91 errors, 0 warnings
I imagine that some library needs to be added, because the previous project in this workspace (CORE_Magick) linked correctly when I added GDI32.a and clicked Rebuild Workspace.
Any idea about what's wrong ? I can't find anything about it on the internet.
My library compiled successfully, thanks for the help !
But I have a new problem. I updated all dependencies, and now it stops compiling when it reaches the Freetype library. Some files have code like this:
#include <ft2build.h>
#include FT_INTERNAL_CALC_H
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_OBJECTS_H
The compiler doesn't recognize this, and returns the following message:
Compiling: ..\..\ttf\src\base\ftbase.c
In file included from E:\ImageMagick\ttf\src\base\ftbase.c:23:
E:\ImageMagick\ttf\src\base\ftcalc.c:36:10: #include expects "FILENAME" or <FILENAME>
E:\ImageMagick\ttf\src\base\ftcalc.c:37:10: #include expects "FILENAME" or <FILENAME>
E:\ImageMagick\ttf\src\base\ftcalc.c:38:10: #include expects "FILENAME" or <FILENAME>
Is there some way to make it work, without changing this code to .h files ?
Tim, the package is "freetype-2.3.5.tar.gz", from here:
http://sourceforge.net/project/showfiles.php?group_id=3157
The errors I wrote on the previous post are just examples. The total is 577 errors !
The problem is the compiler complaining about the way the includes are wrote, without a filename.
The code on the post above is inside the "ftcalc.c" file, and the definition of FT_INTERNAL_CALC_H is inside the "internal.h" file. See a fragment of this file:
#define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h>
#define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h>
#define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h>
#define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h>
#define FT_INTERNAL_CALC_H <freetype/internal/ftcalc.h>
#define FT_INTERNAL_DRIVER_H <freetype/internal/ftdriver.h>
Is MinGW able to compile such code ?
I have a silly question:
My project is now compiling correctly using MinGW, but at the end of compilation process this message appears:
-------------- Build: Release MinGW in ovat ---------------
Linking executable: bin\Release\ovat.exe
Output size is 5.72 MB
Running target post-build steps
mt.exe /nologo /manifest "bin\Release\ovat.exe.manifest" /outputresource:"bin\Release\ovat.exe";1
Execution of 'mt.exe /nologo /manifest "bin\Release\ovat.exe.manifest" /outputresource:"bin\Release\ovat.exe";1' in 'E:\Stein\My_Programming\ovat' failed.
Nothing to be done.
Why the .manifest file is failing to be created ?