Building PocketSphinx for PiHueSphinx for Windows - c#

I am trying to get this source building:
https://github.com/garuma/PiHueSphinx
I have pulled the master branch for the above repo and the PocketSphinx repo mentioned:
https://github.com/cmusphinx/pocketsphinx
I failed to get the pocketsphinx code to build on Windows 7 with Visual Studio 2015 with 68 build errors, starting with the following error:
cannot open source file "sphinxbase/err.h" pocketsphinx c:\git\pocketsphinx\src\libpocketsphinx\vector.c 76
So I decided to download the latest build of sphinxbase and pocketsphinx from:
https://cmusphinx.github.io/wiki/download/
After that, following the Building section in the PiHueSphinx README.md, I tried to get the PiHueSphinx solution to build (again, Win7 VS15). I restored the NuGet packages, updated the NuGet packages, rebuilt the PiHueSphinx project and then fixed the code on line 31 of HueController.cs:
Replace: var client = new LocalHueClient (ip);
With: var client = new LocalHueClient (ip.IpAddress);
I now get the following build error:
The command "gcc -Wall -ggdb -shared -I/usr/local/include -I/usr/local/include/sphinxbase -I/usr/local/include/pocketsphinx -L/usr/local/lib -lpocketsphinx -lsphinxad -lsphinxbase -o bin\Debug\libsphinx_hue_detection.so sphinx_hue_detection.c" exited with code 9009. PiHueSphinx C:\git\PiHueSphinx\PiHueSphinx\PiHueSphinx.csproj 97
I am not sure how to resolve this issue. I think I should be providing references to the Sphinx libraries from the PiHueSphinx.csproj file (as mentioned in the readme) but simply replacing the paths beginning /usr/local/ with paths to the downloaded and extracted sphinxbase and pocketsphinx folders results in the same message, but with the modified paths.
How can I get this solution to build?
(Perhaps a better question is: How can I get a C# console application to build using the Sphinx libraries, but I don't want to push my luck or get off topic.)

Found that the code on the github repos were not good for building, so downloaded the latest sphinxbase and pocketsphinx, decompressed and built the source from here:
https://cmusphinx.github.io/wiki/download/

Related

Nuget error when trying to publish in .Net5

When I publish in .Net5 I get the following Errors
Severity Code Description Project File Line Suppression State
Error Assets file 'C:\Users\cornelis.dejager\source\repos\Marel.MSAWebServiceAPI\Marel.MSAWebServiceAPI\obj\publish\win-x86\project.assets.json' not found. Run a NuGet package restore to generate this file. Marel.MSAWebServiceAPI 0
and
Severity Code Description Project File Line Suppression State
Error Failed to retrieve information about 'Microsoft.WindowsDesktop.App.Runtime.win-x86' from remote source 'https://api.nuget.org/v3-flatcontainer/microsoft.windowsdesktop.app.runtime.win-x86/index.json'.
An error occurred while sending the request.
The request was aborted: Could not create SSL/TLS secure channel. Marel.MSAWebServiceAPI 0
What caused it:
Not sure to be honest. After I changed code it stopped working. The project has been fine for weeks now and suddenly it changed.
I have tried
Cleaned solution
Build/Re-Build Solution
Restore The Nuget Packages
Update Visual Studio
Rebuild All projects
Delete Bin & Object folders
Update all packages
Restarting Visual Studio + Computer
Created new publishing profile
install dotnet-WindowsDesktop
Reinstall .Net5 Runtimes
Run the command:
Additional Info
It builds and run fine. Only when I publish it seems to give me an error.
I really do not why publishing isn't working. I've looked at several places but have not found a solution to it yet.
It may happen from the wrong package source,
In Visual Studio go to
Options=> Nuget Package Manager=> Package Sources
if you are using a custom source make sure you have entered the address correctly.
NuGet default source address is https://api.nuget.org/v3/index.json

Building cmake generated UWP windows desktop project results in error MC6000 (missing WindowsBase, ...)

I created a simple Windows UWP solution with windows visual studio 2019.
I did not make any changes to it but closed visual studio.
Then I wrote a simple cmake file for it.
However, it fails in "cmake --build" like this:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets(268,9):
error MC6000: Project file must include the .NET Framework assembly
'WindowsBase, PresentationCore, PresentationFramework' in the reference list.
[App1\out\App1.csproj]
When I add the requested .NET files with VS_DOTNET_REFERENCES property, there is a different error:
App1\MainPage.xaml(9,5): error MC3074: The tag 'ThemeResource' does not exist
in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'.
Line 9 Position 5. [App1\out\App1.csproj]
I also tried adding all and combinations of these calls to CMakeLists.txt but they did not have any effect:
set_property (SOURCE "App.xaml" PROPERTY VS_XAML_TYPE "ApplicationDefinition")
target_compile_options (App1 PRIVATE "/langversion:default")
set_property (TARGET App1 PROPERTY DOTNET_TARGET_FRAMEWORK_VERSION "v4.7.2")
set_property (TARGET App1 PROPERTY WIN32_EXECUTABLE TRUE)
I cannot overcome these problems.
I generate and compile the solution like this:
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 -S . -B out
cmake --build out
Cmake version is 3.14.19050301-MSVC_2.
The source files are here, including the original by visual studio created solution files and my written CMakeLIsts.txt file.
Expected result would be a cmake compiling solution which looks as much as possible like the native solution.
Probably there is just a simple error but I cannot find it.

C# ffmpeg unable to load dll avcodec

I downloaded project to controlling AR Drone from this site:
https://github.com/Ruslan-B/AR.Drone
This project is old. Then I downloaded ffmpeg.autogen library from this site
https://sourceforge.net/projects/ffmpeg-autogen/?source=typ_redirect
This is old version of ffmpeg because of old version AR.Drone. I has to be .NET Framework 4.0 version.
Project has compiled, but when I run application I got an error:
"Unable to load DLL 'avcodec': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"
The error occurs in this line:
FFmpegInvoke.avcodec_register_all();
I would advice to clone the project including submodules.
Here is the quote from README.md:
git clone http://github.com/Ruslan-B/AR.Drone.git
cd AR.Drone
git submodule update --init
It supposed download not only source code but compatible ffmpeg binaries as well.
As a next step you need to build AR.Drone solution with VS2012+ it going to build all dependencies for you and then you will be able to start AR.Drone.WinApp project. It will auto pickup the ffmpeg binaries by convention.

MSBuild fails for solution with project dependencies

The build for my solution, which contains multiple projects, suddenly appears to be broken and the cause of the issue isn't clear. All of the projects in the solution target the same framework (4.5.1), however, some of the projects' dependencies might be targeting an earlier version of the framework. As of last week, we were able to successfully build solutions that fall under this scenario. Starting last Thursday, the builds appear to be broken without any changes to the build server or the solution.
To illustrate and remove some of the complexities with our production setup, I created a sample solution which mimics the behavior.
Project structure:
CBI Solution
CBI website
CBI Implementation Library
CBI Core library, defining the interfaces
Target Framework Version for the website and class libraries is 4.5.1
Replication Steps
Solution 1
Github repo: https://github.com/NikitaGolovko/Solution1.git
Build, using MSBuild 14. My command is:
msbuild.exe "%SOLUTION1PATH%\CBILite.sln" /p:platform="Any CPU" /p:configuration="Release" /v:d
Output
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v /localhost_61806 -p cbi\ -u -f PrecompiledWeb\lo
calhost_61806\
Microsoft (R) ASP.NET Compilation Tool version 4.7.2046.0
Utility to precompile an ASP.NET application
Copyright (C) Microsoft Corporation. All rights reserved.
Done executing task "AspNetCompiler".
Task "Message" skipped, due to false condition; (!((false) or ('$(AspNetConfiguration)' == 'Debug') or ('$(AspNetConfig
uration)' == 'Release'))) was evaluated as (!((false) or ('Release' == 'Debug') or ('Release' == 'Release'))).
Done building target "Build" in project "cbi.metaproj".
Done Building Project "D:\Work\DotNet\Nikita\Solution1\cbi.metaproj" (default targets).
Done executing task "MSBuild".
Done building target "Build" in project "CBILite.sln".
Done Building Project "D:\Work\DotNet\Nikita\Solution1\CBILite.sln" (default targets).
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:03.10
Full output is located here: https://github.com/NikitaGolovko/Solution1/blob/master/MSBuild_Output.txt
Solution 2
Github Repo: https://github.com/NikitaGolovko/Solution2.git
The solution is nearly identical to the Solution1, with the only exception being a dependency for Unity in CBI Implementation library. To simplify the process and eliminate the nuget restore step, I have included nuget packages with the solution.
Build, using MSBuild 14. My command is:
msbuild.exe "%SOLUTION2PATH%\CBILite.sln" /p:platform="Any CPU" /p:configuration="Release" /v:d
Output
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v /localhost_61806 -p cbi\ -u -f PrecompiledWeb\lo
calhost_61806\
Microsoft (R) ASP.NET Compilation Tool version 4.7.2046.0
Utility to precompile an ASP.NET application
Copyright (C) Microsoft Corporation. All rights reserved.
D:\Work\DotNet\Nikita\Solution2\cbi\Index.aspx.vb(5): error BC30002: Type 'CBILite.Calculator' is not defined. [D:\Work
\DotNet\Nikita\Solution2\cbi.metaproj]
The command exited with code 1.
Done executing task "AspNetCompiler" -- FAILED.
Done building target "Build" in project "cbi.metaproj" -- FAILED.
Done Building Project "D:\Work\DotNet\Nikita\Solution2\cbi.metaproj" (default targets) -- FAILED.
Done executing task "MSBuild" -- FAILED.
Done building target "Build" in project "CBILite.sln" -- FAILED.
Done Building Project "D:\Work\DotNet\Nikita\Solution2\CBILite.sln" (default targets) -- FAILED.
Build FAILED.
Full output is located here: https://github.com/NikitaGolovko/Solution2/blob/master/MSBuild_Output.txt
Observations
Bin folder
When looking in the bin folder of the website, I notice that CBILite.dll is missing after the build for Solution2, but present in Solution1.
TargetFrameworkVersion
Passing TargetFrameworkVersion in the MSBuild arguments does not appear to influence the build. I have attempted to pass 4.5, 4.5.1 to no avail. HOWEVER passing 3.5 results in the successful build. This is extremely strange.
Metaproj
When comparing Metaproj files generated for both solutions, the only observable and seemingly important difference is the lack of the TargetFrameworkVersion element. Solution1 (without dependencies), contains v.4.0 element. Solution2 (with the dependency) does not.
I didn't include metaproj files in the repo but can share them if needed.
Visual Studio
Building the solution in Visual Studio works just fine.
Additional thoughts
The issue manifested itself rather suddenly and seems to be affecting most of our solutions that have mixed projects (C#/VB + website). Web Projects continue to function normally.
I've attempted to use MSBuild 15, but it resulted in the same behavior.
There are a few workarounds
Retaining the metaproj file with the solution and modifying it manually by adding v4.5.1 element.
Adding an additional build step to manually copy CBILib.dll into the website project (via the batch file or other means).
Adding a refresh file for the website pointing to CBILib/bin/Release folder
While all of these solutions might work, they're certainly hacks and will present problems in the future.
I'm hoping someone else has a better suggestion on how to handle this.
Make sure you have installed the following NuGet packages:
Microsoft.NET.Test.Sdk
MSTest.TestAdapter
MSTest.TestFramework
Microsoft.NETCore.App (if you use .NET Core)

MonoMac Build Error From Default Template

I am trying to use MonoDevelop 3.0.3.2 to create a MonoMac application. I created a new MonoMac solution and tried running the template created after creating the solution, but this is my build output:
Building Solution: MAC1 (Debug|x86)
Building: MAC1 (Debug|x86)
Performing main compilation...
/Library/Frameworks/Mono.framework/Versions/2.10.9/bin/dmcs /noconfig
"/out:/Users/zgillis/Projects/MAC1/bin/Debug/MAC1.exe"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Xml.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Core.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Xml.Linq.dll"
"/r:/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Drawing.dll"
"/r:/Applications/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/MonoMac.dll" /nologo /warn:4 /debug:full /optimize- /codepage:utf8 /platform:x86
"/define:DEBUG" /t:exe "/Users/zgillis/Projects/MAC1/MainWindow.cs"
"/Users/zgillis/Projects/MAC1/MainWindowController.cs"
"/Users/zgillis/Projects/MAC1/MainWindow.designer.cs"
"/Users/zgillis/Projects/MAC1/Main.cs" "/Users/zgillis/Projects/MAC1/AppDelegate.cs"
"/Users/zgillis/Projects/MAC1/AppDelegate.designer.cs"
Copying content files
Copying '/Users/zgillis/Projects/MAC1/bin/Debug/MAC1.exe' to
'/Users/zgillis/Projects/MAC1/bin/Debug/MAC1.app/Contents/MonoBundle/MAC1.exe'
Copying '/Users/zgillis/Projects/MAC1/bin/Debug/MAC1.exe.mdb' to
'/Users/zgillis/Projects/MAC1/bin/Debug/MAC1.app/Contents/MonoBundle/MAC1.exe.mdb'
Build complete -- 0 errors, 0 warnings
Updating application manifest
---------------------- Done ----------------------
Build successful.
Build failed. The given key was not present in the dictionary.
I am running Mac OS X Snow Leopard (10.6.8), and my Xcode version is 3.2.2.
It will not allow me to compile even the default MonoMac template, so I know I must have something configured incorrectly. I appreciate the help.
It looks like your version of Xcode is old - it's likely that MonoDevelop's support for reading values from the older Apple SDKs' plists has regressed. I would suggest you either upgrade Xcode, or file a bug with the MonoDevelop log file (found in ~/Library/Logs/MonoDevelop-3.0) attached.

Categories