Strange errors in intel's tbb - c++

I've build intel's tbb, and in my qt pro file I've included following line:
INCLUDEPATH += "C:\\Downloads\\libraries\\tbb40_297oss\\include"
but when I try to compile my project I'm getting an error:
c:\Downloads\libraries\tbb40_297oss\include\tbb\internal\..\tbb_exception.h:340: error: 'exception_ptr' in namespace 'std' does not name a type
Is there anything else I'm supposed to do? I cannot find any .lib files anywhere.

It is because you don't have _GLIBCXX_ATOMIC_BUILTINS_N (N = 1,2,4,8) defined in bits/c++config.h
Well this was my problem. It turned out that my MingW was not installed properly because of a configuration issue.
When I was dealing with that I had spent too much time with those types of shit and it was very very late at night. I had got sick and defined those macros myself.
TBB compiles and runs without problems since that day.

Related

internal error in mingw32_gt_pch_use_address, at config/i386/host-mingw32.c:190: MapViewOfFileEx: Attempt to access invalid address

internal error in mingw32_gt_pch_use_address, at config/i386/host-mingw32.c:190: MapViewOfFileEx: Attempt to access invalid address.
I get this error while compiling a c++ program in sublime-text 3.
How to resolve this error?
In my case, this problem is due to #include<bits/stdc++.h>. Comment this line and get #include <iostream> to solve the problem.
If you have precompiled <stdc++.h> then you have stdc++.h.gch file in this path (path could be different on basis of where you installed MinGW and version) :
C:\MinGW\lib\gcc\mingw32\9.2.0\include\c++\mingw32\bits
So to solve this problem delete stdc++.h.gch file and paste these two commands in your terminal :
Go to the path having your precompiled header in command line
cd C:\MinGW\lib\gcc\mingw32\9.2.0\include\c++\mingw32\bits
Precompile header (mine version is c++17)
g++ -std=c++17 stdc++.h
I have found this solution on a codechef discussion and it works for me.
I got this problem after installing CodeBlocks, maybe it is because of codeblocks MINGW settings. My initial MinGW is from DEV-C++.
So what I did is this.
1.Delete "C:\...\GnuWin" from PATH.
2.Ensure that you have your old path to your compiler. In my case it was "C:\...\DevCPP\Mingw\bin"
For me, this error popped up right after I updated my SublimeText application to the latest version, so just restarting the system worked for me!
I'm not sure what caused this problem today, but I have seen it a few times before.
For me, a full clean and recompile solves it.
I got this same problem after pre-compiling the stdc++.h file, to get rid of this error, I removed the compiled version of this header that is stdc++.gch.
File path of stdc++.h and stdc++.gch is
C:\Users\UserName\Downloads\MinGW\include\c++\9.2.0\x86_64-w64-mingw32\bits

error: '_Out_' has not been declared when including <Kinect.h>

I'm using CLion and I need to get some data from the Kinect, but when it comes to #include <Kinect.h> I get the following error:
In file included from C:/PROGRA~1/MICROS~2/Kinect/V2D305~1.0_1/inc/Kinect.h:547,
from C:\Users\fredd\CLionProjects\3D_avatar\main.cpp:19:
C:/PROGRA~1/MICROS~2/Kinect/V2D305~1.0_1/inc/Kinect.INPC.h:109:13: error: '_Out_' has not been declared
_Out_ WAITABLE_HANDLE *waitableHandle) = 0;
^~~~~
And an endless list of similar errors. I think I miss some kind of library that defines this data format, but I really don't know (if that's the problem) which one. I've searched all over the internet and googled for about 3 hours without any result.
How can I solve the error?
Also, is there a better way to make Kinect works with CLion?
I've managed to understand what was going on: MinGW couldn't compile SAL annotations, so I had to switch compiler to MSVC, bundled with Visual Studio. Also, I had to link MatLab with my project since there's no library (except for libfreenect2, which has driven me mad) that can handle a Kinect v2.

Declaring a static pointer in class [duplicate]

