none
Windows::Devices::Gpio doesn't exist? RRS feed

  • Question

  • C++

    using namespace Windows::Devices::Gpio;

    error C2039: 'Gpio': is not a member of 'Windows::Devices'

    error C2871: 'Gpio': a namespace with this name does not exist

    do I need to do something special to get this or something?

    Tuesday, August 18, 2015 11:12 AM

Answers

  • I'm confused, it doesn't look at all like the one I downloaded :-(

    Sorry

    by pure accident I've found "Add -> Reference" in project context menu (when you right click in Solution Explorer on your project, there's "Add" item and "Reference" subitem)
    • Marked as answer by RealSEnergy Wednesday, August 19, 2015 4:49 AM
    Wednesday, August 19, 2015 4:49 AM

All replies

  • Hi Daigono Youso,

    Would invoking WinRuntime Library API from C++ work for your project?

    https://ms-iot.github.io/content/en-US/win10/samples/GpioTestTool.htm

    Regards,
    Chun Siong

    Tuesday, August 18, 2015 2:08 PM
  • Hi Daigono Youso,

    Would invoking WinRuntime Library API from C++ work for your project?

    https://ms-iot.github.io/content/en-US/win10/samples/GpioTestTool.htm

    Regards,
    Chun Siong

    Hello,

    I don't quite understand what you mean by that, as I'm completely new to WinRT and I've been just using C++ and WinAPI for the last few years

    I also sadly have no idea what "invoking" a library means at all :X

    Shouldn't the namespace work just like any other namespace that is currently present and fully working, like for example Windows::UI ?


    • Edited by RealSEnergy Tuesday, August 18, 2015 7:19 PM
    Tuesday, August 18, 2015 7:18 PM
  • You need to:

    1. Make sure that you have set up a Universal Windows App (not a console etc)

    2. Add Reference (in Project menu) to Windows IoT Extensions

    3. In your code mode add a reference tot he library. e.g. Windows.Devices.Gpio

    Wednesday, August 19, 2015 12:24 AM
  • You need to:

    1. Make sure that you have set up a Universal Windows App (not a console etc)

    2. Add Reference (in Project menu) to Windows IoT Extensions

    3. In your code mode add a reference tot he library. e.g. Windows.Devices.Gpio

    1. I do have UWP

    2. where do I do that?

    3. the reason for this thread is that my VS can't find "Windows::Devices::Gpio"


    • Edited by RealSEnergy Wednesday, August 19, 2015 12:29 AM
    Wednesday, August 19, 2015 12:29 AM
  • You need to:

    1. Make sure that you have set up a Universal Windows App (not a console etc)

    2. Add Reference (in Project menu) to Windows IoT Extensions

    3. In your code mode add a reference tot he library. e.g. Windows.Devices.Gpio

    1. I do have UWP

    2. where do I do that?

    3. the reason for this thread is that my VS can't find "Windows::Devices::Gpio"


    In my answer I stated: 2. Add Reference (in Project menu) to Windows IoT Extensions So at top of your VS window, find the Project menu, scan down to Add Reference and then add what I said in Universal Windows/Extensions

    Once you added a Reference to the library containing WinIoT specific code, then you will be able to add the Gpio using Windows::Devices::Gpio . Without doing #2, VS won't know about those devices.

    • Proposed as answer by gerrit_v Wednesday, August 19, 2015 1:25 AM
    • Unproposed as answer by RealSEnergy Wednesday, August 19, 2015 2:37 AM
    Wednesday, August 19, 2015 1:24 AM
  • You need to:

    1. Make sure that you have set up a Universal Windows App (not a console etc)

    2. Add Reference (in Project menu) to Windows IoT Extensions

    3. In your code mode add a reference tot he library. e.g. Windows.Devices.Gpio

    1. I do have UWP

    2. where do I do that?

    3. the reason for this thread is that my VS can't find "Windows::Devices::Gpio"


    In my answer I stated: 2. Add Reference (in Project menu) to Windows IoT Extensions So at top of your VS window, find the Project menu, scan down to Add Reference and then add what I said in Universal Windows/Extensions

    Once you added a Reference to the library containing WinIoT specific code, then you will be able to add the Gpio using Windows::Devices::Gpio . Without doing #2, VS won't know about those devices.

    I asked since there's no "Add Reference" option

    Wednesday, August 19, 2015 1:52 AM
  • That doesn't look like Visual Studio 2015, what is it?
    Wednesday, August 19, 2015 2:04 AM
  • That doesn't look like Visual Studio 2015, what is it?
    Visual Studio 2015... downloaded directly from the Windows IoT Setup guide
    • Edited by RealSEnergy Wednesday, August 19, 2015 2:09 AM
    Wednesday, August 19, 2015 2:05 AM
  • I'm confused, it doesn't look at all like the one I downloaded :-(

    Sorry

    Wednesday, August 19, 2015 2:24 AM
  • I'm confused, it doesn't look at all like the one I downloaded :-(

    Sorry

    by pure accident I've found "Add -> Reference" in project context menu (when you right click in Solution Explorer on your project, there's "Add" item and "Reference" subitem)
    • Marked as answer by RealSEnergy Wednesday, August 19, 2015 4:49 AM
    Wednesday, August 19, 2015 4:49 AM
  • I"m a bit late just joining this thread. My problem is however related.

    Windows::Devices::Gpio is available when you have a Windows Universal App project bot not when you want to create a class library, static or DLL.

    Looking at the references added by default you see that an App lists Windows.Foundation namespaces but Library projects do not. If the IOT extension inherits from Windows.Foundation it would explain the difficulty.

    So, to recap

    How to develop a C++ UWP class library the uses GPIO?

    (This comes from the need to recycle Arduino code in the Win IOT environment) 

    Monday, January 4, 2016 10:35 AM
  • Reading the manuals and documentation on the IOT sites would have provided you with that information. (long version)

    riclh

    Monday, January 4, 2016 12:09 PM