Apparently gcc-13.2.1 now works a little differently, as does clang-17. For clang I had to add the line #include <unistd.h>, since clang complained about the lack of chdir. I don’t know what changes this is connected with.
I checked, I can say that adding the line #include <cstdlib> is necessary after updating >=libxml2-2.12.0. Adding the line #include <unistd.h> is needed for >=clang-17. At least the reasons are now clear.
I checked, I can say that adding the line `#include <cstdlib>` is necessary after updating `>=libxml2-2.12.0`. Adding the line `#include <unistd.h>` is needed for `>=clang-17`. At least the reasons are now clear.
I don't see a problem to add an include if that is needed. Just create proper PR for it.
Perhaps there is still a problem. TDE can be compiled not only on Linux, but also on FreeBSD, so you need to be sure that the solution will work on both systems.
I don’t know if it’s possible to add the line for the native FreeBSD compiler:
#include <cstdlib>
Adding #include <cstdlib> to *.cpp files seems more correct, but this does not change the fact that previously this support was included somewhere in the libxml2 header files. It just happened that after the update it showed up.
The header file unistd.h will most likely be available on both operating systems, so most likely it can simply be included in the assembly without being tied to the compiler version, since the check for inclusion is already present in this file.
> I don't see a problem to add an include if that is needed. Just create proper PR for it.
Perhaps there is still a problem. TDE can be compiled not only on Linux, but also on FreeBSD, so you need to be sure that the solution will work on both systems.
I don’t know if it’s possible to add the line for the native FreeBSD compiler:
```
#include <cstdlib>
```
Adding `#include <cstdlib>` to `*.cpp` files seems more correct, but this does not change the fact that previously this support was included somewhere in the libxml2 header files. It just happened that after the update it showed up.
The header file `unistd.h` will most likely be available on both operating systems, so most likely it can simply be included in the assembly without being tied to the compiler version, since the check for inclusion is already present in this file.
Following in "files.cpp" should be chdir() header include for Windows, <unistd.h>' is for Unix, so #else` block may be better place for the header.
#ifdef WIN32
#include <direct.h>
#endif
For xmlGetLastError(), how about simply change xmlErrorPtr errorPtr = xmlGetLastError(); to const xmlErrorPtr errorPtr = xmlGetLastError(); ?
Following in "files.cpp" should be `chdir()` header include for Windows, `<unistd.h>' is for Unix, so `#else` block may be better place for the header.
```
#ifdef WIN32
#include <direct.h>
#endif
```
For `xmlGetLastError()`, how about simply change `xmlErrorPtr errorPtr = xmlGetLastError();` to `const xmlErrorPtr errorPtr = xmlGetLastError();` ?
Following in "files.cpp" should be chdir() header include for Windows, <unistd.h>' is for Unix, so #else` block may be better place for the header.
Yes, that can be done. But that’s why I said that this is a temporary solution, since it requires more careful consideration. I just did this quickly to ensure assembly.
For xmlGetLastError(), how about simply change xmlErrorPtr errorPtr = xmlGetLastError(); to const xmlErrorPtr errorPtr = xmlGetLastError(); ?
I understand that you meant const xmlError*. I tried this from the very beginning, but the xmlResetError() function only works with the xmlErrorPtr type, so I quickly made other changes just to ensure the build.
I looked at the libxml2 code and came to the conclusion that these lines need to be changed in Quanta:
This looks more correct.
Now it remains to make sure that the cstdlib file is available in FreeBSD, in earlier versions I know for sure it was available, but in the latest versions clang is used by default instead of gcc, so I don’t know what the situation is with this.
> Following in "files.cpp" should be chdir() header include for Windows, <unistd.h>' is for Unix, so #else` block may be better place for the header.
Yes, that can be done. But that’s why I said that this is a temporary solution, since it requires more careful consideration. I just did this quickly to ensure assembly.
> For xmlGetLastError(), how about simply change xmlErrorPtr errorPtr = xmlGetLastError(); to const xmlErrorPtr errorPtr = xmlGetLastError(); ?
I understand that you meant `const xmlError*`. I tried this from the very beginning, but the xmlResetError() function only works with the xmlErrorPtr type, so I quickly made other changes just to ensure the build.
I looked at the libxml2 code and came to the conclusion that these lines need to be changed in Quanta:
```
- xmlErrorPtr errorPtr = xmlGetLastError();
+ const xmlError* errorPtr = xmlGetLastError();
```
```
- xmlResetError(errorPtr);
+ xmlResetLastError();
+ errorPtr = nullptr;
```
This looks more correct.
Now it remains to make sure that the `cstdlib` file is available in FreeBSD, in earlier versions I know for sure it was available, but in the latest versions clang is used by default instead of gcc, so I don’t know what the situation is with this.
I made another update and decided to remove TDE completely and rebuild it again. Got several errors.
Kxsldbg
I solved the problem of assembling Kxsldbg using the patch:
Apparently gcc-13.2.1 now works a little differently, as does clang-17. For clang I had to add the line
#include <unistd.h>,
since clang complained about the lack ofchdir
. I don’t know what changes this is connected with.Error while building Quanta:
Since
libxml2-2.12.0
, thexmlGetLastError()
function returns aconst xmlError*
. I applied this patch as a temporary solution:This requires detailed consideration. The error is reproduced on both the stable version and the live version.
I checked, I can say that adding the line
#include <cstdlib>
is necessary after updating>=libxml2-2.12.0
. Adding the line#include <unistd.h>
is needed for>=clang-17
. At least the reasons are now clear.I don't see a problem to add an include if that is needed. Just create proper PR for it.
Perhaps there is still a problem. TDE can be compiled not only on Linux, but also on FreeBSD, so you need to be sure that the solution will work on both systems.
I don’t know if it’s possible to add the line for the native FreeBSD compiler:
Adding
#include <cstdlib>
to*.cpp
files seems more correct, but this does not change the fact that previously this support was included somewhere in the libxml2 header files. It just happened that after the update it showed up.The header file
unistd.h
will most likely be available on both operating systems, so most likely it can simply be included in the assembly without being tied to the compiler version, since the check for inclusion is already present in this file.Following in "files.cpp" should be
chdir()
header include for Windows,<unistd.h>' is for Unix, so
#else` block may be better place for the header.For
xmlGetLastError()
, how about simply changexmlErrorPtr errorPtr = xmlGetLastError();
toconst xmlErrorPtr errorPtr = xmlGetLastError();
?Yes, that can be done. But that’s why I said that this is a temporary solution, since it requires more careful consideration. I just did this quickly to ensure assembly.
I understand that you meant
const xmlError*
. I tried this from the very beginning, but the xmlResetError() function only works with the xmlErrorPtr type, so I quickly made other changes just to ensure the build.I looked at the libxml2 code and came to the conclusion that these lines need to be changed in Quanta:
This looks more correct.
Now it remains to make sure that the
cstdlib
file is available in FreeBSD, in earlier versions I know for sure it was available, but in the latest versions clang is used by default instead of gcc, so I don’t know what the situation is with this.My test machine is FreeBSD 13.3-RELEASE and
cstdlib
seems to be available.Great then, I've already written several patches. Now I'll add PR.
cstdlib
is part of the C++ C library since the c++98 standard, so I reckon it should be available pretty much everywhereSolved by PR #43.