• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C3861 'fmt': is not a class or namespace name luascrip.cpp

Lopaskurwa

Active Member
Joined
Oct 6, 2017
Messages
873
Solutions
2
Reaction score
49
Installing this comit

Error C2653 'fmt': is not a class or namespace name
Error C3861 'format': identifier not found

As far as i know this error happens because of this code line
reportErrorFunc(fmt::format("Not enough parameters: {:d}.", parameters));
tried replacing it with
reportErrorFunc(L, fmt::format("Not enough parameters: {:d}.", parameters));

but it didnt worked so basically this error happens because i dont have #include <fmt/format.h> but i have no access for it so i cant use it, so how could i rewrite the code so it would do the same function?
 
Solution
To rewrite the code without using fmt::format, you can employ string concatenation or a different method to construct the error message
C++:
std::string errorMessage = "Not enough parameters: " + std::to_string(parameters) + ".";
reportErrorFunc(errorMessage);
this code constructs the error message by concatenating strings and the parameter value using std::to_string. So it should compile without any issues, but maybe im wrong, there is smarter people that can inspect my code
To rewrite the code without using fmt::format, you can employ string concatenation or a different method to construct the error message
C++:
std::string errorMessage = "Not enough parameters: " + std::to_string(parameters) + ".";
reportErrorFunc(errorMessage);
this code constructs the error message by concatenating strings and the parameter value using std::to_string. So it should compile without any issues, but maybe im wrong, there is smarter people that can inspect my code
 
Solution
To rewrite the code without using fmt::format, you can employ string concatenation or a different method to construct the error message
C++:
std::string errorMessage = "Not enough parameters: " + std::to_string(parameters) + ".";
reportErrorFunc(errorMessage);
this code constructs the error message by concatenating strings and the parameter value using std::to_string. So it should compile without any issues, but maybe im wrong, there is smarter people that can inspect my code
Yea it compiles <3
 
Back
Top