Microsoft Speech API Error : .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' - codeblocks

I have a problem with SAPI: While I am compiling some code, I encounter this error in CodeBlocks:
||Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized|
obj\Debug\main.o||In function `main':|
C:\Documents and Settings\Mert\Desktop\yazi\okuproje\main.c|11|undefined reference to `CoInitialize#4'|
C:\Documents and Settings\Mert\Desktop\yazi\okuproje\main.c|14|undefined reference to `CoCreateInstance#20'|
C:\Documents and Settings\Mert\Desktop\yazi\okuproje\main.c|29|undefined reference to `CoUninitialize#0'|
||=== Build finished: 3 errors, 1 warnings ===|
My Code: http://pastebin.com/LCpCns2p

You don't mention which compiler you're using with CodeBlocks (or, more importantly, which linker), however, the errors you're getting are caused by missing libraries.
You'll need to add a reference to uuid.lib (to get the GUID definitions for IID_ISpVoice), and ole32.lib (to get the definitions for CoInitialize, CoCreateInstance, and CoUninitialize).

Related

Execution error when out-of stack enviroment, using text-icu on windows

I wrote some code. and fixed some errors with the help of good persons.
Now, this utility(samChecker-exe.exe) works properly in Stack environment.
This utility use text-icu and I coded this utility on windows. Of course, I want to work this utility on other windows OS.
I copied %stackPath%.stack-work\install\~\bin\samCheceker-exe.exe to some other folder, and execution through CMD.
But I got error message that says "libicuuc57.dll dose not exist. so program can't start. please re-install the program."
I copied libicuuc57.dll, and so... as like programming newbies, but failed. "stack install" command was the same result.
(I installed text-icu and installed ICU lib. on windows. The input file encoded in "MS949")
With help of Francesco Ariis from (beginners#haskell.org), I stepped forward.
But still got error message.
C:\Users\shaeg\Documents\Haskell\samChecker3> stack build --ghc-options="-static -optl-static"
Warning: File listed in samChecker3.cabal file does not exist: README.md
samChecker3-0.1.0.0: unregistering (local file changes: app\Main.hs samChecker3.cabal src\Lib.hs test\Spec.hs)
samChecker3-0.1.0.0: configure (lib + exe)
Configuring samChecker3-0.1.0.0...
samChecker3-0.1.0.0: build (lib + exe)
Preprocessing library samChecker3-0.1.0.0...
[1 of 1] Compiling Lib ( src\Lib.hs, .stack-work\dist\ca59d0ab\build\Lib.o )
Preprocessing executable 'samChecker3-exe' for samChecker3-0.1.0.0...
[1 of 1] Compiling Main ( app\Main.hs, .stack-work\dist\ca59d0ab\build\samChecker3-exe\samChecker3-exe-tmp\Main.o )
Linking .stack-work\dist\ca59d0ab\build\samChecker3-exe\samChecker3-exe.exe ...
C:/Users/shaeg/AppData/Local/Programs/stack/x86_64-windows/ghc-8.0.2/mingw/bin/ld.exe: cannot find -licuuc
C:/Users/shaeg/AppData/Local/Programs/stack/x86_64-windows/ghc-8.0.2/mingw/bin/ld.exe: cannot find -licuin
C:/Users/shaeg/AppData/Local/Programs/stack/x86_64-windows/ghc-8.0.2/mingw/bin/ld.exe: cannot find -licudt
collect2.exe: error: ld returned 1 exit status
`gcc.exe' failed in phase `Linker'. (Exit code: 1)
Warning: File listed in samChecker3.cabal file does not exist: README.md
-- While building package samChecker3-0.1.0.0 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_1.24.2.0_ghc-8.0.2.exe --builddir=.stack-work\dist\ca59d0ab build lib:samChecker3 exe:samChecker3-exe --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
[stack path] results
extra-include-dirs: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include
extra-library-dirs: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib
According to first error message(libicuuc57.dll dose not exist. so program can't start. please re-install the program.), I find the path for libicuuc57.dll, and re-set the extra-library-dirs.
C:\Users\shaeg\Documents\Haskell\samChecker3>stack build --extra-lib-dirs=C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --ghc-options="-static -optl-static"
But got the same result.
libicuuc75.dll, libicuin57.dll etc files is located in C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin
Someones says, this is Linker Acting.
How can I fix this error?
Thank you so much.
Sincerely, S. Chang.
Here is my stack path.
C:\Users\shaeg\Documents\Haskell\samChecker3>stack path
stack-root: C:\sr
project-root: C:\Users\shaeg\Documents\Haskell\samChecker3
config-location: C:\Users\shaeg\Documents\Haskell\samChecker3\stack.yaml
bin-path: .;C:\sr\snapshots\7dd4ddea\bin;C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin;C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\mingw\bin;C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin;C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\usr\bin;C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\usr\local\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\IntelSGXPSW\bin\x64\Release\;C:\Program Files\Intel\IntelSGXPSW\bin\win32\Release\;c:\Program Files\Intel\WiFi\bin\;c:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Hewlett-Packard\SimplePass\;C:\Users\shaeg\AppData\Roaming\local\bin;C:\Users\shaeg\AppData\Local\Microsoft\WindowsApps
programs: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows
compiler-exe: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\ghc.EXE
compiler-bin: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin
local-bin: C:\Users\shaeg\AppData\Roaming\local\bin
extra-include-dirs: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include
extra-library-dirs: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib
snapshot-pkg-db: C:\sr\snapshots\7dd4ddea\pkgdb
local-pkg-db: C:\Users\shaeg\Documents\Haskell\samChecker3\.stack-work\install\02136e14\pkgdb
global-pkg-db: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\lib\package.conf.d
ghc-package-path: C:\Users\shaeg\Documents\Haskell\samChecker3\.stack-work\install\02136e14\pkgdb;C:\sr\snapshots\7dd4ddea\pkgdb;C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\lib\package.conf.d
snapshot-install-root: C:\sr\snapshots\7dd4ddea
local-install-root: C:\Users\shaeg\Documents\Haskell\samChecker3\.stack-work\install\02136e14
snapshot-doc-root: C:\sr\snapshots\7dd4ddea\doc
local-doc-root: C:\Users\shaeg\Documents\Haskell\samChecker3\.stack-work\install\02136e14\doc
dist-dir: .stack-work\dist\ca59d0ab
local-hpc-root: C:\Users\shaeg\Documents\Haskell\samChecker3\.stack-work\install\02136e14\hpc
local-bin-path: C:\Users\shaeg\AppData\Roaming\local\bin
ghc-paths: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows
I was able to test it recently, and share my solution.
First of all, I assume environment of latest msys2 which is installed mingw64/mingw-w64-x86_64-icu 57.1-2 package.
Dynamic linking
Executable which dynamically linked has dependencies to libgcc_s_seh-1.dll libicudt57.dll libicuin57.dll libicuuc57.dll libstdc++-6.dll libwinpthread-1.dll under stack's msys2 mingw64/bin path. If you have already built dynamic linked executable, copying all of them to same directory will solve the problem.
Dependency walker in my comment can help to reveal all of these dependencies.
Static linking
Currently text-icu package doesn't seem to support static linking. So we should modify it ourselves. If you don't know how to make it into local package, note the third option of this.
Modify text-icu-0.7.0.1's .cabal file extra-libraries section to the following.
extra-libraries: sicuin sicuuc sicudt
-- if os(mingw32)
-- extra-libraries: icuin icudt
-- else
-- extra-libraries: icui18n icudata
Append -pgmlC:\Users\[USERNAME]\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\mingw\bin\g++.exe to your executable's ghc-options cabal entry. This is required to link to ICU's C++ symbols.
Then just do stack build.

Internal compiler error when UseDotNetNativeToolchain is true

I have a UWP app that compiles successfully if I have UseDotNetNativeToolchain off. But when I turn it on, it gives me the cryptic error:
Internal compiler error: Object reference not set to
an instance of an object. UWPApp C:\Program Files
(x86)\MSBuild\Microsoft.NetNative\x86\ilc\IlcInternals.targets 887 Build
This is all it gives me. What could be causing this? How can I drill down on this.
Using VS2015
Here is the full build output in case that helps:
https://gist.github.com/shannah/e24fe8456313fb9ad98577c9a812f357
The solution to this problem was to disable optimization in a few assemblies I was using in the Default.rd.xml file. E.g.
<Assembly Name="IKVM.OpenJDK.Core" Dynamic="All" DoNotInline="true" DoNotOptimize="true"/>

compile option for rcpp and lib files in windows

Hi I am trying to work with the rcpp. For this I want some cpp code which loads a dll by use of a lib-file (which has the same name as ). the code which I let run is:
cppFunction(includes=c("#include "windef.h","#include \"C:/data/Rdata/IHUAPI.H\" "), 'int functietom(int a){long serverhandle;int lRet;lRet = ihuConnect ( "historian1",NULL,NULL, &serverhandle ); return 5;}', verbose
= TRUE)
I get the following error:
undefined reference to `ihuConnect#16' collect2: ld returned 1 exit
status Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object
'C:/Users/user1663/AppData/Local/Temp/RtmpSW1Ki7/sourcecpp_1a04df63309/sourceCpp_26588.dll':
LoadLibrary failure:
the ihuConnect function is located in the ihuapi.lib and ihuape.dll files. In c++ in visual studio I add the lib file as added dependency and then I get rid of this error because I also sometimes get this error and then it was that I forgot to add the lib file in the compilation.
Thus My question is: how can I add this lib file as option in the compilation.
when I use dyn.load
("C:/data/Rdata/ihUAPI.dll")
and then check if it is loaded then he says yes
the problem is that getDLLRegisteredRoutines('ihUAPI', addNames = TRUE)
then it says:
data frame with 0 columns and 0 rows
so the dll seems not to contain the functions but it does when I use it from visual studio.
So please some help with lib-files and ddl-files
Tom Wambecq
You missed the Rcpp FAQ entry 2.9 'Can I use Rcpp with Visual Studio ?'.
And to kill all the suspense: No, you cannot.

EmguCV 'Emgu.CV.CvInvoke' Exception

I have installed EmguCV 2.4.2.1777. I have a 32-bit windows 7 so I installed it using the installer. Now I am trying to write a simple code to capture a webcam's video in a window in C#.
The problem is after during execution I am getting the following famous error:
A first chance exception of type 'System.DllNotFoundException' occurred in Emgu.CV.dll
A first chance exception of type 'System.TypeInitializationException' occurred in Emgu.CV.dll
An unhandled exception of type 'System.TypeInitializationException' occurred in Emgu.CV.dll
The file Emgu.CV.dll is present in the folder. I don't understand why its giving that error.
I tried all the checks which are suggested by fellow stackoverflow users and also many other references:
1) Installed MSVCR: MSVCRT 10.0 SP1 x86
2) copied the OpenCV dlls to the execution directory
3) I also have a 32-bit OS. So that also should'nt be an issue.
But when I checked for dependencies, I faced a problem:
I used DependecyWalker to open cvextern.dll and found the following dependencies missing:
NVCUDA.DLL
API-MS-WIN-CORE-COM-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL
API-MS-WIN-SHCORE-SCALING-L1-1-0.DLL
DCOMP.DLL
IESHIMS.DLL
It also gave the following:
Error: At least one required implicit or forwarded dependency was not found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
Please help me out with the exception. Thanks in advance.
I copied all the dll files from C:\Emgu\emgucv-windows-universal-gpu 2.4.9.1847\bin\x86 to a folder called includes in my project and updated the "Copy To Output Directory" Option for these DLLs to "Copy Always" and it got rid of this issue.

GSL for Visual C++ 2010

I'm trying to use the GSL 1.14 for VC2010 considering the build project proposed by Brian Glandman's (http://gladman.plushost.co.uk/oldsite/computing/gnu_scientific_library.php).
After building libraries I tried to run a simple example using the function gsl_sf_bessel_J0. See code below:
include
include
int main(){
double x;
double y;
do
{
printf("\nInforme o valor de x: ");
scanf_s("%lf", &x);
y = gsl_sf_bessel_J0 (x);
printf ("J0(%g) = %.18e\n", x, y);
} while (x!=0);
return 0;
}
The code compiles but the following messages appears. Even so the code properly calculates the function. I would like to know about these messages, mainly concerning with the possibility them generate some critical problems in most complicate codes.
'test_3.exe': Loaded 'C:\Documents and Settings\Francisco J. Profito\Meus documentos\Visual Studio 2010\Projects\test_1\Debug\test_3.exe', Symbols loaded.
'test_3.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open the PDB file
'test_3.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or open the PDB file
'test_3.exe': Loaded 'C:\WINDOWS\system32\msvcr100d.dll', Symbols loaded.
'test_3.exe': Loaded 'C:\WINDOWS\system32\shimeng.dll', Cannot find or open the PDB file
'test_3.exe': Unloaded 'C:\WINDOWS\system32\shimeng.dll'
The thread 'Win32 Thread' (0x1644) has exited with code -1073741510 (0xc000013a).
The program '[5508] test_3.exe: Native' has exited with code -1073741510 (0xc000013a).
1>------ Rebuild All started: Project: test_3, Configuration: Debug Win32 ------
1>cl : Command line warning D9007: '/Gm' requires '/Zi or /ZI'; option ignored
1> test_3.cpp
1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1> test_3.vcxproj -> C:\Documents and Settings\Francisco J. Profito\Meus documentos\Visual Studio 2010\Projects\test_1\Debug\test_3.exe
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Resources