Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal error: umock_c/umock_c_prod.h: No such file or directory #1364

Closed
abhipony opened this issue Dec 9, 2019 · 10 comments
Closed

fatal error: umock_c/umock_c_prod.h: No such file or directory #1364

abhipony opened this issue Dec 9, 2019 · 10 comments
Assignees

Comments

@abhipony
Copy link

abhipony commented Dec 9, 2019

OS version :
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 7.6 (Maipo)
Release: 7.6
Codename: Maipo

SDK Release: latest

Description:
I built azure-iot-sdk-c inside a docker.
My Dockerfile :
FROM balenalib/beaglebone-black:buster
COPY azure-iot-sdk-c /usr/src/app/azure-iot-sdk-c
WORKDIR /usr/src/app/azure-iot-sdk-c/build_all/linux
RUN apt-get -q update && apt-get install -yq --no-install-recommends git sudo
RUN ./setup.sh
RUN ./build.sh --no-logging
WORKDIR /usr/src/app/

After everything is built, I started using it in my application called pusher. I get the below error with the latest version of this library.

[Build] main In file included from /usr/src/app/azure-iot-sdk-c/c-utility/inc/azure_c_shared_utility/platform.h:7:0,
[Build] main from src/pusher.cpp:8:
[Build] main /usr/src/app/azure-iot-sdk-c/c-utility/inc/azure_c_shared_utility/strings.h:7:34: fatal error: umock_c/umock_c_prod.h: No such file or directory
[Build] main #include "umock_c/umock_c_prod.h"
[Build] main ^
[Build] main compilation terminated.

The headers included my file are :
#include "azure_c_shared_utility/platform.h
#include "azure_c_shared_utility/threadapi.
#include "iothub_client.h"
#include "iothubtransportmqtt_websockets.h"

My makefile for the appplication:
AZURE_SDK_PATH:=$(CURDIR)/azure-iot-sdk-c
CXXFLAGS += -I$(AZURE_SDK_PATH)/iothub_client/inc -I$(AZURE_SDK_PATH)/c-utility/inc -I/usr/include/azureiot -I/usr/include/azureiot/inc -I$(AZURE_SDK_PATH)/deps/parson -I .

binary/pusher:
src/pusher.o
parson.o
$(CXX) -o $@ $^ -L$(AZURE_SDK_PATH)/cmake/iotsdk_linux/c-utility -L$(AZURE_SDK_PATH)/cmake/iotsdk_linux/umqtt -L$(AZURE_SDK_PATH)/cmake/iotsdk_linux/iothub_client $(LDLIBS) -lm -liothub_client_mqtt_ws_transport -lumqtt -l:libiothub_client.a -lpthread -laziotsharedutil -lssl -lcrypto -lcurl

parson.o: $(AZURE_SDK_PATH)/deps/parson/parson.c $(AZURE_SDK_PATH)/deps/parson/parson.h
gcc -c $(AZURE_SDK_PATH)/deps/parson/parson.c -o "parson.o"

I am currently working with an older version of this repo and I have to move to the latest version urgently. Please look into this issue and suggest a solution. Let me know if you have any doubts or queries.

@danewalton-msft
Copy link
Member

Hi @abhipony
If you are using the latest version of the sdk can you make sure to run

git submodule update --init --recursive

to make sure you have all the latest submodules.

After that, make sure to have in your include path -I$(AZURE_SDK_PATH)/deps/umock-c/inc. That should include the necessary files that the compiler is complaining about. Let me know if that helps at all!

@danewalton-msft danewalton-msft self-assigned this Dec 9, 2019
@scout208
Copy link
Contributor

I'm having this same issue only on Windows with the latest SDK release.

@danewalton-msft
Copy link
Member

@scout208 how are you building the code? Is it a hand rolled make, cmake, etc

@scout208
Copy link
Contributor

scout208 commented Dec 11, 2019

I'm using the Visual Studio integration with vcpkg and trying to build one of the samples (using Visual Studio)

@scout208
Copy link
Contributor

@danewalton I'm wondering is there a particular version of the azure-iot-sdk-c vcpkg that I need to have installed?

@danewalton-msft
Copy link
Member

are you using the latest version?

@scout208
Copy link
Contributor

@abhipony
Copy link
Author

@danewalton Hey, I was able to build it successfully using the latest version. I had to include -I$(AZURE_SDK_PATH)/deps/umock-c/inc and -I$(AZURE_SDK_PATH)/c-utility/deps/azure-macro-utils-c/inc to my path. Thanks for helping me out. :)

@danewalton-msft
Copy link
Member

@abhipony awesome good to hear!

@scout208 would you mind opening another issue with your problem so that we can track it separately? I'm going to go ahead and close this one.

@az-iot-builder-01
Copy link
Collaborator

@danewalton, @abhipony, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants