10 Replies Latest reply on Aug 10, 2016 1:12 PM by Intel Corporation

    Issue On Compiling Azure IoT SDK In Eclipse IDE

    cnvery

      Hi,

       

      I managed to compile my Azure IoT SDK C programming project files (Without I/O and I2C Configuration) within Intel Edison itself using cmake.

       

      Now, I wish to compile the Azure IoT SDK C programming project files in the Eclipse IDE.

       

      Reason for choosing Eclipse IDE is I/O and I2C C project files is compiled and runs sucessfully on Eclipse IDE. (I/O and I2C configuration requires MRAA library)

       

      Now, I have encountered compiling errors when trying to compile whole project files (Combined codes of Azure IoT SDK, I/O and I2C).

       

      The errors are as per below:

      It cannot reference to some functions of Azure library (I have copied all required C header files from Azure folder and inserted into Eclipse)

      1.JPG

      2.JPG

       

      May I know is there any solution for this?

       

      Thanks!

        • 1. Re: Issue On Compiling Azure IoT SDK In Eclipse IDE
          cnvery

          Below are the full list of header files I have included in Eclipse IDE:

           

          Current Directory - Precedent of Other Folders: azure_c_shared_utility, azure_uamqp_c and azure_umqtt_c

          agenttypesystem.c

          agenttypesystem.h

          codefirst.c

          codefirst.h

          commanddecoder.c

          commanddecoder.h

          datamarshaller.c

          datamarshaller.h

          datapublisher.c

          datapublisher.h

          dataserializer.c

          dataserializer.h

          iotdevice.c

          iotdevice.h

          iothub_client.c

          iothub_client.h

          iothub_client_II.c

          iothub_client_II.h

          iothub_client_private.h

          iothub_client_version.h

          iothub_message.c

          iothub_message.h

          iothub_transport_II.h

          iothubtransport.c

          iothubtransport.h

          iothubtransportamqp.c

          iothubtransportamqp.h

          iothubtransportamqp_websockets.c

          iothubtransportamqp_websockets.h

          iothubtransporthttp.c

          iothubtransporthttp.h

          iothubtransportmqtt.c

          iothubtransportmqtt.h

          jsondecoder.c

          jsondecoder.h

          jsonencoder.c

          jsonencoder.h

          multitree.c

          multitree.h

          schema.c

          schema.h

          schemalib.c

          schemalib.h

          schemaserializer.c

          schemaserializer.h

          serializer.h

          version.c

           

          azure_c_shared_utility Folder

          agenttime.h

          base64.c

          base64.h

          buffer.c

          buffer_.h

          condition.h

          constbuffer.c

          constbuffer.h

          constmap.c

          constmap.h

          crt_abstractions.c

          crt_abstractions.h

          doublylinkedlist.c

          doublylinkedlist.h

          gb_stdio.c

          gb_stdio.h

          gb_time.c

          gb_time.h

          gballoc.c

          gballoc.h

          hmac.c

          hmac.h

          hmacsha256.c

          hmacsha256.h

          httpapi.h

          httpapiex.c

          httpapiex.h

          httpapiexsas.c

          httpapiexsas.h

          httpheaders.c

          httpheaders.h

          iot_logging.h

          list.c

          list.h

          lock.h

          macro_utils.h

          map.c

          map.h

          platform.h

          refcount.h

          sastoken.c

          sastoken.h

          sha.h

          sha1.c

          sha224.c

          sha384-512.c

          sha-private.h

          socketio.h

          stdint_ce6.h

          string_tokenizer.c

          string_tokenizer.h

          strings.c

          strings.h

          threadapi.h

          tickcounter.h

          tlsio.h

          tlsio_openssl.c

          tlsio_openssl.h

          tlsio_schannel.c

          tlsio_schannel.h

          tlsio_wolfssl.c

          tlsio_wolfssl.h

          umock_c_prod.h

          uniqueid.h

          urlencode.c

          urlencode.h

          usha.c

          vector.c

          vector.h

          xio.c

          xio.h

          xlogging.h

           

          azure_uamqp_c Folder

          amqp_definitions.c

          amqp_definitions.h

          amqp_frame_codec.c

          amqp_frame_codec.h

          amqp_management.c

          amqp_management.h

          amqp_types.h

          amqpalloc.c

          amqpalloc.h

          amqpvalue.c

          amqpvalue.h

          amqpvalue_to_string.c

          amqpvalue_to_string.h

          cbs.c

          cbs.h

          connection.c

          connection.h

          consolelogger.c

          consolelogger.h

          frame_codec.c

          frame_codec.h

          header_detect_io.c

          header_detect_io.h

          link.c

          link.h

          logger.h

          message.c

          message.h

          message_receiver.c

          message_receiver.h

          message_sender.c

          message_sender.h

          messaging.c

          messaging.h

          sasl_anonymous.c

          sasl_anonymous.h

          sasl_frame_codec.c

          sasl_frame_codec.h

          sasl_mechanism.c

          sasl_mechanism.h

          sasl_mssbcbs.c

          sasl_mssbcbs.h

          sasl_plain.c

          sasl_plain.h

          saslclientio.c

          saslclientio.h

          session.c

          session.h

          socket_listener.h

          socket_listener_win32.c

          wsio.c

          wsio.h

           

          azure_umqtt_c Folder

          mqtt_client.c

          mqtt_client.h

          mqtt_codec.c

          mqtt_codec.h

          mqtt_message.c

          mqtt_message.h

          mqttconst.h

          • 2. Re: Issue On Compiling Azure IoT SDK In Eclipse IDE
            Intel Corporation
            This message was posted on behalf of Intel Corporation

            Hi,

            What image version are you using? What Eclipse IDE version are you using? Can you list all the steps you did to configure Azure in the Eclipse IDE, were you following any guide, if so, which one?

            I’d also suggest you to post your question in https://github.com/Azure/azure-iot-sdks so you can receive a response from Azure support.

            -Sergio
             

            • 3. Re: Issue On Compiling Azure IoT SDK In Eclipse IDE
              cnvery

              What image version are you using?

              weekly-159.devkit-2.0 (Get from cat /etc/version)

               

              159.devkit (Get from configure_edison --version)

               

              What Eclipse IDE version are you using?

              Intel IoT Development Kit  IDE (Eclipse)

              Version: Luna (4.4.2)

              Build id: M20150204-1700

               

               

              Can you list all the steps you did to configure Azure in the Eclipse IDE, were you following any guide, if so, which one?

              I did not found any online guides that teach compiling Azure in Eclipse IDE. Thus, I tried it out myself by coping Azure library files into Eclipse IDE.

               

              I have posted questions on both Microsoft Forum and Azure Github Forum.

               

              Here are the link for the posts:

              1) Microsoft Forum

              Intel Edison - Issue On Compiling Azure IoT SDK In Eclipse IDE

              2) Azure Github Forum

              Intel Edison - Issue On Compiling Azure IoT SDK In Eclipse IDE · Issue #698 · Azure/azure-iot-sdks · GitHub

              • 4. Re: Issue On Compiling Azure IoT SDK In Eclipse IDE
                Intel Corporation
                This message was posted on behalf of Intel Corporation

                Thank you for posting in the Azure Forum. Keep us updated on your progress. They’ll be able to provide a more accurate response for anything related to Azure.

                -Sergio
                 

                • 5. Re: Issue On Compiling Azure IoT SDK In Eclipse IDE
                  cnvery

                  Hi Sergio,

                   

                  So far the issue is not solved.

                   

                  Do you have any idea on cross compiling MRAA stastically in Ubuntu OS and link against itself in same project folder?

                   

                  I tried myself by putting all required mraa C code and header files in same project folder, but it failed.

                   

                  It shows errors as per below:

                  123213.JPG

                   

                  Now, Microsoft Azure IoT code in Ubuntu OS works and MRAA code in Eclipse IDE works.

                   

                  But not for combined code complied in Ubuntu OS or Eclipse IDE.

                   

                  Currently there is no alternative/methods that can combine both codes and compile code successfully in Ubuntu OS/Eclipse IDE.

                   

                  Due to this, I cant proceed further for my project.

                   

                  Can your side suggest a method to solve this since this is code compiling issue?

                   

                  Thanks in advance.

                  • 6. Re: Issue On Compiling Azure IoT SDK In Eclipse IDE
                    Intel Corporation
                    This message was posted on behalf of Intel Corporation

                    We’ll investigate on your case. We’ll post a reply soon.

                    -Sergio
                     

                    • 7. Re: Issue On Compiling Azure IoT SDK In Eclipse IDE
                      Intel Corporation
                      This message was posted on behalf of Intel Corporation

                      Could you please share your code so we can attempt to see why it’s not compiling?  The issue could be related to the linker flags or the include paths in the Eclipse IDE when combining both libraries. We’re doing our best to help in any way we can, but since there’s no issue with MRAA, we cannot guarantee a solution to your problem.

                      -Sergio

                       

                      • 8. Re: Issue On Compiling Azure IoT SDK In Eclipse IDE
                        cnvery

                        Hi Sergio,

                         

                        I attached whole Eclipse project file to this link:

                        http://www.filedropper.com/azureedison

                         

                        If Eclipse IDE can successfully build Azure sample project simplesample_amqp.c without any errors, then this issue topic can be closed.

                        Thanks!

                        • 9. Re: Issue On Compiling Azure IoT SDK In Eclipse IDE
                          Intel Corporation
                          This message was posted on behalf of Intel Corporation

                          Hi cnvery,

                          Just by trying to compile your code I noticed the Eclipse was not able to find some of the header files. Although most of them are included in his project, some other header files require other files that are not included or the defined location is not correct. For example the header file umock_c_prod.h includes umock_c.h which is not included in the directory list that you provided. The Eclipse IDE lists the problems with a detailed description, the error name, the project, the path of the issue and the location, this is helpful to start eliminating encountered problems.
                          Take a look at this thread to get an idea on how to add this libraries into Eclipse IDE and add the necessary linker flags: https://communities.intel.com/thread/94227

                          -Sergio
                           

                          • 10. Re: Issue On Compiling Azure IoT SDK In Eclipse IDE
                            Intel Corporation
                            This message was posted on behalf of Intel Corporation

                            Do you still need help with this thread, what were the results of following the steps of the thread we provided?

                            -Sergio