Thanks for your tutorial, it's always useful to document things so new
users can get up and running as fast as possible.
Thanks also for your explanations for changes to make. Perhaps some can
be made to the baseline so MinGW users won't have to manually patch
things...
About this one:
> (3) osgPlugin: curl
> Including libcurl (include / lib) doesn't seem to be enough to build
> this project and will result in linking errors. It probably needs to
> link against libws2_32.a and libwinmm.a . I know how to link using a
> Makefile, but I got no clue on how to fix it in the CMake files...
libws2_32 was added already for the WIN32 case, if it's not being linked
in it's probably because it's not included in the MINGW case... Search
for that name in the CMakeLists.txt file in the src/osgPlugins/curl
directory, and you should see where it's added. Then search other
plugins for a MinGW specific path and that will tell you what to test
for to know you're on MinGW, and in that case add the library to be
linked against.
That should take care of that case. Once you've made the changes please
submit the modified file to osg-submissions so others will benefit :-)
Thanks,
J-S
--
______________________________________________________
Jean-Sebastien Guay jean-seba...@cm-labs.com
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Thanks for the writing the tutorial. I'm with Jean-Sebastien in that
the best solution would be to get changes into svn/trunk that make the
OSG build out of the box with the present version of MingGW. Please
note that others before you have been building under MinGW and don't
recall any of them reporting these particular issues so I'd guess that
MinGW has been evolving, or perhaps that didn't attempt to compile the
components you have.
Which version of MinGW are you using? How are you obtaining the
dependencies? What version are the dependencies? Are they different
versions than you were using in VS?
The next step forward would to be get to the bottom of why these
changes are required, and then seek to resolve these external
dependencies or change the OSG's build and source files to fix things
in a way that builds correctly across all targets without
modifications. CMake itself can certainly help us out a lot with
providing paths and link lines for each dependency and target
platform. If we can we should strive to put the differences into the
build system rather than the source files.
Cheers,
Robert.
I investigated your issues a bit more. Here is what I found:
> (1) osgPlugin: jpeg
> Problem: boolean is not defined
This comes from the fact that the version of the jpeg headers included
in MinGW defines JPEG_boolean (and JPEG_FALSE/JPEG_TRUE) instead of
boolean (and FALSE/TRUE). I think this is a good idea as it avoids
possible name clashes, but in this case it causes problems.
What I find weird is that I looked at both the headers in the Win32 VC8
dependencies package (which is fairly old) and the headers on an
up-to-date Ubuntu install, and both define straight boolean (not
JPEG_boolean as the MinGW header defines). In both cases, the jmorecfg.h
header states:
Copyright (C) 1991-1997, Thomas G. Lane.
The MinGW header states:
Copyright (C) 1991-1997, Thomas G. Lane.
Modified 1997-2009 by Guido Vollbeding.
So it would seem the MinGW header is more recent, or just that it
includes changes that were not integrated into the baseline? That seems
a bit weird to me, that the MinGW header would be more recent than
what's on an up-to-date Ubuntu install...
Anyways, I'll see if I can code up a solution that will allow us to
compile in both cases.
> (2) osgPlugin: freetype
> Problem: It can't find the freetype header files
Actually, you could fix this without any code changes:
1. open an msys prompt
2. cd /mingw/include
3. ln -s freetype2 freetype
That way the include files will be found.
> (3) osgPlugin: curl
As I said, the required libraries are added at
src/osgPlugins/curl/CMakeLists.txt inside an IF(WIN32) which works for
VC++ builds. Seems the Msys build doesn't go into that IF, so I'll look
into adding the proper check (probably "|| MINGW" or something like
that. That should take care of it.
Stay tuned...
J-S
--
______________________________________________________
Jean-Sebastien Guay jean-seba...@cm-labs.com
http://www.cm-labs.com/
http://whitestar02.webhop.org/
> @Jean-S
>
> (1) libjpeg
> That's strange, I don't know if mingw32 on ubuntu is using the same
> files as on windows. I'm currently not using the offical verison of
> MinGW (latest verison 5.1.6,
> http://sourceforge.net/projects/mingw/files/) because it is using a GCC
> compiler version 3.x. Instead I'm using a build from
> http://nuwen.net/mingw.html#download (currently using 4.3) which is
> bundled with a more recent GCC compiler (version 4.3.3). The package
> also includes libjpeg version 7.
Yes, and I'm using the same installer to test with. I actually started
with your tutorial on installing MinGW and MSYS, and then customized a
few things. :-)
> (2) freetype
> While this indeed solve the issue without modifying the code, it moves
> the problem to the shell. Since users still need to manually type this
> fix...
But I think it's better to make the code general and let links handle
the difference than the opposite. Else the code becomes a spaghetti of
#if(MINGW) #elsif(...) ...
A symlink is a simple and clean way to make your system's directory
structure look more standard. Since thousands of developers actively use
OSG on various flavors of Linux, and it uses <freetype/...>, I think
making MinGW follow this (even if by default it puts the headers in
<freetype2/...>) is a more general solution.
> (3) curl
> That should probably do the trick, I'll see if I can make it work.
I've actually fixed the problem in my local checkout at home, but I had
a few more tests to do yesterday and it was late so I opted to go sleep
and send the fixes tomorrow (today). So I will hopefully send the fixes
I needed to use to build OSG on MinGW/MSYS tonight. I had a few more
fixes to make than what you said, but perhaps they're in things you
didn't opt to compile, like osgmovie, osgviewerSDL, the TXP plugin, ...
Stay tuned,
J-S
--
______________________________________________________
Jean-Sebastien Guay jean-seba...@cm-labs.com
http://www.cm-labs.com/
http://whitestar02.webhop.org/
> While creating this tutorial I found some minor issues (In the tutorial
> I explain how to patch it):
I have just sent the fixes I could come up with to osg-submissions. You
can look at the message here:
http://thread.gmane.org/gmane.comp.graphics.openscenegraph.cvs/6738
You can also download the zip with the modified source files. If you
want to try, please download it and copy the unzipped directory
structure over a fresh SVN checkout of the OSG source and see if you
have less problems.
For now though I have opted to keep the solution I gave for the freetype
plugin, i.e.
cd /mingw/include
ln -s freetype2 freetype
We'll see what Robert says about that, but I personally think it's
better to have a standard path, and if one type of system has a
different path then use symlinks to make it conform to the standard.
Other than that, I had more issues than you apparently had, but I hope
most if not all of them are fixed by my changes. I tested what I could
and almost everything worked as it should (sound in osgmovie and the Qt
examples being the only exceptions).
Hope this helps,
> Below an overview of my settings (just in case somebody wants to confirm
> the results)
Thanks a lot for testing and for reporting your findings!
I'll just comment on one thing:
> (5) Qt libraries 4.6.1 for Windows (minGW 4.4, 277 MB)
> Download: http://qt.nokia.com/downloads/windows-cpp
> Install: just run the setup and use the default location (C:\Qt\4.6.1)
...
> Unlike what Jean-Sebastien Guay reports here
> http://thread.gmane.org/gmane.comp.graphics.openscenegraph.cvs/6738 I
> don't have any problems (might already been fixed):
> osgviewerQT - no issues
> osgviewerQtWidget - no issues
Excellent, note that I had a preinstalled Qt 4.4.3 (because that's the
version we use in our software at work) for Windows / Visual Studio,
which is probably what was picked up by CMake, and that's probably the
reason I had problems. Anyways, I didn't really want to test that many
optional compiles (I had already tested Curl, FFMPEG, etc so I think it
was enough for most uses). ;-)
> The only application that does not wants to build is osgQtBrowser (error
> message below)
>
> The fix is simple:
> The missing header files should be here: C:\Qt\4.6.1\include\QtCore
>
> Seems like the CMakeList.txt files doesn't include the QTCORE header files.
>
> Patch:
> C:\OpenSceneGraphSrc\OpenSceneGraphSVN\examples\osgQtBrowser\CMakeLists.txt
> from: INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} )
> to: INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
>
> It should now compile just fine.
Please send the whole modified CMakeLists.txt file to osg-submissions.
That's the way to submit fixes to OSG.
> It almost compiles out of the box, great job :) ! Only one CMakeList.txt
> file needs to be patched and perhaps users should be made aware about
> the symlink (to fix the freetype issue).
Yeah, that could be documented (where? Perhaps a message in CMake if
MinGW is detected?)
Thanks again,
J-S
--
______________________________________________________
Jean-Sebastien Guay jean-seba...@cm-labs.com
http://www.cm-labs.com/
http://whitestar02.webhop.org/