« first day (2136 days earlier)      last day (719 days later) » 

12:59 AM
Hi, I'm with a problem to generate a .pdb files in Qt, anyone has some idea? I followed this: blog.inventic.eu/2014/08/… but didnt work
 
 
5 hours later…
6:25 AM
@PeterT it is in the include directory.
 
"the include directory" meaning like /usr/include or something?
 
meaning "\msys64\mingw64\include"
 
and \msys64\mingw64\include is part of the include search path? Or did you add it with "-I\msys64\mingw64\include" ?
 
Just to confirm, does it make a difference if it's in the User variable Path or System variable Path?
 
it makes a difference for search order I guess, but both should be found by #include <xyz.h>
 
6:31 AM
I have a suspicion. g++ was working before I installed MSYS2 and GMP. I think MSYS2 needs its own g++. Maybe the command line is still resolving it to the old g++. What's command for finding out the executable being used by a command?
 
in cmd.exe it's "which gcc", in most posix shells "where gcc"
and yeah, if you had a g++ version from before you installed msys2, then it won't magically add the MSYS2 paths to it's sytem search paths
GCC has those typically hardcoded during compilation
 
Interestingly neither which nor where worked in Powershell, but where worked in CMD
Anyway, it finds two results
 
The first one is the one it will always chose
 
Removing the wrong one from the Path fixes the problem :)
 
 
1 hour later…
8:02 AM
is there a way to check if object is deleted,
so if there's a class that delete itself, and the object now is garbage, is there a check for that?
I am trying to make the pointer that point to this address to equal nullptr.
 
8:34 AM
There's no build-in check of that. Tools like address sanitizer check for that stuff, but that's only meant for debugging
You could do something like add a static registry of all instances, but there's rarely a need to do that. There's better ways to design around this issue most of the time
 
8:56 AM
Thanks
 
9:11 AM
hi,
I have a program where the number of some lines (instructions) changes every time. I thought I'd write these instructions in a separate file and have them added automatically during compilation. Now, I know that in the case of functions we use #include, but in the case of parts of code?

Thanks

example at time T1 the file contains:
y + = 5.12 * sin ((2 * M_PI * i * 0) / 44100);
y + = 1.01 * sin ((2 * M_PI * i * 107.67) / 44100);
y + = 1.29 * sin ((2 * M_PI * i * 109.01) / 44100);
y + = 1.42 * sin ((2 * M_PI * i * 111.7) / 44100);
 
9:30 AM
#include will work just fine, though perhaps it will be a bit confusing for those that don't know how your build works (perhaps comment why you are including a file there and add a comment in the file being included). Changing the extension of the included file to .impl or .inc will further signal that it's not a standard header
but another option is to instead declare a set of arrays and then looping over them
in this case it is only 2 numbers that change each line
#include "fourier_constants.h"
main ()
{
            for (int i = 0; i <500; i ++)
           {
               for(int f = 0; f < fourier_constant_count; f++){
                   y + = fourier_factor[f] * sin ((2 * M_PI * i * fourier_frequency[f]) / 44100);
               }
            }

}
 
9:47 AM
sorry, but what i wrote in main () is just an example, it doesn't make any sense. I just needed to make you understand which compiler directive, if any, can be used to include bits of code.
 
 
1 hour later…
11:11 AM
like I said include will do fine
include does the equivalent of copying the entire file and pasting it instead of the include directive
the only real issue is that it's confusing for the standard person seeing that happen and a header with in-function code at the top level
 
 
2 hours later…
1:02 PM
2 messages moved from Lounge<C++>
 
 
1 hour later…
2:11 PM
Hi, does somebody here used MTuner profiler?
 
2:48 PM
Is there a way to document chunks of c++ code (inside functions) with doxygen, so that it appears either with the function documentation or another place? I think I used it before, but for the life of me, I can't find how to do this again.
Ah, found it, they call it in body documentation, apparently. I'll try that. 🦆
 

« first day (2136 days earlier)      last day (719 days later) »