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

Building with MinGW on windows #20

Open
celsium opened this issue Oct 13, 2017 · 5 comments
Open

Building with MinGW on windows #20

celsium opened this issue Oct 13, 2017 · 5 comments

Comments

@celsium
Copy link

celsium commented Oct 13, 2017

Hi guys!
Building with MinGW on windows will fail with error, because of this code in azure-uamqp-c\CMakeLists.txt:
IF(WIN32)
#windows needs this define
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
# Make warning as error
add_definitions(/WX)
ELSE()
# Make warning as error
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
ENDIF(WIN32)

And this code in azure-c-shared-utility\CMakeLists.txt:
IF(WIN32)
#windows needs this define
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
IF(WINCE)
# Don't treat warning as errors for WEC 2013. WEC 2013 uses older compiler version
add_definitions(/WX-)
ELSE()
# Make warning as error
add_definitions(/WX)
ENDIF()
ELSE()
# Make warning as error
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
ENDIF(WIN32)

In both cases you add "/WX" flag to gcc call which is not defined there. I guess there should be one more check for MinGW compiler.

@dcristoloveanu
Copy link
Member

Hi @celsium

Thanks for the report. I'll have a look at this and update the CMakelists as needed.

Cheers,
/Dan

@celsium
Copy link
Author

celsium commented Oct 17, 2017

Hi Dan, can you also take a look on this error. I created handle from 2 strings (eventHubPath is empty string):
eventHubClientHandle = EventHubClient_CreateFromConnectionString(connectionString.c_str(), eventHubPath.c_str());
No errors. But when I am trying to send, i have:
Error: Time:Tue Oct 17 16:46:59 2017 File:C:\Users\Anton\Downloads\bacnet-stack-master\ports\win32\VS2017\azure-event-hubs-c\eventhub_client\src\eventhubclient.c Func:_EventHubClient_Send Line:444 result = EVENTHUBCLIENT_ERROR
Application controller destructor.
Error: Time:Tue Oct 17 16:47:00 2017 File:C:\Users\Anton\Downloads\bacnet-stack-master\ports\win32\VS2017\azure-event-hubs-c\azure-uamqp-c\src\amqp_management.c Func:_amqp_management_close Line:885 AMQP management instance not open
Error: Time:Tue Oct 17 16:47:00 2017 File:C:\Users\Anton\Downloads\bacnet-stack-master\ports\win32\VS2017\azure-event-hubs-c\eventhub_client\src\eventhubauth.c Func:_OnCBSPutTokenOperationComplete Line:513 CBS reported status code 0, error: (null) for put token operation

Error: Time:Tue Oct 17 16:47:00 2017 File:C:\Users\Anton\Downloads\bacnet-stack-master\ports\win32\VS2017\azure-event-hubs-c\azure-uamqp-c\src\saslclientio.c Func:_saslclientio_send Line:1131 send called while not open
Error: Time:Tue Oct 17 16:47:00 2017 File:C:\Users\Anton\Downloads\bacnet-stack-master\ports\win32\VS2017\azure-event-hubs-c\azure-uamqp-c\src\saslclientio.c Func:_saslclientio_close Line:1081 saslclientio_close called while not open
Error. Failed to send event data.

What is the reason of this issue?

@dcristoloveanu
Copy link
Member

Hi @celsium,

Sorry for the delay.
I opened the PR to fix the mingw /Wx issue here: Azure/azure-c-shared-utility#122. This should get in very soon and then I'll update eventhubs-c to use the new build rules.

I'm looking now at your other question on why you would not be able to send.

Cheers,
/Dan

@dcristoloveanu
Copy link
Member

dcristoloveanu commented Oct 21, 2017

Hi @celsium

You need to have an eventhub name specified.
I quickly ran through the send sample myself now and seems to work as expected when an eventhubname is specified.

image

Is there any reason why you are not passing an eventhubname in the _Create?

Hope this helps,
/Dan

@celsium
Copy link
Author

celsium commented Oct 27, 2017 via email

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

2 participants