kastnermario / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

New API build problems building on Windows with Visual Studio 2010 #142

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I am trying to build the experimental API using the latest revision of the 
code, and I have run into several build failures. (The old API build fine). I 
am using CMake 2.8.7 and Visual Studio 2010, and have run into several build 
failures.

The first build failures occurred as a result of not being able to find the 
boost headers. I added the following to the CMake file, which allowed them to 
be found properly.

find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})

However, I am still getting many build errors. I have attached the build log. 
It looks most of the errors have to do with YAML::detail::iterator_base.

Thanks

Original issue reported on code.google.com by rkj...@gmail.com on 7 Jan 2012 at 12:30

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the report!

I don't have access to my Windows box right now, but I found similar errors on 
clang (on OS X), so I fixed those compiler errors. Can you check the latest 
revision (r0243b0bada1f) to see if you're still getting the errors?

Thanks!

Original comment by jbe...@gmail.com on 7 Jan 2012 at 7:46

GoogleCodeExporter commented 8 years ago
Okay, that fixed most of the errors, and the attached patch lets the me 
successfully build the library. However, the building the tests still fails 
with an error, which I have also attached.

Original comment by rkj...@gmail.com on 9 Jan 2012 at 12:35

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks! I patched the CMakeLists.txt change (to find the Boost library), and I 
looked into the second patch (for the iterator stuff), and I couldn't figure 
out why your patch fixes it for you (it gives me some errors on both gcc and 
clang).

I made a bit of a guess as to why you were getting those errors, and I made a 
small change - can you test to see if it fixes the problem for you 
(r6e4ec3b74da0)?

Thanks again!

Original comment by jbe...@gmail.com on 11 Jan 2012 at 7:59

GoogleCodeExporter commented 8 years ago

Original comment by jbe...@gmail.com on 13 Jan 2012 at 6:18

GoogleCodeExporter commented 8 years ago
The exact error reported by MSVC 10 is:

yaml-cpp/node/detail/iterator.h(33): error C2039: 'iterator_adaptor_' : is not 
a member of 'YAML::detail::iterator_base<V>'

Which is probably a bug.

Anyway, the attached patch seems to fix MSVC compilation without breaking GCC 
or Clang. Note that I haven't actually done any tests; I just made sure that it 
built.

Original comment by rkj...@gmail.com on 16 Jan 2012 at 12:48

Attachments:

GoogleCodeExporter commented 8 years ago
Oh, I forgot to mention that your changes did, in fact, fix the building of 
run-tests for me.

Original comment by rkj...@gmail.com on 16 Jan 2012 at 2:50

GoogleCodeExporter commented 8 years ago
OK, I applied your patch (rab216375decb), and you're right, it builds find (and 
tests fine) on gcc/clang.

Can you verify that it works on MSVC?

By the way, I've switched the new API to its own branch (instead of being 
differentiated by a compiler flag). So you'll have to update to the "new-api" 
branch:

hg up new-api

Original comment by jbe...@gmail.com on 21 Jan 2012 at 6:17

GoogleCodeExporter commented 8 years ago
Yes, I can confirm that all appears to be working.

Thanks.

Original comment by rkj...@gmail.com on 10 Mar 2012 at 6:56