how to link cplex callable library (c api ) with c++ builder - c++builder

I have IBM's CPLEX 12.7 and Embarcadero's C++Builder. I am trying to link to CPLEX but I am failing. So now I want to use the Callable Library (C API) instead. My question is, how can I setup C++Builder to call the CPLEX C API? How do I link to it?

Related

LabVIEW using C DLL using OpenCV DLL

I am developping a C++ DLL with C wrapper to be able to use it in different languages. For now, I can use it in C# and Python, and before to find how to do it on MATLAB, I have to find the way to read it on LabVIEW.
I am using Visual Studio, so I installed openCV on C:\, added the include directory and the .lib files to my project, created a new environment variable, and in my DLL I use it using #include <opencv2/core/core.hpp>. All this in 32 bits of course because LabVIEW is very bad on 64 bits.
But, when I create a node with "Call Library Function Node", after setting inputs/outputs, I click on OK and LabVIEW tell me it didn't find the dll associated to OpenCV.
I am a total newbie on this field (DLL) so I am not aware of what I have to check or add in LabVIEW.
Thank you in advance.
I'd suggest you to use Open CV static libs instead of DLL. You can download OpenCV source from opencv.org and download latest version of CMake from cmake.org. CMake will generate Visual Studio solution and other required files from platform-independent source files. So you will be able to change Visual Studio project target from DLL to static LIB and build static libs of Open CV on your own PC.
I finally managed this issue. I only had to copy/paste the DLL files of OpenCV on the same directory of the LabVIEW library.

How and where can I write ARM Assembly codes in Embarcadero Delphi XE5 with Android?

How and where can I write ARM Assembly codes in Embarcadero Delphi XE5 with Android?
That would be the best, if I can write it inline.
Delphi mobile compiler do not support the asm ... end blocks.
But the "old good way" is still available, since we are talking about a Native compiler.
What you can do is compile your own module with an external assembler (e.g. GNU AS), then link it to your Delphi XE* application.
For instance, System.RTTI uses low-level asm tricks via external statically linked files:
procedure RawInvoke(CodeAddress: Pointer; ParamBlock: PParamBlock);
external 'librtlhelper.a' name 'rtti_raw_invoke';
procedure RawIntercept;
external 'librtlhelper.a' name 'rtti_raw_intercept';
Take a look at this Japanese article - Google translate is your friend!
It is not possible.
Use Atomic Instrinsics Instead of Assembly Language.
Quote:
The Delphi mobile compilers do not support a built-in assembler.
The Delphi mobile compilers do not support inline assembler. The documentation makes this clear:
The inline assembler is available on:
DCC32.EXE, the Delphi Command Line Compiler
DCC64.EXE, the Delphi 64-bit Command Line Compiler
DCCOSX.EXE, the Delphi Cross Compiler for OS X
You'll need to find an assembler to create something that the Delphi mobile compiler can consume, for instance a shared library.
You can not.
LLVM - which is the engine behind Delphi Mobile - has its kind of an assembler language: http://llvm.org/docs/CommandGuide/llvm-as.html
But it would hardly be ARM kind or x86 kind, since LLVM tries to be CPU-agnostic.
Anyway Delphi officially has no support neither for CPU-native assembling language nor for LLVM kind of it.
http://docwiki.embarcadero.com/RADStudio/XE4/en/Migrating_Delphi_Code_to_iOS_from_Desktop#Use_Atomic_Instrinsics_Instead_of_Assembly_Language
http://docwiki.embarcadero.com/RADStudio/XE4/en/Using_Inline_Assembly_Code

FIX protocol engine for Delphi?

