pcl::io has no member savePolygonFile - visual-studio-2010

I don't know where is the function savePolygonFileSTL in pcl 1.6. Which file do I have to include?
Here it says that it is part of
#include <pcl/pcl_config.h>
#include <boost/cstdint.hpp>
#include <cstdlib>
#include <iostream>
#include <stdarg.h>
#include <stdio.h>
#include <math.h>
Anyway VS2010 doesn't find it, and also with manually search I didn't find the definition of that function in all pcl 1.6 folders. Neither savePolygonFile exists or similar.
How is it possible? There is something that I don't know? Please help me.
Thanks a lot

As mentioned in this tutorial, you could try to include the following include at the top of your code:
#include <pcl/io/pcd_io.h>
Update: by looking at the PCL 1.6 source code here, it looks like the savePolygonFileSTL function is defined in the vtk_lib_io.h header. Try to include it adding this line to your code:
#include <pcl/io/vtk_lib_io.h>
Please be sure to have a VTK enabled PCL build.

Related

Xcode references wrong path to Mono

I'm trying to compile the c code generated by Embeddinator-4000 but Xcode can't find the specified path to Mono.
These are the headers that are currently giving me problems:
#include <mono/jit/jit.h>
#include <mono/metadata/mono-config.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/debug-helpers.h>
#include <mono/metadata/object.h>
However these paths work:
#include <Mono/mono-2.0/mono/jit/jit.h>
#include <Mono/mono-2.0/mono/metadata/mono-config.h>
#include <Mono/mono-2.0/mono/metadata/assembly.h>
#include <Mono/mono-2.0/mono/metadata/debug-helpers.h>
#include <Mono/mono-2.0/mono/metadata/object.h>
The problem is that jit.h includes <mono/metadata/appdomain.h> and Xcode can't find it.
Is there a way to alias the framework so I don't have to modify my current install of Mono?
Thanks!

Open GL ES error: undefined reference to 'glDispatchCompute'

I am using Open GL ES 3.1 in Android app with native C++ code. So I need to run a C++ lib with Android support.
I have used some Open GL ES functions and they worked well. But when I tried to use glDispatchCompute, a linker gave a following error: undefined reference to 'glDispatchCompute'.
Here is the call:
glDispatchCompute(10, 1, 1);
Here are my includes:
#include <string>
#include <jni.h>
#include <GLES3/gl31.h>
#include <GLES/egl.h>
#include <GLES/gl.h>
#include <GLES3/gl3ext.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
Here are my options for clang:
-lGLESv3 -lGLESv2 -lGLESv1_CM -lEGL
Also I tried -lGLESv3 -lEGL with the same effect.
The problem was in not using proper java libraries and activities. In sample app there are 3 activities in Java. After adding them everything worked well.

GCC inlining failed in call to always_inline [duplicate]

I'm trying to run a Visual Studio cpp project created by a friend of mine. I'm trying to run the file without VS. But I'm getting a list of errors, all in the same format:
inlining failed in call to always_inline '__m256d _mm256_broadcast_sd(const double*)': target specific option mismatch|
It runs correctly in VS with release mode and breaks when run in debug mode.
The includes are as follows:
#include "stdafx.h"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <vector>
# include <omp.h>
#include <chrono>
#include <fstream>
#include <algorithm>
#include <immintrin.h>
using namespace std::chrono;
using namespace std;
and the error is called from here:
double zero = 0;
__m256d acc = _mm256_broadcast_sd(&zero);
Update:
I'm using the this command to run it: g++ -std=c++0x multip.cpp -o multip, is there an additional parameter to add -mavx to the compiler invocation?
"Target specific option mismatch" means that you're missing a feature flag from your GCC invocation. You probably need to add -mavx to your compiler invocation.
If you're intending to run this on your computer only, -march=native will turn on all the feature flags that your own machine supports.

fmod issue undefined reference

Hey so i am trying to use fmod as i have to take the modulus of two doubles. My make file does the following.
gcc -static -lm vm_main.c vm_options.c vm_menu.c vm_utility.c -o main
so the -lm tag should include the math header right?
i have included math.h in my files.
#include "vm_menu.h"
#include "vm_type.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
im a little confused as to why this is occurring... :/
so the -lm tag should include the math header right?
No, it tells the linker to link to libm, the math library. That's a library, not a header. But the order of linker options is important so it needs to come after the files that use it.

gcc don't respect hierarchy of include files

I used the word hierarchy, but I'm not sure if it's the right one! Let me explain.
I have A.h with:
#include <iostream>
#include <vector>
using namespace std;
I have B.h with:
typedef vector<int> int_vector;
int_vector my_function(int x, int y);
Finally I have X.h, which is:
#include "A.h"
#include "B.h"
And X.cpp:
#include "X.h"
// and the rest
But when I compile that with GCC, it says in B.h, vector not defined and so on. Note that this is an example to explain the problem. The project I'm trying to convert to compile on linux compiles perfectly on Windows under Visual Studio.
I could change the files, but it a 300+ files project, so any help or suggestion that would be incredibly efficient ?
There's nothing wrong with the code that you've posted, and it seems unlikely that there would be a bug of this nature in gcc.
More likely the problem isn't what it seems. For example, it could be that there are multiple A.h (or B.h, or X.h) files in your project, and the wrong file is being included somewhere.
My advice would be to run one problematic .cpp file through the preprocessor (gcc -E) and examine the result. That will tell you exactly what is being included when.

Resources