Pocketsphinx - Code::Blocks, windows crashing - codeblocks

I am trying to run this tutorial: http://cmusphinx.sourceforge.net/wiki/tutorialpocketsphinx.
I built both sphinxbase and pocketsphinx on VS 2013. I tried to compile my code on both VS and Code::Blocks. The executable made by VS runs as expected, but the one from Code::Blocks causes the cmd to crash when executing:
rv = ps_decode_raw(ps, fh, "goforward", -1);
Does anyone have any idea how to solve this?

Related

rust: link.exe not found

I installed the rust compiler and also MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.27) (as an individual component)
This does not seam to be working.
Does rust require anything more which I have not installed? Thank you in advance.
Install the Windows SDK too.
I also didn't want to install all of Visual Studio just to compile rust from the command line.
Based on the info in coder-256's link, I tried running C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat. Then, instead of being unable to find link.exe, I got the error:
note: LINK : fatal error LNK1181: cannot open input file 'advapi32.lib'
Searching Stack for that error led to this answer: Install the Windows SDK
So I installed the Windows 10 SDK, and now (after launching a new cmd window) it works.
Using Win11, here's the specific steps that worked for me (assumes VSCode and Rust are already installed):
Go to the Visual Studio Download site
Download Build Tools for Visual Studio 2019 (version 16.9)
Install
Create a "hello world" Rust project (cargo new hello)
Open project in VSCode
Set path info in launch.json file (located at folder root, may need to create this first)
Type Shift+Ctrl+B to build the Rust project

How to run pocketsphinx from Windows CMD

I am currently following the tutorial on cmusphinx.sourceforge.net to install pocketsphinx for Windows. Admittedly I only have experience in C#, and I'm not at all familiar with DOS commands.
My problem: When I try to run pocketsphinx_continuous, either through command prompt or by clicking on the icon, a DOS window pops up, quickly scrolls through a bunch of text, then closes before I can read anything on it. I'm not sure what to do.
My system: Windows 7 64-bit
What I've done:
I downloaded off the CMU sourceforge website the following: sphinxbase-5prealpha, pocketsphinx-5prealpha.
I unpacked both folders onto my desktop.
I went into the sphinxbase folder, opened sphinxbase.sln in Visual Studio 2012, then built the project.
I then went into the pocketsphinx folder, opened pocketsphinx.sln in Visual Studio 2012, and built the project.
I copied sphinxbase.dll from sphinxbase/bin/Release/Win32 and pasted it into pocketsphinx/bin
I tried clicking on pocketsphinx_continuous.exe. I get the problem.
I tried running in cmd C:\Users\*my name*\Desktop\pocketsphinx\bin\Release\Win32\pocketsphinx_continuous.exe -inmic yes -hmm model\en-us\en-us -lm model\en-us\en-us.lm.bin -dict model\en-us\cmudict-en-us.dict. Same problem.
I tried putting sphinxbase.dll in pocketsphinx/bin/Release/Win32. Same problem.
I tried doing all this for the files in pocketsphinx/bin/Release/x64
I tried doing all this for the files in pocketsphinx/bin/Debug/Win32(or x64)
I also tried building the projects in Visual Studio 2015, same problem.
I'm hoping I'm just making some blatant mistake, so any help would be greatly appreciated.

Qt doesn't find windows.h

I'm running a simple program with Qt5, QtCreator under windows 7+msvc2010 with SDK7 installed. I have to call specific Windows functions in this program.
If I try to compile it, I always get:
error: C1083: Cannot open include file: 'Windows.h': No such file or directory.
Of course, I set "normally" the dev. kit in QtCreator (Microsoft Visual C++ Compiler 10.0), and I try to run vcvars32.bat before. It still is not working.
Another point: Why when while compiling, do I not see any include (-I...) related to the Windows SDK?
Where is my mistake?

building ruby on windows 7

I know this has been asked before but I ran into a specific problem.
I'm trying to build ruby 1.9.2 rc2 on windows 7. When I run configure.bat it aborts with the following message.
cl -nologo -MD rtname.c user32.lib -link > nul
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
I find that the file 'rtname.c' does not exist anywhere within the source files. And this is why cl aborts.
I'm totally clueless as to what to do next. Searching for rtname.c on google doesn't return anything.
The first thing you have to do on windows is make sure your have some version of Visual studio C++ express edition installed. The latest version can be downloaded here
Next, you need to run the following file from the command line:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat
This configures your path environmental variable to allow the command prompt (and other programs) to find cl.exe. After doing this, running configure.bat should work correctly. This will build a 32-bit version of Ruby.
Maybe Visual Studio is required in your case to build Ruby from sources on Windows, but why don't you use RubyInstaller instead? It is a nice build environment; you can compile any version of Ruby on your machine, even from TRUNK.
If I understand it correctly you must have the C++ compiler installed to build Ruby. Could it be that you are missing that?
The RubyInstaller is quite stable and works most times.
I found that having already installed ruby on the box helps, see http://blog.cyplo.net/2011/01/01/compiling-ruby-1-9-2-windows/ , hope that helps

Building Opensource Qt for Visual Studio 2005/2008

Does anyone have instructions on building the opensource version of Qt? Now that the repository is opened up, I'm trying to build for VS2008 but I'm getting errors when it tries to build qmake.
I found the question I'm looking to use Visual Studio to write and compile using the open source version of Qt4 but this information is out of date, and doesn't really help me. For reference, here's what happens when I try to build with configure -platform win32-msvc2008
Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
cl -c -Foproject.obj -W3 -nologo -O2 -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -
IC:\dev\open_source\qt\include -IC:\dev\open_source\qt\include\QtCore -IC:\dev\open_source\qt\include -IC:\dev\open_sou
rce\qt\include\QtCore -IC:\dev\open_source\qt\src\corelib\global -IC:\dev\open_source\qt\include\QtScript -IC:\dev\op
en_source\qt\mkspecs\win32-msvc2008 -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NODLL -DQT_NO_STL
-DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -D
QT_NO_DATASTREAM -DQT_NO_PCRE -DQT_BOOTSTRAPPED -DQMAKE_OPENSOURCE_EDITION project.cpp
project.cpp
c:\dev\open_source\qt\src\corelib\tools\qstringlist.h(45) : fatal error C1083: Cannot open include file: 'QtCore/qalgori
thms.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
Building qmake failed, return code 2
Well, one helpful thing is to run configure inside the Visual Studio Command Prompt. That should be available in the Visual Studio start menu group under Visual Studio Tools.
Also now when you run configure you don't have to specify target platform, because it will be set as an environment variable by the VS Command Prompt.
I got errors from configure and nmake when I did not use the VS Command Prompt, and since switching I have not had any issues.
So the simple instructions would be:
1) open VS command prompt
2) navigate to qt folder where configure.exe is located
3) configure
4) nmake
Please, ensure that you have ActiveState Perl installed
This blog article seems to have more recent information on building Qt with visual studio. Hope it helps.
Note that Nokia, as of Qt 4.6, is now providing their own open source VS builds of Qt, so it is no longer necessary to build from source yourself to do development with Visual Studio. Access their open source download page, and look for builds named (e.g.) qt-win-opensource-4.6.1-vs2008.exe.
Also, if you simply want to compile with MSVC so you can develop with the open source libraries with visual studio, I put together a project to provide "pre-built" Qt LGPL libraries with MSVC 2008.
It might be helpfull and has the advantages of taking up less space then compiling it yourself. It also provides a command prompt with all your environment variables set up for you and a link to launch Visual Studio with a Qt environment. It's called qt-msvc-installer.
What user156973 said. Install ActiveState perl and run configure again.

Resources