Can anyone recommend a FIX Engine (commercial or open source) for use with Delphi?
Is it possible to use QuickFIX with Delphi?
Take a look at B2BITS FIX Antenna. There are two possible options:
FIX Antenna C++ has ANSI C interface that can be used in Delphi (there is a sample in the package)
http://www.b2bits.com/trading_solutions/fix_engines/fix_engine_cpp.html
FIX Antenna .NET can be used in Delphi .NET (there is again a sample in the package; also programmer's guide contains Delphi.NET samples)
http://www.b2bits.com/trading_solutions/fix_engines/fix_enginenet.html
Feel free to contact me directly if you need more details.
QuickFix is a C++ project.
Both Python and Ruby use SWIG to expose the C++ classes as native Python and Ruby classes.
The .NET wrapper sounds like a mix of C++ and C# code.
It's not possible to import C++ classes within Delphi directly. You'll have to use a "flat API" conversion, exposing all C++ methods as plain C declarations, in order to import external structures and functions in a Delphi unit.
To my knowledge, there is no such "flat API" of QuickFIX available, and no SWIG version able to generate Delphi code. You'll have to write your own wrapper in C++, or perhaps write your own FIX implementation in Delphi.
The only FIX library I know for Delphi is the one from http://www.b2bits.com - it did exist some years ago, but I'm not sure it's still sold/maintained - they seems to maintain only a DotNet version. Worth asking them for pricing and availability, in all cases.
One way to integrate the protocol with Delphi would be building a .Net or Java bridge, for example:
use the .Net C# implementation to build a small application to communicate with the FIX side
then expose methods (and maybe even the objects) of this .Net app over SOAP web services
use Delphi's web service client code generator to import the SOAP WSDL
access the web service from the Delphi side
This is probably more of a hack than anything else, but you could use the Python QuickFIX bindings in Delphi, via python4delphi. That's a lot of layers though (Delphi to Python to C++).
Python is an easy language to use, and learn, and it's easy to invoke and create python objects (or native C wrappers that pretend to be python objects) and invoke them directly from the Python4Delphi API.
Barring that, it might be very little work for you to build a procedural (flat) API as ABouchez said. Instead of writing a million functions I would write only the ones I needed, and then implement these simple functions inside a VC++ DLL:
QuickFixInit;
QuickFixCleanup;
handle := QuickFixLoadFile(filename)
QuickFixSaveFile(handle)
handle2 := QuickFixGetObjectHandle(handle,index,...);
QuickFixModifyObjectProperty(handle2, propertyname, propertyvalue );
QuickFixExecuteSomeAction( handle2, actionname, param1,param2,param3 );
The above are just to give you the flavor. I know nothing about the internal API, but what I'm showing you above is that you don't need to conform 100% to the API to write a wrapper. You could probably (if you know C/C++) write a functional wrapper that does what you need, and export it, link it into a DLL, and then import QuickFix.dll into Python with very little (2-4 hours of an expert's time) work, if you know Visual C++ well enough to write a few simple C-style (non OOP) functions that instantiate C++ classes, and invoke C++ methods.
It might be possible to expose the C++ APIs to Delphi via a C++Builder package (BPL) containing QuickFIx, but (a) some source modifications would be required, and (b) the C++ code in QuickFix, or its dependencies, might not build in C++Builder without significant modifications.

How to add opencv to turbo c++?

I need to work with opencv library using turbo c++. I've downloaded opencv and installed turbo c++, but how to integrate both of them
Open CV uses .dll files and which are not supported by turbo c++
and many other issues like 16 bit etc. Hence it is not possible.I also tried for using open GL but it did not worked in turbo c++.
Download Dev c++ instead .Its just 9 MB download.
use the link to downlaod:Dev Cpp

How to consume and re-expose a Win32 type library using Delphi Prism

I currently have a Win32 type library created in Delphi which I need to consume, implement and re-expose via .NET. What are the steps necessary to bring the TLB into Prism so the interface can be implemented?
the .NET 2.0 sdk tool TLBIMP can create an assembly from a TLB file. Something like:
tlbimp.exe mytlb.tlb /out:MyTLB.Import.dll /namespace:MyTLBImport
Make sure you use /publickey /keyfile or /keycontainer if you want to sign it later on.
After the import, just reference the dll and use it as a regular library.

Resources