User forums > General (but related to Code::Blocks)
Converting Visual C++ project to CB/MinGW (NEED HELP)
dannyyy:
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.
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.
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 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)
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:
--- Code: ---cd /c/ImageMagick
$ ./configure --disable-shared --with-quantum-depth=16 --without-perl --without-modules --enable-delegate-build
--- End code ---
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, or even better, you can download the ready-to-go CodeBlocks workspace and project files here.
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
Auria:
Hi,
i think you should post "undefined reference to..." WHAT you get, as without this knowledge it may be hard to answer precisely.
dannyyy:
At the same paragraph I placed a link for the topic on the ImageMagick forum. Anyway, I will post the messages here.
--- Code: ----------------- 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
--- End code ---
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.
tiwag:
--- Quote from: dannyyy on October 29, 2007, 06:04:05 pm ---At the same paragraph I placed a link for the topic on the ImageMagick forum. Anyway, I will post the messages here.
--- Code: ----------------- 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'
...
--- End code ---
...
Any idea about what's wrong ? I can't find anything about it on the internet.
--- End quote ---
http://www.google.at/search?q=DrawArc&ie=utf-8&oe=utf-8&aq=t&rls=%3A%3A
finds
http://msdn2.microsoft.com/en-us/library/system.drawing.graphics.drawarc.aspx
which is a .NET class
MinGW doesn't have .NET library as far as i know
alternative method:
search for method names in the MinGW/include/*.h files for the missing method name
in most cases you'll find the proper library name then, if it is found in any header file.
sorry for having no solution for your problem,
brgds
thomas:
It's GDI+, not .NET, but for the principle, Tiwag is right.
It's all the same proprietary managed rubbish, afraid you will not be able to compile that with MinGW easily (with a lot of effort, you might).
Navigation
[0] Message Index
[#] Next page
Go to full version