Azure / azure-sdk-for-c

This repository is for active development of the Azure SDK for Embedded C. For consumers of the SDK we recommend visiting our versioned developer docs at https://azure.github.io/azure-sdk-for-c.
MIT License
223 stars 118 forks source link

Unable to build az_iot_hub_client samples on windows #2741

Closed YrnehEpoc closed 6 months ago

YrnehEpoc commented 6 months ago

Describe the bug I am attempting to build and run the iot hub samples on windows. I'm following the instructions here, but I run into an issue on the final step, step 5 When I try to build and run the project by pressing F5, I get this issue: Screenshot 2024-02-12 134751

To Reproduce Follow these instructions on a windows machine

Expected behavior I'm unsure but I would expect the solution to build .exe files that I can then run to test the functionality of the sdk

Setup (please complete the following information):

Information Checklist Please make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

vaavva commented 6 months ago

@YrnehEpoc Hello! Have you selected the project as the startup project? That seems to be what usually causes this error message. https://learn.microsoft.com/en-us/answers/questions/63937/staticlib-lib-is-not-a-valid-win32-application-err

YrnehEpoc commented 6 months ago

Thank you @vaavva, Yes I've selected the project as the startup project (right click on az_iot_hub, click on select as startup project).

image

I've also followed the link and added the .lib file path and name as specified. Maybe I'm not understanding the azure-sdk-for-c instructions. If this is just building the static libraries, where are the executable's that need to be linked to them?

YrnehEpoc commented 6 months ago

Apologies, my issue actually stemmed from running running cmake iwth -DTRANPORT_PAHO=ON. I misspelled transport.