
Hi there, I'm in the process of making my gil extension ready for inclusion. The code is now stable and I'm trying to get gcc/clang to work. Since I'm no expert with gcc I would like to ask for some help with various compiler errors. Could someone get the latest from here: http://gil-contributions.googlecode.com/svn/trunk/gil_2 and try to compile the following code: ------------------- #include <boost/gil/extension/io_new/bmp_all.hpp> using namespace std; using namespace boost::gil; int main() { { const char* bmp_filename = ""; const char* bmp_out = ""; rgb8_image_t img; read_image( bmp_filename, img, bmp_tag() ); write_view( bmp_out + "all_formats_test.bmp", view( img ), bmp_tag() ); } } ----------------- It should generate some errors which I don't quite understand. I have posted the errors here: http://pastebin.com/Wps3YH1N I'm using gcc 4.4.1 . The complete test suite compiles with Visual Studio 2010 without any warnings. Thanks a lot! Christian

On 02/07/2012 11:32 p.m., Christian Henning wrote:
Hi there,
I'm in the process of making my gil extension ready for inclusion. The code is now stable and I'm trying to get gcc/clang to work. Since I'm no expert with gcc I would like to ask for some help with various compiler errors. ------------------- #include <boost/gil/extension/io_new/bmp_all.hpp>
using namespace std; using namespace boost::gil;
int main() { { const char* bmp_filename = ""; const char* bmp_out = "";
rgb8_image_t img; read_image( bmp_filename, img, bmp_tag() ); write_view( bmp_out + "all_formats_test.bmp", view( img ), bmp_tag() );
Aren't you trying to concatenate two char pointers there (a pointer and an array, actually)? Neither of those is std::string. Agustín K-ballo Bergé.- http://fusionfenix.com

Hi Christian, I'm glad to see this is moving forward! On Mon, Jul 2, 2012 at 8:32 PM, Christian Henning <chhenning@gmail.com> wrote:
Hi there,
I'm in the process of making my gil extension ready for inclusion. The code is now stable and I'm trying to get gcc/clang to work. Since I'm no expert with gcc I would like to ask for some help with various compiler errors.
it looks like the two major areas are problems with VS allowing you to bind temporaries to mutable references, and missing typenames. You're probably familiar with both, but I'll explain the former problem as well as attach a diff that allows your program to compile. The problem is similar to the following: int make_int(); //returns rvalue void foo(int&); //standard says this should take a mutable lvalue ... foo(make_int());//Forbidden by standard, allowed by default with VS. Options are to have foo take its parameter by value or const&, or to declare a temporary before the invocation of foo, and pass the temporary to that. The diff I'm attaching just passes the reader and writer by value, though I'm not at all sure that's the right thing here. . .
The complete test suite compiles with Visual Studio 2010 without any warnings.
We compile with VC10 and gcc 4.5 at my work. We've found the boost guidelines to be very helpful in catching cross-platform problems early: https://svn.boost.org/trac/boost/wiki/Guidelines/WarningsGuidelines (see the 'Defining Warnings as Errors' section, particularly 4239 and 4346, which may have helped in this case). HTH, Nate

Hi Nathan,
On Mon, Jul 2, 2012 at 8:32 PM, Christian Henning <chhenning@gmail.com> wrote:
Hi there,
I'm in the process of making my gil extension ready for inclusion. The code is now stable and I'm trying to get gcc/clang to work. Since I'm no expert with gcc I would like to ask for some help with various compiler errors.
it looks like the two major areas are problems with VS allowing you to bind temporaries to mutable references, and missing typenames. You're probably familiar with both, but I'll explain the former problem as well as attach a diff that allows your program to compile. The problem is similar to the following: int make_int(); //returns rvalue void foo(int&); //standard says this should take a mutable lvalue ... foo(make_int());//Forbidden by standard, allowed by default with VS.
Options are to have foo take its parameter by value or const&, or to declare a temporary before the invocation of foo, and pass the temporary to that. The diff I'm attaching just passes the reader and writer by value, though I'm not at all sure that's the right thing here. . .
OK, I understand. This is very helpful. Thanks!
The complete test suite compiles with Visual Studio 2010 without any warnings.
We compile with VC10 and gcc 4.5 at my work. We've found the boost guidelines to be very helpful in catching cross-platform problems early: https://svn.boost.org/trac/boost/wiki/Guidelines/WarningsGuidelines (see the 'Defining Warnings as Errors' section, particularly 4239 and 4346, which may have helped in this case).
OK, I'll change my warning level to 4 and fix everything I can. Seems like boost::gil generates quite a few warnings, as well. But that's for later. Thanks again! Christian

Hi Christian, On Wed, Jul 4, 2012 at 2:33 PM, Christian Henning <chhenning@gmail.com> wrote:
We compile with VC10 and gcc 4.5 at my work. We've found the boost guidelines to be very helpful in catching cross-platform problems early: https://svn.boost.org/trac/boost/wiki/Guidelines/WarningsGuidelines (see the 'Defining Warnings as Errors' section, particularly 4239 and 4346, which may have helped in this case).
OK, I'll change my warning level to 4 and fix everything I can. Seems like boost::gil generates quite a few warnings, as well. But that's for later.
Yes, there are some warnings at level 4 which are very often triggered by GIL. Common ones are: conditional expression is constant, assignment operator couldn't be generated due to reference member, and more when compiled in 64-bit. <rant>The second is particularly annoying -- if I wanted to be able to copy-assign, I wouldn't have put a reference member in there!</rant> I tend to suppress those particular warnings as a matter of course -- GIL code would not be improved by hacking around these illegitimate warnings. . . Good luck, Nate

Hi Christian, I've raised an issue (issue 11) with some patches for compilation issues I ran into using GCC4.7 and Clang3.2, on your google code project. There's not much but a few missing explicit typenames and this->, and some others little tweaks. I can't wait for GIL new io to be included in Boost, it's really a good job, thanks. Regards, -- Beren Minor

Hi Beren, On Thu, Jul 5, 2012 at 3:24 AM, Beren Minor <beren.minor+boost@gmail.com> wrote:
Hi Christian,
I've raised an issue (issue 11) with some patches for compilation issues I ran into using GCC4.7 and Clang3.2, on your google code project. There's not much but a few missing explicit typenames and this->, and some others little tweaks.
I have applied all of your patches.
I can't wait for GIL new io to be included in Boost, it's really a good job, thanks.
Thanks! I'll do my best to have it included as soon as I can. Regards, Christian

Hi Nathan,
OK, I'll change my warning level to 4 and fix everything I can. Seems like boost::gil generates quite a few warnings, as well. But that's for later.
Yes, there are some warnings at level 4 which are very often triggered by GIL. Common ones are: conditional expression is constant, assignment operator couldn't be generated due to reference member, and more when compiled in 64-bit. <rant>The second is particularly annoying -- if I wanted to be able to copy-assign, I wouldn't have put a reference member in there!</rant> I tend to suppress those particular warnings as a matter of course -- GIL code would not be improved by hacking around these illegitimate warnings. . .
I should fix those warnings. It's annoying, you are right! Regards, Christian

On 3 July 2012 03:32, Christian Henning <chhenning@gmail.com> wrote:
Hi there,
I'm in the process of making my gil extension ready for inclusion.
Great news Christian!
Could someone get the latest from here:
http://gil-contributions.googlecode.com/svn/trunk/gil_2
and try to compile the following code:
------------------- #include <boost/gil/extension/io_new/bmp_all.hpp>
using namespace std; using namespace boost::gil;
int main() { { const char* bmp_filename = ""; const char* bmp_out = "";
rgb8_image_t img; read_image( bmp_filename, img, bmp_tag() ); write_view( bmp_out + "all_formats_test.bmp", view( img ), bmp_tag() ); ----------------------------------^^^^^^^^^^^^^^^^^^
Does it compile for you? Even with Visual C++ 2010, you should have seen: error C2110: '+' : cannot add two pointers Best regards, -- Mateusz Loskot, http://mateusz.loskot.net
participants (5)
-
Agustín K-ballo Bergé
-
Beren Minor
-
Christian Henning
-
Mateusz Loskot
-
Nathan Crookston