open62541 / open62541

Open source implementation of OPC UA (OPC Unified Architecture) aka IEC 62541 licensed under Mozilla Public License v2.0
http://open62541.org
Mozilla Public License 2.0
2.57k stars 1.24k forks source link

open62541.h file missing after build in Windows 10 #3099

Open mc-gearup opened 5 years ago

mc-gearup commented 5 years ago

Hi, I am trying to Build a Simple server using open62541 as described in this link : https://open62541.org/doc/current/tutorial_server_firststeps.html.

I am using Borland C++ Builder 6 in Windows 10 (x64 processor) and the newest version of open62541. I cloned the repository to my PC and build it using CMake as described in this link : Building open62541.

but, I am not able to find the open62541.h file in any of the folder (which is metioned as a mandatory file in the link which shows the Simple server example). I did not get any error while building open 62541 using cmake (i tried both from command prompt and CMake GUI).

I am using:

Can someone please throw some light on how to proceed further?

Thankyou

mc-gearup commented 5 years ago

Capture

mc-gearup commented 5 years ago

Also, files such as transport_generator.h is also missing. I have tried it with the Embarcadero 10.3 as well. Still the same issue. What am I doing wrong here?

jpfr commented 5 years ago

The file open62541.h is not required is you use cmake. It is only required if you use the "single-file" build.

The file transport_generated.h is generated from XML sources during the build process. It will appear in the folder /src_generated/open62541. But only once you have started the build for the first time.

mc-gearup commented 5 years ago

@jpfr Thankyou so much for your reply. I am using the C++ Builder 6 and also checking with C++ Builder 10.3(embarcadero). I tried the example given in the link Server Implementation. But I am getting lot of errors which tracked back leads to the error of not able to find the files such as transport_generated.h.

I have build the files as mentioned above (in the screenshot) and using the generator "Borland Makefiles" since I am using C++ Builder. Should I be using some other generator ?

jpfr commented 5 years ago

Sorry, I only have experience on Windows with MinGW and Visual Studio. Do you find the files generated in /src_generated?

It is very common for CMake to have files generated only during the build. Can you ask Embarcadero directly?

mc-gearup commented 5 years ago

I tried to build it with Visual Studio 2017 and now the files are generated in src_generated folder. But i want to use it in Embarcadero :(...so I m copying those files to the embarcadero project and make it work. I don't know whether it will work or not :/.

StephanKa commented 5 years ago

What kind of errors do you got?

A second question why you will use Borland C++ Builder 6 or embarcadero? Can you use GCC / MingW or Clang on Windows?

mc-gearup commented 5 years ago

@crafti5 so far what i have done is, I cloned the open62541 and build it using CMAKE with C++ Builder (using the Borland Makefiles generator). But, even after a successful build, the 'src_generated' folder was not creating the files in it. So, I used MS Visual studio 2017 and build a project and this generated the .h files in 'src_generated' folder. I copied these files to my C++ Builder project , but I am getting errors in mainly 'log.h' and 'types.h' folder like:

[bcc32 error] log.h (101): E2140 Declaration not allowed here    Full parser context      myServer.c (13): #include C: \ Users \ Development \ open62541 \ include \ open62541 / plugin / log_stdout.h      log_stdout.h (10): #include C: \ Users \ Development \ open62541 \ include \ open62541 / plugin / log.h

jpfr commented 4 years ago

Do you compile as C or as C++? Maybe C-mode expects ANSI C89 and not C99. You should be able to compile the code as C++98 as well.