-
Notifications
You must be signed in to change notification settings - Fork 76
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
NuGet package does not work in most configurations #43
Comments
I have not used fsharp so I cannot help there. There are bindings for fsharp here although I think it would need to be updated. |
I quickly testing this in c# and I am getting the same issue. I started by creating a new C# console app and then added Raylib-cs to it. However in the code, it is not recognising raylib-cs
|
You should copy the bindings into your project directly instead of adding via the package. The package is unlisted and out of date. I had issues getting it to work. I may revisit it although I have been making breaking changes on the dev branch and it is not a priority at this time. |
Thanks. That makes sense. |
The point of having it be a package is to make it easy for people to install and use so I would want it to include the native libraries too although I am not sure how it should be done. The dev branch is nearly ready to merge into master so I will work on that and take another look at this after. |
Hey Chris, I know you will have 3.0 as a priority but have you a timeline planned for this fix? |
I am not sure. There are different ways I could package it and I have not found a clear guide for nuget packages that use native libraries. I have tried dotnet pack and that produces a package for Raylib-cs.dll but I am stuck on figuring out how to add the native libraries so they are included and also are copied to the output directory based on the platform being used. |
Update. Taking another look to see if there was something I missed. Looks like there is a open issue about using native libraries in nuget packages here. |
Good news! We have just released a NuGet package targeting netstd2.0 (which should support Framework 4.7.2) & Core 3.1 So far we have tested it with the examples and with Github Actions, but please feel free to open new issues if there are problems with the package. https://www.nuget.org/packages/Raylib-cs |
Seems like the current solution does not work for netfx under certain conditions. Refer to #3 of this NuGet issue and this comment Current options seem to be:
|
@9ParsonsB I say we should look into the target files. I agree that renaming the folder to libs is hacky and sounds like it will cause more problems. The nuget package should be able to be built using dotnet pack with no other steps needed. If netfx can not work with that then we won't be able to support it. |
To make it clear on the runtimes we are currently supporting. The libraries we include for these runtimes are taken from the official raylib release:
It is possible that linux-x86 and win-x86 support is dropped in the future as I do not use them myself and there is a extra cost in having to support/test them. Currently they are the least tested part because of this. |
After some more investigations, I have another approach for packaging native libraries after reviewing this: NuGet/Home#8623 (now using I will push a new package version now (v3.1.3) and hope someone can test it for me. (join us on discord!) |
@Shadowblitz16 The latest nuget package currently includes the x64 and x86 libraries. Check that you are using the latest nuget release. You should not need to download the latest raylib library yourself to use the nuget package. |
I get the incorrect format when trying to run I was running from fork before but have just started to use the nuget. |
@chrisdill it doesn't work |
Set to x64. Please set x86 and report that doesn't work. |
@Shadowblitz16 Are you targeting .Net Framework or .Net Core? .Net Framework doesn't handle cross-platform native libraries that well - in this case you will need to copy the native raylib dll into your output directory. In any case, you will probably have better luck by only building x64. I know AnyCPU is broken. not sure about x86. I am currently testing a fix for this (see pre-release NuGet packages). |
I am trying to use Raylib-cs with fsharp on dotnet 3.1.
I am able to install the lib on a console app using
dotnet add Raylib-cs
But now in my code doing
open Raylib
gives me the error
The namespace or module 'Raylib' is not defined.
The text was updated successfully, but these errors were encountered: