# Unity Implementation: error CS0246

**URL:** https://discourse.kitware.com/t/unity-implementation-error-cs0246/274
**Category:** Pulse Physiology Engine
**Created:** [June 18, 2019, 8:55pm UTC](https://discourse.kitware.com/t/unity-implementation-error-cs0246/274 "2019-06-18T20:55:15Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![pfgerard](https://discourse.kitware.com/user_avatar/discourse.kitware.com/pfgerard/32/116_2.png) [@pfgerard](https://discourse.kitware.com/u/pfgerard)
#### Post date: [June 18, 2019, 8:55pm UTC](https://discourse.kitware.com/t/unity-implementation-error-cs0246/274/1 "2019-06-18T20:55:15Z")

</div>

This thread starts when I tried to set up Pulse on Unity (2018.3.14f1) to build a PC version that I can use with the HTC Vive. Got this message: “PulseUnityAsset | error CS0246: The type or namespace name `PulseEngine’ could not be found. Are you missing an assembly reference?”

Full log: [Editor.log](https://gitlab.kitware.com/physiology/PulseUnityAsset/uploads/4dad528364f1999f60b42c2df0dc828c/Editor.log)

---

<div class="post-metadata">

### Author: ![Ben\_Engel](https://discourse.kitware.com/user_avatar/discourse.kitware.com/ben_engel/32/111_2.png) [@Ben\_Engel](https://discourse.kitware.com/u/Ben_Engel)
#### Post date: [June 18, 2019, 11:25pm UTC](https://discourse.kitware.com/t/unity-implementation-error-cs0246/274/2 "2019-06-18T23:25:54Z")

</div>

I just made a new project with the steamVR asset and PulsePhysiologyEngine and I am having no issue on unity version 2019.1.2f1 I made a merged scene with the steamvr interactions\_Example and the VitalsMonitor scene.

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [June 19, 2019, 11:35am UTC](https://discourse.kitware.com/t/unity-implementation-error-cs0246/274/3 "2019-06-19T11:35:21Z")

</div>

What is your build target?

---

<div class="post-metadata">

### Author: ![pfgerard](https://discourse.kitware.com/user_avatar/discourse.kitware.com/pfgerard/32/116_2.png) [@pfgerard](https://discourse.kitware.com/u/pfgerard)
#### Post date: [June 20, 2019, 2:00pm UTC](https://discourse.kitware.com/t/unity-implementation-error-cs0246/274/4 "2019-06-20T14:00:07Z")

</div>

Also, did you have the Pulse Physiology Engine installed on the computer prior to import the unity package? 'cause in my case, I didn’t install the engine. I only tried to import Pulse package from assets store.

---

<div class="post-metadata">

### Author: ![pfgerard](https://discourse.kitware.com/user_avatar/discourse.kitware.com/pfgerard/32/116_2.png) [@pfgerard](https://discourse.kitware.com/u/pfgerard)
#### Post date: [June 20, 2019, 2:03pm UTC](https://discourse.kitware.com/t/unity-implementation-error-cs0246/274/5 "2019-06-20T14:03:46Z")

</div>

Build target is PC, HTC Vive for now.

---

<div class="post-metadata">

### Author: ![Ben\_Engel](https://discourse.kitware.com/user_avatar/discourse.kitware.com/ben_engel/32/111_2.png) [@Ben\_Engel](https://discourse.kitware.com/u/Ben_Engel)
#### Post date: [June 25, 2019, 4:47pm UTC](https://discourse.kitware.com/t/unity-implementation-error-cs0246/274/6 "2019-06-25T16:47:14Z")

</div>

I did not have anything installed before putting the unity package in.

Will you try making a new unity project with nothing in it and importing this package.

> **[pulse vive.unitypackage](https://drive.google.com/file/d/1POJ7x4c6A1t44xMgME6ESlz6Fv0n4_MU/view?usp=sharing)**
>
> Google Drive file.

  
Then open the vive+pulse scene in the root of the project and let me know what happens. If you can see anything in the headset, if you can see any of the data on the monitors, anything you see.

---

<div class="post-metadata">

### Author: ![Antoine\_Ribordy](https://discourse.kitware.com/user_avatar/discourse.kitware.com/antoine_ribordy/32/123_2.png) [@Antoine\_Ribordy](https://discourse.kitware.com/u/Antoine_Ribordy)
#### Post date: [June 27, 2019, 6:43pm UTC](https://discourse.kitware.com/t/unity-implementation-error-cs0246/274/7 "2019-06-27T18:43:03Z")

</div>

Hi,

I’m working with pfgerard and we’re trying to get the pulse engine to work in Unity.

The problem comes at compilation time of the Pulse-Superbuild.sln.

I’m getting lots of errors, that point to missing libraries (Qt, BLAS, CUDA, etc.). My understanding is that you don’t need to install anything apart from CMake and Java, is that right? I followed the instructions here:

[https://gitlab.kitware.com/physiology/engine#build-environment](https://gitlab.kitware.com/physiology/engine#build-environment)

I assumed that the missing libraries are fetched and downloaded, but is that not the case?  
Do I need to install Qt and others?

Thanks for your help,  
Antoine

Here’s an extract of these errors:

> – Found unsuitable Qt version “” from NOTFOUND  
> – Looking for pthread.h  
> 3\>-- Looking for pthread.h - not found  
> 3\>-- Found Threads: TRUE  
> 3\>-- Looking for MKL BLAS: not found  
> 3\>-- Looking for Goto BLAS: not found  
> 3\>-- Looking for Open BLAS: not found  
> 3\>-- Looking for Eigen BLAS: not found  
> 3\>-- Looking for Eigen BLAS: not found  
> 3\>-- Looking for Atlas BLAS: not found  
> 3\>-- Looking for PhiPACK BLAS: not found  
> 3\>-- Looking for CXML BLAS: not found  
> 3\>-- Looking for DXML BLAS: not found  
> 3\>-- Looking for SunPerf BLAS: not found  
> 3\>-- Looking for SCSL BLAS: not found  
> 3\>-- Looking for SGIMATH BLAS: not found  
> 3\>-- Looking for IBM ESSL BLAS: not found  
> 3\>-- Looking for IBM ESSL MT BLAS: not found  
> 3\>-- Looking for ACML BLAS: not found  
> 3\>-- Looking for ACML BLAS: not found  
> 3\>-- Looking for ACML BLAS: not found  
> 3\>-- Looking for Apple BLAS: not found  
> 3\>-- Looking for NAS BLAS: not found  
> 3\>-- Looking for Generic BLAS: not found  
> 3\>-- Looking for Generic BLAS: not found  
> 3\>-- Looking for Generic BLAS: not found–  
> A library with BLAS API not found. Please specify library location.  
> 3\> BLA\_VENDOR has been set to All but blas libraries could not be found or  
> 3\> check of symbols failed.  
> 3\>  
> 3\> Please indicate where to find blas libraries. You have three options:  
> 3\>  
> 3\> - Option 1: Provide the installation directory of BLAS library with cmake  
> 3\> option: -DBLAS\_DIR=your/path/to/blas  
> 3\>  
> 3\> - Option 2: Provide the directory where to find BLAS libraries with cmake  
> 3\> option: -DBLAS\_LIBDIR=your/path/to/blas/libs  
> 3\>  
> 3\> - Option 3: Update your environment variable (Linux: LD\_LIBRARY\_PATH,  
> 3\> Windows: LIB, Mac: DYLD\_LIBRARY\_PATH)  
> 3\>  
> 3\>  
> 3\>  
> 3\> To follow libraries detection more precisely you can activate a verbose  
> 3\> mode with -DBLAS\_VERBOSE=ON at cmake configure.  
> 3\>  
> 3\> You could also specify a BLAS vendor to look for by setting  
> 3\> -DBLA\_VENDOR=blas\_vendor\_name.  
> 3\>-- Looking for Generic BLAS: not found  
> 3\>-- Looking for Generic BLAS: not found  
> – LAPACK requires BLAS.  
> 3\>-- Could NOT find CHOLMOD (missing: CHOLMOD\_INCLUDES CHOLMOD\_LIBRARIES)  
> 3\>-- Could NOT find UMFPACK (missing: UMFPACK\_INCLUDES UMFPACK\_LIBRARIES)  
> 3\>-- Could NOT find SUPERLU (missing: SUPERLU\_INCLUDES SUPERLU\_LIBRARIES SUPERLU\_VERSION\_OK)  
> 3\>-- Could NOT find PkgConfig (missing: PKG\_CONFIG\_EXECUTABLE)  
> 3\>-- Could NOT find BLAS (missing: BLAS\_SEQ\_LIBRARIES BLAS\_LIBRARY\_DIRS)  
> 3\>-- Performing Test SCOTCH\_Num\_4  
> 3\>-- Performing Test SCOTCH\_Num\_4 - Failed  
> 3\>-- Performing Test SCOTCH\_Num\_8  
> 3\>-- Performing Test SCOTCH\_Num\_8 - Failed  
> 3\>-- Could NOT find MPI\_C (missing: MPI\_C\_LIB\_NAMES MPI\_C\_HEADER\_DIR MPI\_C\_WORKS)  
> 3\>-- Could NOT find MPI\_CXX (missing: MPI\_CXX\_LIB\_NAMES MPI\_CXX\_HEADER\_DIR MPI\_CXX\_WORKS)  
> 3\>-- Could NOT find MPI (missing: MPI\_C\_FOUND MPI\_CXX\_FOUND)  
> 3\>-- Performing Test PTSCOTCH\_Num\_4  
> 3\>-- Performing Test PTSCOTCH\_Num\_4 - Failed  
> 3\>-- Performing Test PTSCOTCH\_Num\_8  
> 3\>-- Performing Test PTSCOTCH\_Num\_8 - Failed  
> 3\>-- A version of Pastix has been found but pastix\_nompi.h does not exist in the include directory. Because Eigen tests require a version without MPI, we disable the Pastix backend.  
> 3\>-- Could NOT find SPQR (missing: SPQR\_INCLUDES SPQR\_LIBRARIES)  
> 3\>-- Found unsuitable Qt version “” from NOTFOUND  
> 3\>-- Performing Test COMPILER\_SUPPORT\_FASTMATH  
> 3\>-- Performing Test COMPILER\_SUPPORT\_FASTMATH - Failed  
> 3\>-- Performing Test COMPILER\_SUPPORT\_FPFAST  
> 3\>-- Performing Test COMPILER\_SUPPORT\_FPFAST - Success  
> 3\>-- Could NOT find Boost  
> 3\>-- Could NOT find GOOGLEHASH (missing: GOOGLEHASH\_INCLUDES GOOGLEHASH\_COMPILE)  
> 3\>-- Could NOT find ADOLC (missing: ADOLC\_INCLUDES ADOLC\_LIBRARIES)  
> 3\>-- Could NOT find MPFR (missing: MPFR\_INCLUDES MPFR\_LIBRARIES MPFR\_VERSION\_OK) (Required is at least version “2.3.0”)  
> 3\>-- Could NOT find GMP (missing: GMP\_INCLUDES GMP\_LIBRARIES)  
> 3\>-- Could NOT find PkgConfig (missing: PKG\_CONFIG\_EXECUTABLE)  
> 3\>-- Could NOT find FFTW (missing: FFTW\_INCLUDES FFTW\_LIBRARIES)  
> 3\>-- Found OpenGL: opengl32  
> 3\>-- Could NOT find GLUT (missing: GLUT\_glut\_LIBRARY GLUT\_INCLUDE\_DIR)  
> 3\>CMake Warning (dev) at unsupported/test/CMakeLists.txt:126 (if):  
> 3\> Policy CMP0054 is not set: Only interpret if() arguments as variables or  
> 3\> keywords when unquoted. Run “cmake --help-policy CMP0054” for policy  
> 3\> details. Use the cmake\_policy command to set the policy and suppress this  
> 3\> warning.  
> 3\>CUDA\_TOOLKIT\_ROOT\_DIR not found or specified  
> 3\>-- Could NOT find CUDA (missing: CUDA\_TOOLKIT\_ROOT\_DIR CUDA\_NVCC\_EXECUTABLE CUDA\_INCLUDE\_DIRS CUDA\_CUDART\_LIBRARY) (Required is at least version “7.0”)  
> 3\>-- Found unsuitable Qt version “” from NOTFOUND  
> 3\>-- Qt4 not found, so disabling the mandelbrot and opengl demos  
> 6\>CMake Error at Pulse.cmake:58 (find\_package):  
> 6\> By not providing “FindDirent.cmake” in CMAKE\_MODULE\_PATH this project has  
> 6\> asked CMake to find a package configuration file provided by “Dirent”, but  
> 6\> CMake did not find one.  
> 6\>  
> 6\> Could not find a package configuration file provided by “Dirent” with any  
> 6\> of the following names:  
> 6\>  
> 6\> DirentConfig.cmake  
> 6\> dirent-config.cmake  
> 6\>  
> 6\> Add the installation prefix of “Dirent” to CMAKE\_PREFIX\_PATH or set  
> 6\> “Dirent\_DIR” to a directory containing one of the above files. If “Dirent”  
> 6\> provides a separate development package or SDK, be sure it has been  
> 6\> installed.  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: The command “setlocal  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: cd C:\Users\antoi\physiology\builds\install\bin  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: C:  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: “C:\Program Files\CMake\bin\cmake.exe” -DTYPE:STRING=genData -P run.cmake  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmEnd  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmErrorLevel  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: exit /b %1  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmDone  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: setlocal  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: cd C:\Users\antoi\physiology\builds\install\bin  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: C:  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: “C:\Program Files\CMake\bin\cmake.exe” -DTYPE:STRING=genStates -P run.cmake  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmEnd  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmErrorLevel  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: exit /b %1  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmDone  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd  
> 7\>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(138,5): error MSB3073: :VCEnd” exited with code 1.  
> 7\>Done building project “PulseData.vcxproj” – FAILED.

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [June 27, 2019, 7:13pm UTC](https://discourse.kitware.com/t/unity-implementation-error-cs0246/274/8 "2019-06-27T19:13:16Z")

</div>

Hi Antoine

You can just pull the PulseUnity assest from the Unity store, you will not need to build Pulse, it’s all prebuilt and ready to go in the asset.

But if you really want to build the Pulse Asset from scratch, you can…

First thing you need to do is build Pulse, which is what you are doing  
It is going to first pull Eigen and get it ready for use by the Pulse build.  
That is Eigen configuring itself  
Eigen can work with anything and attempts to find everything when its included in a CMake process  
Its ok to have nothing it works with, but it will log everything it looks for and cannot find.

The error is in missing the Dirent package, which should have been pulled by the super build, but seems like it is not.

Can you take a look at this and see if it helps?  
[https://gitlab.kitware.com/physiology/engine/wikis/Using%20MSVC](https://gitlab.kitware.com/physiology/engine/wikis/Using%20MSVC)

And just in case,  
What MSVC version are you using and what version of CMake do you have?

---

<div class="post-metadata">

### Author: ![Antoine\_Ribordy](https://discourse.kitware.com/user_avatar/discourse.kitware.com/antoine_ribordy/32/123_2.png) [@Antoine\_Ribordy](https://discourse.kitware.com/u/Antoine_Ribordy)
#### Post date: [June 27, 2019, 8:29pm UTC](https://discourse.kitware.com/t/unity-implementation-error-cs0246/274/9 "2019-06-27T20:29:39Z")

</div>

Hi Aaron,

Thanks a lot for your quick reply, much appreciated!

That’s odd, the reason I tried to build Pulse is that they were missing libraries in the asset (Error CS0246 that pfgerard was referring to). So I figured out I needed to build the Pulse engine to generate these missing libraries.

I don’t particularly want to rebuild the Pulse engine, so am very happy with prebuilt libraries. Now, based on your reply, I can see that there are .dll files in the Plugins folder. So it might be a setup issue. Is it supposed to work out of the box or do I need to setup some specific path for Unity to compile properly?

Thank you,  
Antoine

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [June 27, 2019, 9:25pm UTC](https://discourse.kitware.com/t/unity-implementation-error-cs0246/274/10 "2019-06-27T21:25:28Z")

</div>

The Pulse Asset has a PulseUnityAssetUserManual.pdf as part of the download that will help you get things setup. The only thing you should have to do is copy some required files from the StreamingAssets folder (look for details in that pdf), but not having done that would not give you a dll load error. For some reason, maybe the Pulse Asset is not under your projects Assets folder?

Out of the box, adding in the Pulse Asset (from the unity store inside of Unity) to your game/project should put a Pulse asset folder under your assets folder. Unity should look in all Plugin folders under your project for all dlls and load the .NET dlls. So it should automatically find our .NET dlls.

---

<div class="post-metadata">

### Author: ![Antoine\_Ribordy](https://discourse.kitware.com/user_avatar/discourse.kitware.com/antoine_ribordy/32/123_2.png) [@Antoine\_Ribordy](https://discourse.kitware.com/u/Antoine_Ribordy)
#### Post date: [July 8, 2019, 5:58pm UTC](https://discourse.kitware.com/t/unity-implementation-error-cs0246/274/11 "2019-07-08T17:58:43Z")

</div>

Hi Aaron,

Sorry for my delayed reply, I didn’t get the chance to try the Pulse Engine again until today. And now, it’s working perfectly out-of-the-box!

So I’m kind of puzzled since both pfgerard and I tried it separately and got the same error message. And now, it just went away. So there must have been some weird glitch in the import of the assets and deleting the assets and re-importing seems to have fixed it…

Anyway, it’s working fine now. So thanks a lot again for your help and kindly taking the time to provide us guidance. Much appreciated!

Kind regards,  
Antoine

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [July 8, 2019, 6:25pm UTC](https://discourse.kitware.com/t/unity-implementation-error-cs0246/274/12 "2019-07-08T18:25:30Z")

</div>

No problem!  
Glad its working, let us know how it goes and if you have any other issues!
