-1

I am trying to setup the Logitech LED SDK in order to create a script that allows to change backlight of specific keys. However when I follow the instructions given in the documentation I get the following ERROR: error CS0103: The name 'LogitechGSDK' does not exist in the current contex I have created a short video that illustrates how I tried to set it up

If anyone knows what I'm doing wrong or can explain to me how I can setup SDK for a C# project it would be very much appreciated.

I have tried following the documentation given with the download I have linked to and looked for similar posts but I've only found one for Java

I am trying to run the following code which was given as an example in the documentation found here: logitechSDK

location: LED_SDK_9.00\LED\Samples\Logi_SetTargetZone_Sample_CS\Logi_SetTargetZone_Sample_CS

Noddy
  • 5
  • 4

1 Answers1

0

This error means that LogitechGSDK is not known in the context. You have probably not included correct references to the project or not included the LogitechGSDK.cs in your project.

If SDK contains some examples, start with them. Make sure that you can build and run simple example, then play with it and make your own.

EDIT:

You need to add namespace reference:

using LedCSharp;

add it on top of the Program.cs file.

The LogitechLedEnginesWrapper.dll (x86 or x64) should be coppied to the output directory (where the .exe file is created), not the project directory.

Check terminal commands:

 dotnet build 

and

 dotnet run

Good luck!

szamil
  • 684
  • 5
  • 17
  • thank you for the quick response, I thought I it would work as i believe i followed the instructions given in the documentation, did you see what went wrong in the video i have linked? – Noddy Jan 25 '23 at 23:03
  • the video is private. – szamil Jan 25 '23 at 23:06
  • oooh, sorry, then it is not very helpful.. what about now? – Noddy Jan 25 '23 at 23:30
  • check my edit above – szamil Jan 25 '23 at 23:56
  • oooh, nice thanks, that fixed the logitechgSDK related errors, but i still have the color errors – Noddy Jan 26 '23 at 00:15
  • You just need to define them and set to desired values. – szamil Jan 26 '23 at 06:21
  • thank you for your patience, so apparently my VSCode didnt show syntax errors after fixing that i realized a lot of things i've done wrong, but i have now tried to run an example as you suggested to get a better understanding. However the program does not seem to compile. This is the error message: https://i.imgur.com/pqPbrJj.png – Noddy Jan 27 '23 at 09:17
  • Please don't use media type other than text if you want to submit a text data. I have a feeling that you should go back to basics. You have a building script that wants to `xcopy` the `.dll` file to the output, but as you can read in the red message, it cannot find the src. Try to edit the build script or run `dotnet build` in terminal as I mentioned above. [Read about that as well](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-build). – szamil Jan 27 '23 at 09:42
  • this script was the one included in the documentation so i assumed it would work right off the bat. The _.exe_ file works but i cannot run the **program.cs** through vscode. I have edited the post to show which script it is – Noddy Jan 27 '23 at 10:35
  • Have you checked the build script? There must be a `xcopy` command with wrong arguments. – szamil Jan 27 '23 at 10:56
  • there is no xcopy command in the script as far as i can see. you can check out the project i've added to the post – Noddy Jan 27 '23 at 11:13
  • Yes, there is. Look in `csproj` file. You are working on the Visual Studio solution files using VS Code. It might work in general, but you must understand what is going on. If you are not familiar with VS Code, start with some tutorials first and simple project, so you understand the purpose of all files. If you prefer Visual Studio, use the SDK's example and `sln` file - it will work out of the box. VS Code requires much more setup. – szamil Jan 27 '23 at 11:22
  • I found the issue. it was because i used the wrong bit version dll, now it works. thanks for trying to help though – Noddy Jan 28 '23 at 01:25
  • You might mark the answer if it helped. – szamil Jan 28 '23 at 10:40