Embarcadero and free opc ua - c++

I'm trying to get an app working with a PLC. I'm using this library: https://github.com/FreeOpcUa/freeopcua
example code: https://github.com/FreeOpcUa/freeopcua/blob/master/src/examples/example_client.cpp
But when I include the header files(like in the example) from the library it gives an error:
Non-Virtual function 'DateTime::DateTime(const DateTime &)' declared pure.
When I search the specific line of this error it shows me this:
DateTime(const DateTime&) = default;
I already asked it on the github page, and they are saying it has something to do with my compiler. I never touched it, so it shouldn't be having odd options.
So how can I solve this? And if there is something wrong with my compiler, How can I change my compiler options to get it fixed?

Yes, bcc32 don't allow to create instance of abstract class. So you can change target platform to win64 and compile without errors.
Another way, as Thorsten Schöning said, you can use C++ Builder 10 with bcc32c based CLANG compiler and do it also without errors.

Related

internal compiler error: in decode_addr_const, at varasm.c:2632

When I compile a project using cross compiler,I come across the following error:
internal compiler error: in decode_addr_const, at varasm.c:2632
Where can I find the varasm.c file?I searched the project directory and cross compiler directory,but I didn't find it.
Thanks for helpping,Light
The compiler maker has that file, and probably won't give it to you.
But as it seems to be an error in the compiler, you can either contact them / file a bug report, or try to avoid the error by changing your code a bit (which is a guessing game, as you don't know how you made it run into the error). Or use another compiler, if there are choices.

Compile errors using PST SDK

I am porting a project from Windows to Linux/Ubuntu, which involves using open software called "PST SDK"
(http://pstsdk.codeplex.com) written in c++. This has not been updated since 2010 but it works fine in
Windows and supposedly works/did work in Linux. I set up a demo program with nothing more than including
the header files (the library is all headers, nothing to link). I had a lot of errors but got them
fixed by using g++ instead of gcc, and fiddling with the location of the library files and required
boost files.
However once I tried making some calls, I ran into problems. I got a few things working, but the
following code:
std::vector<pstsdk::folder> folderlist;
folderlist.push_back(folder);
causes this compile error:
error: 'pstsdk::property_bag& pstsdk::property_bag::operator=(const pstsdk::property_bag&)' is private
(There is a lot of other veribiage about what was instantiated from what file). Here is the compile command:
g++ -c -I/usr/local/include -Iboost_1_46_1 -Ipstsdk -I/usr/local/include/mysql ostdemo.cpp
It is specifically the push_back call causing the errors - take that out and they go away. Of course
that is critical to the working of my program. Any idea what this could be? I assume it has
something to do with my compiler version or switches, but I can't figure it out. I am not much of
a c++ programmer so any help would be appreciated.
Your vector::push_back() requires that the type is copy-assignable. Obviously, your pstsdk::folder is not copy-assignable due to the assignment operator being private.
What are the requirements for a type to be placed in a vector? It depends on whether you're using pre-C++11 or C++11, plus what operations you plan to do on these types. See here:
http://en.cppreference.com/w/cpp/container/vector
Pay attention to CopyAssignable, CopyConstructible, MoveAssignable and MoveConstructible
So the case of it working with Windows as opposed to Linux:
Remember that "Windows" and "Linux" are not C++ compilers. You need to expand on this and tell us what version of the g++ compiler you're using on each OS.

Building C++ application for eCos on ARM

I'm looking to build a C++ application for eCos on an ARM processor. My program requires several standard C++ header files such as vector, iostream, list, ...
My question is: how can I achieve this? Does anyone have any experience building and deploying C++ applications for eCos?
When I use the arm-eabi-g++ compiler to compile the application, I get the following error
fatal error: vector: No such file or directory
meaning that the C++ vector library is not present.
However, the arm-none-eabi-g++ compiler does include these standard header files. I do get the following errors for '':
In file included from /opt/arm-2010.09/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/include/c++/4.5.1/bits/locale_facets.h:43:0,
from /opt/arm-2010.09/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/include/c++/4.5.1/bits/basic_ios.h:39,
from /opt/arm-2010.09/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/include/c++/4.5.1/ios:45,
from /opt/arm-2010.09/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/include/c++/4.5.1/ostream:40,
from /opt/arm-2010.09/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/include/c++/4.5.1/iostream:40,
/opt/arm-2010.09/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/include/c++/4.5.1/arm-none-eabi/bits/ctype_base.h:44:35: error: '_U' was not declared in this scope
/opt/arm-2010.09/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/include/c++/4.5.1/arm-none-eabi/bits/ctype_base.h:45:32: error: '_L' was not declared in this scope
/opt/arm-2010.09/bin/../lib/gcc/arm-none-eabi/4.5.1/../../../../arm-none-eabi/include/c++/4.5.1/arm-none-eabi/bits/ctype_base.h:46:32: error: '_U' was not declared in this scope
...
Can I use the arm-none-eabi-g++ compiler for eCos? If yes, how do I solve these errors? If no, what should I do?
Many thanks in advance!
vector, list, they are basically belong to Standard template library. For ecos there might be something similar available likewise BOOST.
I think u can check this link
You need ustl. See Using uSTL in eCos applications.
Here's a short example for using vector.
You must include
#include <ustl.h>
Then you may instantiate a vector like so:
ustl::vector<int> v(2);

ZXing Library: Errors in iOS: private field 'cached_y_' is not used

I am currently trying to use the ZXing Library for an iOS Project. However I can't even get the sample Projects to work.
The ScanTest Project, as well as the ones that I created myself throw the following error in the BinaryBitmap.cpp file.
In file included from /Volumes/Macintosh HD/Users/Tim/Downloads/zxing-2.1/iphone/ZXingWidget/../../cpp/core/src/zxing/BinaryBitmap.cpp:20:
../../cpp/core/src/zxing/BinaryBitmap.h:33:7: error: private field 'cached_y_' is not used [-Werror,-Wunused-private-field]
int cached_y_;
^
1 error generated.
I searched on Google and Stackoverflow, but have not found a solution for the problem.
I have tried it with both the current stable release of XCode and the beta.
I don't know if anybody else has got this problem too, but any help would be greatly appreciated.
This is clang, right? You can read about the relevant compiler options here.
The error message is telling you which compiler flags are relevant.
-Wunused-private-field means you get warnings about private member fields of classes (or structs, ...) that are not used anywhere. The warning is because you probably did mean to use them. This would not normally stop the compilation, but...
-Werror turns warnings into errors. A lot of people use this option to force themselves to write very clean code. Taking this one out should be enough.

Set Up iOS project to use eigen

I'm trying to set up an iOS project to compile a c++ library called Eigen for Linear Algebra maths.
I begin following the instructions of the Question mentioned in:
How to compile Eigen in iPhone
But there are still some kind of things I could not figure out.
User Stafan said to set the right compiler flags (-mfpu=neon -mfloat-abi=softfp). Where do I set those flags? I already found out to set flags for a single file like in http://meandmark.com/blog/2011/10/xcode-4-setting-compiler-flags-for-a-single-file/. But for what files do I need to set this flags? Especially the c++ files from the Eigen library do not appear here.
User Blukee said that he used armv7 optimized arch in build setting. In build settings I see in the Architectures category a green field saying Standard(armv7) is that what right?
I just created a ,,singleViewApplication'' and wanted to use the c++ files in an new Objective C class called MathLibary. Because some guys said that it is possible to mix up Objective C and C++ if I name the class MathLibary.hh and MathLibary.mm.
The class looks like
#import "MathLibary.hh"
#define EIGEN_DONT_VECTORIZE
#import "SVD.h"
#implementation MathLibary
#end
When I try to run the App the build fails an the compiler gives out some errors like:
In line 47 in SVD.h file, which is:
typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
The error is Expected a qualified name after 'type name'
For me it sounds as that the compiler tries to compile the SVD.h as objective c file but is c++.
How do I change the compiler to compile both objective c files for the user interface and the c++ files from the library
I hope that somebody is able to help me, thanks a lot.
If you want to mix ObjC and C++, did you make sure to rename your file to have a ".mm" suffix? :)