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

Debug assertion failed: 'vector iterators incompatible' on Windows #968

Open
sentientbottleofwine opened this issue Dec 15, 2024 · 0 comments

Comments

@sentientbottleofwine
Copy link

I'm on clang+msvc(as stdlib)+ninja after making a debug build with cmake:

cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug

With the following CMakeLIsts.txt and main.cpp:

cmake_minimum_required(VERSION 3.25)
include(FetchContent)

FetchContent_Declare(ftxui
  GIT_REPOSITORY  https://github.com/ArthurSonzogni/ftxui
  GIT_TAG         58ff448 
)

FetchContent_MakeAvailable(ftxui)

project(test)

add_executable(test
	main.cpp
)

target_link_libraries(test
	PRIVATE ftxui::screen
	PRIVATE ftxui::dom
	PRIVATE ftxui::component
)
#include <ftxui/component/component.hpp>
#include <ftxui/component/screen_interactive.hpp>


int main() {
  using namespace ftxui;
	auto screen = ScreenInteractive::Fullscreen();

	auto foo = Container::Vertical({});
	auto bar = Renderer([]{ return text("text"); });
	const int bar_container_index = 1;
	bool run_once{true};

	foo->Add(Renderer([&]{
		if(run_once) {
			run_once = false;
			foo->ChildAt(bar_container_index)->Detach();
		}
		return text("other text");
	}));
	foo->Add(bar);

	screen.Loop(foo);
}

I get the following error on windows:
error
In a release build everything works as intended(bar gets detatched) and on linux no matter release or debug everything also works.

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

No branches or pull requests

1 participant