miércoles, 14 de febrero de 2024

Mensaje de error al abrir Qt Creator

        Desde hace un tiempo cada vez que abria Qt Creator en Windows aparecia un MessageBox con el titulo "gdb.exe - System Error" y el siguiente mensaje:

The code execution cannot proceed because libpython3.9.dll was not found. Reinstalling the program may fix this problem.


        Probe unas cuantas cosas, primero lo que solicito el mensaje, desinstalar Qt por completo y reinstalar. esto no hizo ningún cambio al problema. Después el sospechoso obvio era python, probe instalar python 3.9 y nada. Desinstalé el python que ya tenia, que creo era la version 3.11, también desinstalé todas las versiones y nada. Llegue a pensar que era algo relacionado a Windows 11, ya que tengo otra maquina con Windows 10 sin este problema. Me rendí por el momento y lo deje así, ya que Qt Creator era funcional, solo era la molestia.

        Después de unos meses ignorando el mensaje, se me ocurrió si había alguna instalación conflictiva de gdb, para encontrar cual es el programa que se ejecuta en linux al invocar un comando se usa el comando which, pero Windows no cuenta con el, en cambio la alternativa que esta disponible en versiones recientes es el comando where, simplemente escribí "where gdb.exe"  dentro de windows terminal y me dio el resultado:

C:\Program Files\Inkscape\bin\gdb.exe

        Por alguna razon que desconozco inkscape incluye a gdb, así que lo borre para ver si solucionaba el problema, esta vez dejo de aparecer el mensaje, inkscape también sigue funcional, tal vez lo necesite para una funcionalidad que yo no uso.

lunes, 4 de diciembre de 2023

What are some of the worst things about C/C++?



Top 5 things I don’t like from C++

#5. std::queue
This container doesn’t have an iterator, you can access the underlying container (usually std::list or std::deque) but that doesn’t feel right.

#4. std::array
This container is useful, but it has one flaw, the size is chosen at compile time. A non resizable container that could specify size at runtime is missing.

#3. enum class
The currently recommended way to uses enums is enum class. But I'm not gonna doit, declaring them that way removes the basic operators that usually can be used with enumerator, you could use static_cast on each access to the variable, but it would look horrible. The idiomatic way would be to override operator<< for your enum class, but if you have several enum class it becomes against the DRY principle. You could say: "only create one enum class with all your values", that would be against the purpose of the enum class, avoiding asigning a non valid or duplicate value.

#2. std::map::operator[]
When using that operator passing a Key that doesn’t exists, it will create the Key

#1. std::string
This class is missing (or added really late) several functions that are available in alternatives like wxString or QString, this functions include startsWith, contains, tokenizing, converting from float with specific locale

#BONUSTRACK. The C language
Sooner or later you will need some advanced feature like databases, compression or network and the option to use a mature library written in C will be one of the best options. The bad side being that you will be mixing C++ and C idioms, it wont be pretty. Then there is the option to use a wrapper, but those get deprecated sometimes without reason.

P.D. I really like this language this are the few thing I don’t really like.