Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support windows for Visual Studio 2015 #88

Closed
wants to merge 12 commits into from

Conversation

kepkin
Copy link

@kepkin kepkin commented Jun 12, 2015

I've made fine grained commits so you could review my changes thorougly. It compiles fine, and even works for majority of the cases.

The following is unit tests result for windows (linux pass 100%)

test cases:   21 |   20 passed | 1 failed
assertions: 4812 | 4810 passed | 2 failed

@satirev
Copy link

satirev commented Jun 15, 2015

@kepkin it seems that you run tests only in debug configuration. MSVC treats noexcept as optimization hint and like other optimizations it can only take place in release mode. I've checked out your pull request, tested it in release mode and it passed all test cases.

@kepkin
Copy link
Author

kepkin commented Jun 16, 2015

2Stirev thanks for the hint, didn't knew that. I've rebased branch.

BTW, release build takes astonishing 12 minutes on my laptop (while 2 min in debug)! Console log in apveyor says that it has finished with success, don't understand why github still says it's pending.

nlohmann added a commit that referenced this pull request Jun 20, 2015
nlohmann added a commit that referenced this pull request Jun 20, 2015
nlohmann added a commit that referenced this pull request Jun 20, 2015
nlohmann added a commit that referenced this pull request Jun 20, 2015
nlohmann added a commit that referenced this pull request Jun 20, 2015
@TheAifam5
Copy link

should be

#ifdef _MSC_VER
#include <basetsd.h>
using ssize_t = SSIZE_T;
#endif

in VS2015.

And how repair?

1>json.hpp(425): error C2794: 'basic_json': is not a member of any direct or indirect base class of 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,double,std::allocator>'
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(761): note: see reference to class template instantiation 'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,double,std::allocator>' being compiled
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(790): note: see reference to class template instantiation 'std::is_nothrow_constructible<_Ty,nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,double,std::allocator> &&>' being compiled
1>          with
1>          [
1>              _Ty=nlohmann::json
1>          ]
1>  json.hpp(4898): note: see reference to class template instantiation 'std::is_nothrow_move_constructible<nlohmann::json>' being compiled

Code:

/// create a string (implicit)
        template <class V, typename
            std::enable_if<
            std::is_constructible<string_t, V>::value, int>::type
            = 0>
            basic_json(const V& value)
            : basic_json(string_t(value))
        {}

Without that code, program compiling without any problems.

@nlohmann
Copy link
Owner

Thanks @TheAifam5, I added this.

@kepkin
Copy link
Author

kepkin commented Jun 20, 2015

@TheAifam5 what version of code you try to compile? Could you give me a hash? I don't have such an error.

@TheAifam5
Copy link

@kepkin yep, nlohmann\master :)
2s ago i checked again and its the same.
VS2015

@kepkin
Copy link
Author

kepkin commented Jun 21, 2015

@TheAifam5 you need all commits from this PR to build with VS2015. Neils haven't merged all of them yet. You should wait or just use my branch https://github.com/kepkin/json/tree/vs14_nlohman

@TheAifam5
Copy link

Thanks @nlohmann and @kepkin. Now all works. I using only originall repositories, when author is active..

@nlohmann
Copy link
Owner

Hi @kepkin , @satirev , @TheAifam5,

I am sorry for the delay in this issue. As I do not work with MSVC, can anyone give me an update how the current version is doing on MSVC 2015 and what is left to be done?

@TheAifam5
Copy link

@nlohmann i dont using it now but i want soon.. but i remember, #844bfd3 or like that (@nlohmann repo) and don't works. Have problems with inaccessible functions ...
you cant use functions and iterators from 'json' class.

@TheAifam5
Copy link

Just wait for VS2015 RTM... comming soon at 20.07.2015

@kepkin
Copy link
Author

kepkin commented Jul 13, 2015

Hi @nlohmann!

This PR becomed to messy to merge it right. So I've create a separate PR for you #104

This one contains only iterator refactoring. Once you are happy with it and it's merged, I'll create a final PR that fixes build under Visual Studio 2015.

You can close this PR.

@nlohmann
Copy link
Owner

Hi @kepkin, thanks a lot for your patience! I'll check #104 as soon as possible.

@nlohmann nlohmann closed this Jul 13, 2015
@rsimenok
Copy link

rsimenok commented Dec 21, 2016

Hi @nlohmann, that strange but i have the same error as @TheAifam5, i'm using the latest release version.

code i execute (can contains errors, i'm new in c++ and VS)

std::ifstream file(default_playlist_path.c_str());
json defaultPlaylist;
file >> defaultPlaylist;
json values;
for (json::iterator it = defaultPlaylist.begin(); it != defaultPlaylist.end(); ++it) {
	json effect = it.value();
	json controls = effect["controls"];

	for (json::iterator cit = controls.begin(); cit != controls.end(); ++it) {
		json control = cit.value();

		if (!control["address"].is_null()) {
			addressesMap[it.key()] = 0.0;
			values[cit.key()] = { {"last", 0.0},
						     {"default", 0.0} };
		}
	}
}

help me please :)
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants