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

Visual Studio 2017 including problem #1068

Closed
zbigniewcebula opened this issue Nov 16, 2020 · 6 comments
Closed

Visual Studio 2017 including problem #1068

zbigniewcebula opened this issue Nov 16, 2020 · 6 comments
Assignees
Milestone

Comments

@zbigniewcebula
Copy link

Hello, I want to use sol2 in my next project, unfortunately I can't find any reasonable way to include that.
Adding "Include Directories" to Project Properties does the "job" for #include, but rest of simple:

#include <iostream>
#include <sol/sol.hpp> //stops being an error after adding to include directories
int main() {
	sol::state lua; //name followed by :: must be a namespace...
	lua.open_libraries(sol::lib::base);

	lua.script("print('bark bark bark!')");
	return 0;
}

Does not work because VS2017 doesn't see any namespace.
Trying to CTRL+Click on sol.hpp ends with A definition for the symbol '<sol.hpp>' could not be located.

@ThePhD
Copy link
Owner

ThePhD commented Nov 19, 2020

So are these hard errors when you build, or just that Visual Studio stops working?

For what it's worth, sol2 is too large for VS2017 to process sanely. You have to turn on intellisense in the header.

@ThePhD
Copy link
Owner

ThePhD commented Nov 19, 2020

If it is just "my features stop working", try this:

#ifndef __INTELLISENSE__
#include <sol.hpp>
#endif // Intellisense blocker

This blocks Intellisense from the header and keeps it working, but you'll likely not be able to get other nice IDE features related to sol2.

@ThePhD ThePhD self-assigned this Nov 19, 2020
@ThePhD ThePhD added this to the Helpdesk milestone Nov 19, 2020
@zbigniewcebula
Copy link
Author

This gets pretty intense :D
(/c++17 is set)
obraz

@ThePhD
Copy link
Owner

ThePhD commented Dec 16, 2020

You can maybe get around this by not using the single header or upgrading to VS 2019. Sorry it's a pain!

@ThePhD ThePhD closed this as completed Dec 16, 2020
@vdweller84
Copy link

Hi, can you please consider reopening this? Please keep in mind that some console SDKs don't support VS2019 and therefore we're pretty much stuck with VS2017 for some projects.

I originally opened 1362, I thought I had it under control, now I try to build on my laptop and not even the single header works.

Even if you think of some temporary workaround for this, please do let us know.

@ThePhD
Copy link
Owner

ThePhD commented Jun 25, 2022

The workaround for this is going to be me rewriting a ton of the library so that it's not all crammed in a single header, things are compiled separately, and it's built properly so every single C++ file doesn't pay obscene costs of parsing all that code.

Which means I can't solve this directly right now, as I've got a metric crap ton on my plate to do. Sorry; it might be a long, long while, but it is on my radar.

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

No branches or pull requests

3 participants