GSL for Visual C++ 2010 - visual-studio-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 ==========

Related

C++/CLI & Inconsistent layout information in duplicated types (std._Tree_unchecked_const_iterator)

I have got an issue after using the Platform Toolset v141 in Visual Studio 2017 for Debug 64 bit compilation.
typedef std::map<int, msclr::gcroot<cli::array<short>^>> MapIntToManaged;
int main(array<System::String ^> ^args)
{
MapIntToManaged testMap;
for (auto &it : testMap) {}
return 0;
}
This results in the linker error
error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (std._Tree_unchecked_const_iterator< ?? :: ?? >): (0x02000048).
1>LINK : fatal error LNK1255: link failed because of metadata errors
I found a couple of workarounds to get rid of this error:
changing the Platform Toolset back to v140
using this syntax instead of the auto iterator:
for (MapIntToManaged::iterator it = testMap.begin(); it != testMap.end(); ++it) {}
changing the Runtime Library from Multi-threaded Debug DLL (/MDd) to Multi-threaed DLL (/MD) and use NDEBUG instead of _DEBUG as preprocessor define
using 32 bit instead of 64 bit
I'd like to understand this issue.
And I want to use the newest toolset, the new iterator syntax and the Debug runtime DLL.

boost 1.58 xpressive::sregex outputs errors in debug mode

I encountered some problems when using boost::xpressive of boost1.58 on Visual C++ 2013.
My test program that using below code spills errors like below.
This error does not occur on Release mode.
Is this a boost's bug?
sregex reg = sregex::compile("\\");
Error:
e:\dev\vs2013projects\sandbox\sandbox\sandbox.cpp(35) : see reference
to function template instantiation
'boost::xpressive::basic_regex>>>
boost::xpressive::basic_regex>>>::compile(const
char
*,boost::xpressive::basic_regex>>>::flag_type)'
being compiled 1>
e:\dev\vs2013projects\sandbox\sandbox\sandbox.cpp(35) : see reference
to class template instantiation
'boost::xpressive::basic_regex>>>'
being compiled

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.

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

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).

'iostream': No such file or directory [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Installation of Visual Studio 2010 (any edition) installs only 2 files in the C++ headers directory
I am so desperate Right now its not funny I have searched the entire internet for the answer and its not working.... i have installed and reinstalled visual studio 2010 pro at least 4 times and it doesnt fix anything..... heres my problem
I try to make a simple Hello world project and boom it fails saying this..
#include<iostream>
using namespace std;
int main()
{
cout << "Hello World.." << endl;
return 0;
}
1>------ Build started: Project: ds, Configuration: Debug Win32 ------
1>Build started 1/21/2013 12:31:36 PM.
1>InitializeBuildStatus:
1> Touching "Debug\ds.unsuccessfulbuild".
1>ClCompile:
1> d.cpp
1>c:\users\dj\documents\visual studio 2010\projects\ds\ds\d.cpp(1): fatal error C1083:
Cannot open include file: 'iostream': No such file or directory
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.32
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
my include folder in VC only has these names
ammintrin
omp
pgobootrun
srv
wmiatlprov
Im not to great with this so if ur gonna answer can you put it noob terms:)
Thank you in advance..
When you choose console aplication check the option: include precompiled header, most likely you created an empty project in which case you must manualy add the path to iostream file
in .vcxproj directory includes you should have:
Include Directories $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;
and
Library
$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib
if you have these and stdafx.h include in cpp but still no path to iostream you should check PATH environment variable not to be broken or any of the variables $(VCInstallDir) $(WindowsSdkDir) $(FrameworkSDKDir)

Resources