Skip to content

EASTL/chrono.h Inclusion Breaks EASTL Code Compilation #583

@mertcanzafer

Description

@mertcanzafer

Description

Including the header:

#include <EASTL/chrono.h>

causes a large number of compiler errors in files and places where I use other EASTL-related functions or data structures.

  • OS: Windows x64

  • Compiler: MSVC

  • C++ standard: C++23

Including everything else from EASTL works fine.

When I remove the chrono.h include, the project builds and runs without any issues.

#pragma once
#include <iostream>
#include <string>

#include <EASTL/string.h>
#include <EASTL/vector.h>
#include <EASTL/array.h>
#include <EASTL/unordered_map.h>
#include <EASTL/unique_ptr.h>
#include <EASTL/optional.h>
#include <EASTL/set.h>
#include <EASTL/chrono.h> // builds and runs when this line removed

#define FMT_HEADER_ONLY
#include <fmt/core.h>

namespace EA {
	namespace StdC {
		int Vsnprintf(char* pDestination, size_t n,
			const char* pFormat, va_list arguments);
	}
}
namespace Utils
{
	eastl::string ToEASTL(const std::string& str);
	std::string ToSTD(const eastl::string& str);

	void Log(const eastl::string& str);
	void Log(const std::string& str);
	
	eastl::string Concat(const eastl::string& a, const std::string& b);

	eastl::string Concat(const std::string& a, const std::string& b);

	template <typename... Args>
	eastl::string Format(fmt::format_string<Args...> fmtStr, Args&&... args)
	{
		std::string formatted = fmt::format(fmtStr, std::forward<Args>(args)...);
		return ToEASTL(formatted);
	}
}

I tried to change the ordering of these includes but still couldn't manage to build the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions