Author Topic: Converting Visual C++ project to CB/MinGW (NEED HELP)  (Read 11716 times)

Offline dannyyy

  • Multiple posting newcomer
  • *
  • Posts: 23
Converting Visual C++ project to CB/MinGW (NEED HELP)
« on: October 29, 2007, 04:23:42 pm »
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: [Select]
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, 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

Offline Auria

  • Almost regular
  • **
  • Posts: 152
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #1 on: October 29, 2007, 05:46:57 pm »
Hi,

i think you should post "undefined reference to..." WHAT you get, as without this knowledge it may be hard to answer precisely.

Offline dannyyy

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #2 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: [Select]
-------------- 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.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #3 on: October 29, 2007, 06:12:10 pm »
At the same paragraph I placed a link for the topic on the ImageMagick forum. Anyway, I will post the messages here.

Code: [Select]
-------------- 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'
...

...
Any idea about what's wrong ? I can't find anything about it on the internet.



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

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #4 on: October 29, 2007, 06:56:18 pm »
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).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7056
    • My Best Post
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #5 on: October 29, 2007, 07:11:58 pm »
`DrawArc' is part of the Library you are compiling; you have something wrong.

See file drawing-wand.c did you compile it? If so, did you put it in a library? If so, what is the library name? Link to it.

Info based on ImageMagick-6.3.6 files; don't have Code::Blocks at school so can not help you compile it.

I just looked at the workspace file; it has 124 project files, this is more complex than I have time for.

CORE_wand_mt_dll.cbp contains drawing-wand.c and looks like it should produce an Static Library called CORE_wand
I don't see any mention of it in CORE_Magick++_mt_dll.cbp make sure that project depends on CORE_wand_mt_dll.cbp and add the library created by CORE_wand_mt_dll.cbp to it.

Back to school work, bye.

Tim S
« Last Edit: October 29, 2007, 07:33:48 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline dannyyy

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #6 on: October 29, 2007, 07:51:13 pm »
Hi, Tim S !

In my workspace file, CORE_Magick++ comes after CORE_wand, so the library containing the file drawing-wand.c was not compiled yet.

How can I change the order the projects are compiled in a workspace ?
EDIT: Found it: Ctrl-Shift-UP  :)

Oh, and thanks for helping me to investigate this !
« Last Edit: October 29, 2007, 07:58:22 pm by dannyyy »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9609
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #7 on: October 30, 2007, 08:48:53 am »
How can I change the order the projects are compiled in a workspace ?
EDIT: Found it: Ctrl-Shift-UP  :)
Another possibility: Project dependencies (within a workspace). This is much better and safer. ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline dannyyy

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #8 on: November 08, 2007, 03:45:52 pm »
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:
Code: [Select]
#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:
Code: [Select]
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 ?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7056
    • My Best Post
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #9 on: November 08, 2007, 03:58:06 pm »
What is the name of the files?
How and where is FT_INTERNAL_CALC_H defined?

Tim S
« Last Edit: November 08, 2007, 04:00:11 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline dannyyy

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #10 on: November 08, 2007, 06:14:21 pm »
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:
Code: [Select]
#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 ?
« Last Edit: November 08, 2007, 09:21:50 pm by dannyyy »

Offline darthdespotism

  • Almost regular
  • **
  • Posts: 163
    • Coder's Nemesis
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #11 on: November 08, 2007, 09:42:03 pm »
I compiled Freetype with those strange includes successfully with g++ on Gnu/Linux. There is IMO no reason why it should fail on MinGW / Win32

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7056
    • My Best Post
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #12 on: November 08, 2007, 10:38:07 pm »
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:
Code: [Select]
#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 ?

Yes, MinGW is able to do this; are you sure that internal.h is working right?
Where is the include of it?

Did you try to include it above the line having the problem?

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jarro_2783

  • Multiple posting newcomer
  • *
  • Posts: 99
    • Project Freedom
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #13 on: November 09, 2007, 10:43:18 am »
I wish freetype would just use normal includes.

I had a similar problem a while ago. To solve it I did the following.

Make sure you're including <ft2build.h> which I see you are.
Make sure it includes the file needed to get the #define for the #include (not sure if freetype actually includes everything).
The documentation told me to include something that didn't exist because the api changed so make sure those #defines actually still exist.
Make sure you're including the freetype path. Better yet, install pkg-config and use that, and if you have it may be failing but you won't see it from codeblocks. Run it from the command line to make sure it's finding the path.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #14 on: November 09, 2007, 10:50:11 am »
I compiled Freetype with those strange includes successfully with g++ on Gnu/Linux. There is IMO no reason why it should fail on MinGW / Win32
Yup,  is no problem... I did that once a year ago or so, worked nicely.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline dannyyy

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #15 on: November 10, 2007, 03:18:38 am »
Strange...

The ImageMagick source package for Windows comes with FreeType version 2.1.5 (2003-09-02) but the latest version of FreeType is 2.3.5 (2007-07-02). I was trying to update it, but the "original" version comes with a folder named "autohint" and the downloaded library doesn't.

Anyway, to save hours of work and headaches, I decided to keep using the older version for the Windows build. Everything is now compiling correctly.

Now I will try to make the debug version. Wish me luck...

Offline dannyyy

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #16 on: November 12, 2007, 01:47:06 am »
I have a silly question:

My project is now compiling correctly using MinGW, but at the end of compilation process this message appears:
Code: [Select]
-------------- 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 ?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7056
    • My Best Post
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #17 on: November 12, 2007, 01:59:38 am »
mt.exe is part of Visual Studio, why do you think it should work?
If you think it should, verify that it is in the path in Code::Blocks.
Under "Global Compiler Settings" Window add path to mt.exe to "Toolchain Executables" "Additional Paths"

Repeating, I have no idea if mt.exe will work with MinGW GCC.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline dannyyy

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: Converting Visual C++ project to CB/MinGW (NEED HELP)
« Reply #18 on: November 12, 2007, 05:01:43 am »
Tim, I have no intention to use Visual Studio tools...I'm deadly allergic to Microsoft...  :D

One of our programmers included this command on "Project Build Options->Pre/Post Build Steps", and I found it just now.

Sorry for disturbing you  :P