While compiling on x64 plattform I am getting following error:
c:\codavs05\hpsw-sc\ovpacc\tools\codaaccesstest\coda_access.cpp(1572): fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'f:\dd\vctools\compiler\utc\src\p2\sizeopt.c', line 55)
To work around this problem, try simplifying or changing the program near the locations listed above.
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
------ Build started: Project: asyncexample, Configuration: Release Win32 ------
If I change settings to preprocessor file (Yes) i am not getting any error.
About my environment: Upgrading Microsoft Visual Studio 2005 to 2010
Please help.
I have had this problem with VS2015 while building locally in Windows.
In order to solve it, I deleted my build folder (Output Directory as seen in Properties/General) and rebuilt the project.
This always seems to help when strange things happen during the build.
I’ve encountered this error many times in VC++. Do the following steps. They’ve sometimes helped me with this issue:
Take a look at the exact location, pointed out by compiler error.
Find any external types or classes used there at that location.
Change the order of “include path” of those files found in step 2 and rebuild the solution.
I hope that help !!!!
I am getting same error with VC2012. Setting up the project properties Optimization to Disabled (/Od) resolved the issue.
In my solution, i've removed output dll file of the project, and I've made project rebuild.
I encountered the same error and spent quite a bit of time hunting for the problem. Finally I discovered that function that the error was pointing to had an infinite while loop. Fixed that and the error went away.
In my case was the use of a static lambda function with a QStringList argument. If I commented the regions where the QStringList was used the file compiled, otherwise the compiler reported the C1001 error. Changing the lambda function to non-static solved the problem (obviously other options could have been to use a global function within an anonymous namespace or a static private method of the class).
I got this error using boost library with VS2017. Cleaning the solution and rebuilding it, solved the problem.
I also had this problem while upgrading from VS2008 to VS2010.
To fix, I have to install a VS2008 patch (KB976656).
Maybe there is a similar patch for VS2005 ?
I got the same error, but with a different file referenced in the error message, on a VS 2015 / x64 / Win7 build. In my case the file was main.cpp. Fixing it for me was as easy as doing a rebuild all (and finding something else to do while the million plus lines of code got processed).
Update: it turns out the root cause is my hard drive is failing. After other symptoms prompted me to run chkdsk, I discovered that most of the bad sectors that were replaced were in .obj, .pdb, and other compiler-generated files.
I got this one with code during refactoring with a lack of care (and with templates, it case that was what made an ICE rather than a normal compile time error)
Simplified code:
void myFunction() {
using std::is_same_v;
for (auto i ...) {
myOtherFunction(..., i);
}
}
void myOtherFunction(..., size_t idx) {
// no statement using std::is_same_v;
if constexpr (is_same_v<T, char>) {
...
}
}
I had this error when I was compiling to a x64 target.
Changing to x86 let me compile the program.
Sometimes helps reordering the code. I had once this error in Visual Studio 2013 and this was only solved by reordering the members of the class (I had an enum member, few strings members and some more enum members of the same enum class. It only compiled after I've put the enum members first).
In my case, this was causing the problem:
std::count_if(data.cbegin(), data.cend(), [](const auto& el) { return el.t == t; });
Changing auto to the explicit type fixed the problem.
Had similar problem with Visual Studio 2017 after switching to C++17:
boost/mpl/aux_/preprocessed/plain/full_lambda.hpp(203): fatal error C1001: An internal error has occurred in the compiler.
1>(compiler file 'msc1.cpp', line 1518)
1> To work around this problem, try simplifying or changing the program near the locations listed above.
Solved by using Visual Studio 2019.
I first encountered this problem when i was trying to allocate memory to a char* using new char['size']{'text'}, but removing the braces and the text between them solved my problem (just new char['size'];)
Another fix on Windows 10 if you have WSL installed is to disable LxssManager service and reboot the PC.

'class Poco::XML::Element' has no member named 'getNodeByPath'

I am trying to set up openFrameworks with QT, but it seems that i had no success so far. I included all the necessary files i.e. includes, libs etc, but as soon as i compile the program it's showing an error
/home/kalyan/of_v0.9.3_linux64_release/libs/openFrameworks/utils/ofXml.h:204: error: 'class Poco::XML::Element' has no member named 'getNodeByPath'
Poco::XML::Element *e = (Poco::XML::Element*) element->getNodeByPath(path);
^
I even asked in openFrameworks forum, but haven't got any reply.
I am running an example "3dPrimitivesExample" that has been included in openFrameworks build. I built that particular example using make, it generated object files and finally generated an .exe file.
Are you having the same problem I had last week? Old version?
See here:
'Keywords' is not a namespace-name
There is an excellent writeup on how to link QT to Poco using CMAKE in this link here (I never figured out how to do it using QMake):
Clion, cMake and POCO

Have trouble using NCBI c++ toolkit

I'm trying implement a small program to do blast and obtain result without browsers.
The ncbi c++ toolkit seems like what I'm looking for, however, I met some problem of using it.
My environment is windows with MSVC 2010 c++ compiler and QT framework,
I've download, configure, and build the toolkit according to the following instruction.
http://www.ncbi.nlm.nih.gov/books/NBK7167/
and I have all libs (.*lib files) at the directory below:
ncbi_cxx--12_0_0\compilers\msvc1000_prj\dll\lib\ReleaseDLL
Following is an example provided by ncbi, I'm trying to do similar stuff.
http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/lxr/source/src/sample/app/blast/remote_blast_demo.cpp
After everything seems ready, I create a project (with Qt Creator) and try to use the toolkit.
However, the problem occurs when I include any of the header files, for example
#include <corelib/ncbiapp.hpp>
I have no clue how to solve the compiler error when including ncbi libraries.The error message is as follows:
'ncbi::CUtf8::AsUTF8' redefinition of
default parameter : parameter 2 (ncbistr.hpp line 2861)
'ncbi::CStringUTF8 ncbi::CUtf8::AsUTF8(const ncbi::TCharUCS2*,ncbi::SIZE_TYPE)' : member function already defined or declared (ncbistr.hpp line 2861)
'ncbi::CUtf8::AsUTF8' : missing default parameter for parameter 2 (ncbistr.hpp line 2861)
I spent days on figuring how to use this toolkit, if anyone can give me some idea, I'll really appreciate.
By the way, in the project file I do include path and libs.
INCLUDEPATH += "../../lib/ncbi_cxx--12_0_0/include"
LIBS += "../../lib/ncbi_cxx--12_0_0/compilers/msvc1000_prj/dll/lib/ReleaseDLL/*.lib"