0

I am trying to build the open62541 in C++ Builder 6. I was able to find steps for doing the same in Visual Studio. But, I want to do it in C++ Builder 6.

I have followed the steps explained for building open62541 using Visual Studio in the following link : https://open62541.org/doc/current/building.html. I don't want to use Visual Studio, but C++ Builder 6. But I am getting error as follows.

I have installed the following s/w.

  1. CMake 3.10.0
  2. Python 2.7.1
  3. C++ Builder 6
  4. Open62541

     cd <path-to>\open62541
    
     mkdir build
    
     cd build
    
     <path-to>\cmake.exe .. -G "C++ Builder 6"
    

But I am getting the error "The system can not find the path specified" when executing the command:

C:\Program Files\CMake\bin\cmake.exe .. -G "C++ Builder 6"

image

I have added CMake to the PATH variable. I would also like to know if building open62541 is possible using C++ Builder 6

Partial Solution:

Commands:

     cd <path-to>\open62541

     mkdir build

     cd build

     cmake <path-to>\cmake.exe .. -G "Borland Makefiles"

These steps gets compiled without any issue and the build directory and files are made. I am still not able to figure out why the open62541.h file was not created even after setting the EN_AMALGAMATION value to YES. Will update once I get a solution

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
inapathtolearn
  • 65
  • 2
  • 10
  • Are you sure that error "The system can not find the path specified" is applied exactly to `cmake.exe`? Please, provide **exact error message** (this error message should include a place where it arise). – Tsyvarev Sep 11 '19 at 10:51
  • @Tsyvarev I am attaching the screenshot of the command prompt where i am getting the error. – inapathtolearn Sep 11 '19 at 11:34
  • 1
    Your **actual command line** is `cd \cmake.exe .. -G "C++ Builder 6"`. Note on the beginning `cd`. – Tsyvarev Sep 11 '19 at 11:37
  • 1
    I doubt BCB6 is compatible with MSVC++ projects ... never saw using cmake with it either ... My bet is You need to create new project and add your files into it ... converting MSVC++ related stuff to be compatible with BCB compiler (you know includes, paths, etc...) that is a lot of work with questionable results ... – Spektre Sep 11 '19 at 11:39
  • Yes, i used " cd C:\Program Files\CMake\bin\cmake.exe .. -G "C++ Builder 6" " as shown in the screenshot – inapathtolearn Sep 11 '19 at 11:39
  • @spektre you mean to create new project in BCB6 and add the files to it right. ? I am familiar with how to do it in Visual studio and Eclipse..is it the same in BCB6? – inapathtolearn Sep 11 '19 at 11:42
  • @mira more or less but beware its different to `#include <>` file and add it to project !!! if the project is console app it should be quite easy,... if it is GUI it would be hard to port it and most likely unstable or incompilable ... – Spektre Sep 11 '19 at 11:44
  • 1
    add to project is for VCL windows (`c/h/dfm`) and for `obj/dll/lib` files the `#include` is for actual source code and headers... MSVC++ and GCC does not use #include for all the files instead they are linked in project file that is not how BCB works – Spektre Sep 11 '19 at 11:45
  • 2
    You need to **execute** `cmake.exe`, not to change directory (`cd`) into it. Command `cd` is used only for moving into `build` directory before the call `cmake.exe`. Look into the tutorial - it doesn't specify `cd` command in this line. – Tsyvarev Sep 11 '19 at 11:49
  • @Tsyvarev thankyou so much for pointing out that mistake...can you tell me which Generator i shall use from the list (I am using C++ Builder 6), my closest guess was Borland Makefiles, but I got an error "CMake Error at C:/Program Files/CMake/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE)". – inapathtolearn Sep 11 '19 at 12:10
  • Have you checked [this link](http://docwiki.embarcadero.com/RADStudio/Rio/en/Using_CMake_with_C%2B%2B_Builder)? It describeds using CMake with C++ Builder. The error "Could NOT find PythonInterp" just means that you need Python to be installed. – Tsyvarev Sep 11 '19 at 12:18
  • I have already installed Python 2.7 before executing these commands. And yeah, thanks for sharing the link. I have checked this link before already. It is for C++ Builder 10.3 version..i am using C++ Builder 6 – inapathtolearn Sep 11 '19 at 12:26
  • I added the python executable path to the file path and it worked. – inapathtolearn Sep 11 '19 at 12:33
  • Solution: Run the above commands with the lst command as : cmake C:\Program Files\CMake\bin\cmake.exe .. -G "Borland Makefiles". If an error for not finding Python executable comes up, edit the path in the CmakeCache.txt file in the build folder of open62541. Thankyou all for your replies – inapathtolearn Sep 11 '19 at 13:00
  • @mira If possible, please compose your steps for the solution into an answer post, and mark as accepted so future viewers will be able to find the solution. – Kevin Sep 11 '19 at 13:49
  • @mira BCB6 use **very different compiler** I do not think its compatible with cmake ... try lookng for something like `bcc32.exe` in BCB's `[bin]` folder that should be your target compiler exe ... However not sure if BCB6 has it exposed did not use it for a long time... if not you can download the Borland/Embarcadero **bcc32 5.5** for free from their site (without IDE is for free use) the nowadays borlands use CLANG compiler and that should be compatible with cmake ... but I am stuck with BDS2006 so I might be wrong about that as I do not use the new stuff yet – Spektre Sep 11 '19 at 14:36

1 Answers1

0

Not directly an answer, but this is a crosspost with https://github.com/open62541/open62541/issues/3094

Other readers may find answers there.

Stefan Profanter
  • 6,458
  • 6
  • 41
  • 73
  • yeah..it was me again who asked the question in this forum...But there was no answer regarding building open62541 with C++ Builder 6. The link they gave in the solution was for C++ Builder 10.3 – inapathtolearn Sep 11 '19 at 12:57
  • You should always mention in your post that there is another forum/platform where you posted your question already. Be fair to the people who are trying to help you. – Stefan Profanter Sep 11 '19 at 14:25
  • For your record, it was another question I asked there before finding the steps to build the files using C++ builder. – inapathtolearn Sep 11 '19 at 14:42