Jump to content

Metin2 Srcs - C++20 Implement Error


Go to solution Solved by Ikarus_,

Recommended Posts

4 hours ago, Ikarus_ said:

post the makefile libsql

 

 

CXX      = g++10
BIN      = ../libsql.a
CFLAGS   = -I/usr/local/include/mysql -Wall -O2 -ggdb3 -g3 -std=gnu++20 -pipe -mtune=i386 -fstack-protector -static
CPP      = AsyncSQL.cpp Semaphore.cpp Statement.cpp Tellwait.cpp

all: $(BIN)

clean:
	rm -f *.o
	rm -f $(BIN)

%.o: %.cpp
	@echo -e "\033[0;32m[LibSQL]\033[0m \033[0;33mDerleniyor;\033[0m" $*
	@$(CXX) $(CFLAGS) -c $^ -o $@

$(BIN): $(CPP:%.cpp=%.o)
	@ar cru $(BIN) $^
	@ranlib $(BIN)
	chmod 700 $(BIN)

 

Link to comment
Share on other sites

  • Developer
  • Solution

It looks like it is getting "false" as an int somehow. I ve no idea why it is happening only to you.

A dirty solution may be define a spaceship operator with bool and int at the beginning of AsyncSQL.h (before the includes).

Since i can't reproduce the error i m not able to check if my propose is valid (and i neither tried to compile the code tbh).

 

inline constexpr auto operator<=>(const bool x, const int y)
{
	return x <=> bool(y);
}

 

 

 

252709OrangeWarning.pngto be honest i don't like it, i hate it, and i ve many doubts that it will work.

 

Another ugly way would be to use bool(false) instead of false where is getting the error.... but i don't really like to modify std files..

 

 

A test that i think i may try to suggest you use to move the standard files included in AsyncSQL.h to the beginning of the file (move them above the other includes, i ve seen your files in stackoverflow question you made)

 

 

EDIT:

I ve found the cause of the error, it is a macro in libthrecore/stdafx.h and following my suggestion of move up the standard headers and move down the user defined headers you will solve your error.

 

here the macro is destroying the standard code:


#ifndef false
#define false	0
#define true	(!false)
#endif

 

Edited by Ikarus_
  • Love 1

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.