0

I know f# with opentk is very translatable from c#, however my problem is slightly less obvious because of the fact that f# isn't incredibly popular as it is.

From writing

open OpenTK

right of the bat I get

The namespace or module 'OpenTK' is not defined 

I also listed OpenTK in my references, so I'm not sure.

I did research, but as always there's going to be something that escaped my searches, so I thought that someone more knowledgeable in the first place might be of assistance.

If there's a better way or place to post this please let me know.

novasniff
  • 13
  • 2

2 Answers2

1

This is an error that you get when you're missing a reference to a library where OpenTK is defined. There are two ways of adding references, depending on whetehr you're in a project or in a script file.

Script file - if you're working in a .fsx file, you need to reference assemblies using the #r command. I wrote a demo that does exactly this and builds a little 3D DSL. The file starts with:

#r "references/OpenTK.dll"
open OpenTK

Project - if you're inside a project than adding reference in Visual Studio should do the trick. If something goes wrong, check out the build log - if you were referencing incompatible version of the dll (e.g. for another version of .NET), you'd see a detailed error there.

Tomas Petricek
  • 240,744
  • 19
  • 378
  • 553
  • I was in a f# console app project. And I added the reference, I don't know if I referenced the right folder exactly though. I think the "opentk is not defined" error was the only error, though I may be wrong. I'll check tomorrow, thank you – novasniff Mar 27 '15 at 00:55
0

If you are also having this issue go to

PROJECTS > Manage NuGet Packages > Online > search "OpenTK".
novasniff
  • 13
  • 2