Unity Implementation: error CS0246

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

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.

What is your build target?

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.

Build target is PC, HTC Vive for now.

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.


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.

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

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.

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

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

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

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.

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

1 Like

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

Privacy Notice