Exprtk parser not working on VS 2015? - c++

I am trying to use the parser from this site:
http://www.partow.net/programming/exprtk/
on VS 2015. Unfortunately, I get the following error while compiling exprtk_simple_example_01 (one of the example files included in the download with the parser):
Severity Code Description Project File Line Suppression State
Error C4996 'std::_Copy_impl': Function call with parameters that may be
unsafe - this call relies on the caller to check that the passed values are
correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See
documentation on how to use Visual C++ 'Checked Iterators' TEST
c:\program files (x86)\microsoft visual studio 14.0\vc\include\xutility 2229
Why is that? Is this parser not compatible with VS 2015?

THE SOLUTION IS:
In solution explorer, right click the project, select "properties". The project property page will open. Expand the ">C/C++" entry in the tree on the left and select "Preprocessor" under that. The top entry in the right pane should be "Preprocessor Definitions". In that edit box, add _SCL_SECURE_NO_WARNINGS, separating it from the other entries with a ;
Then set the linker flag /bigobj!

Related

'Debugging' visual studio code .natvis based custom view objects

I would like to provide some .natvis file based C++ custom view objects for Visual Studio Code. It is not working as expected out of the box and the definitions used in the .natvis file are not used to display the intended objects during a debugging session. I added the custom .navis file to the launch.json and followed all best practices I could find.
Now I'm at the point where some feedback about the parsed .natvis content would be helpful to find the error. Is it possible to get log outputs or more about these definitions in a Visual Studio Code session to be able to find my error?
Yes it is, but I don't have experience with VS Code, only Visual Studio. But presumably you have Visual Studio installed if you are using natvis? If not then maybe you could download it, to fix your natvis errors.
In Visual Studio go to
Tools/Options/Debugging/Output Window/General Output Settings/Natvis Diagnostic Messages
Set to Error or Verbose
Error messages appear in the output window when you start debugging your program. I found that you get one error message at a time. So if your natvis file has several errors it will take a while to fix them all.

Opening cpp files or visual studio 2013 ultimate dosen't have debug option neither error list

When i open a cpp file i have created (that isn't inside a project) in visual studio 2013 ultimate, i see an option that says attach instead of the usual debug if i open a c++ project.
Also no error list etc shows. How to fix that so visual studio always defaults to the c++ editor (or IDE)?
This question and answers are not what problem i am experiencing: Visual Studio Can't Debug Can Only Attach
The only way to use the c++ compiler while using visual studio is to create a new project and then choose win32 application.
After that you can add your files e.g. cpp or header files.
If you want to e.g. download a cpp file online and have an option to compile it then the only way to do so would be to either copy the code to lets say a cpp that you have inside your project or copy the whole cpp file into the project.
You can't just open the cpp file and have an option to compile it in visual studio like you could with lets say dev c++.

Visual Studio 2012 C++ How to add compiler option in NMake project

I am currently modifying on a open-source project to suit my own need, however, the project to be built (or compiler) requires me to add a /EHsc option to cl.exe
I am using Microsoft Visual Studio 2012 to work on the project. I have been searching long enough but I cannot find the solution still.
Is it possible to add a flag via MS Visual Studio 2012? Because I saw the output log displaying that compiler (cl.exe) compiled with various flag in this project such as /nologo /c /WX.
How can I add the options to cl.exe with this IDE?
Project working on : SumatraPDF
[Edit #1] After reading the first answer provided below, this is the screen I got, it doesn't seem there is an option to do so.
Update: From the screenshot you posted, it seems the SumatraPDF project is NMake-based.
Therefore, you will have to add /EHsc to the build command line, using the NMake property page described here, or edit the Makefile directly.
Original, misguided answer follows:
Per MSDN:
To set this compiler option in the Visual Studio development
environment
Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.
Select the C/C++ folder.
Select the Code Generation property page.
Modify the Enable C++ Exceptions property.
Or, set Enable C++ Exceptions to No, and then on the Command Line
property page, in the Additional Options box, add the compiler option.

Visual Studio Project always out of date, "up to date is missing #ECHO", why is Visual Studio looking for this input?

Background:
My team wants Visual Studio for development on an existing codebase, for its various tools, and that's what most developers are used to using. However, the existing build system (an internal flavor of Jam) is very entrenched, and for a variety of factors cannot be changed.
The idea:
Create a project for each component. I did this using a description generated by Jam of what files go into each library, and making that into a QT project file. I call qmake on this to generate Visual Studio projects with "qmake -tp vc".
Disable Visual Studio's build. I did this by changing the Type of each source file to "does not participate in build" (by changing each to )
Add a pre-build event that calls the Jam build.
Problem:
Now, when I try to build from Visual Studio, it works, in that it calls Jam.
However, I would expect Visual Studio to think the project is always up-to-date, considering it is not actually tracking any source files for compile. But it is always out-of-date, and must call the pre-build command before debugging (which attaches the debugger to the executable, and works just fine).
I used DebugView to see what was going on, and for many of my projects, I get the following in the log
[12900] Project '<my project's name>' is not up to date because 1 build inputs were missing.
[12900] devenv.exe Information: 0 :
[12900] up to date is missing: '<my project's location>\#ECHO'
I've searched high and low, but cannot find any reference to #echo as a file input to anything anywhere. Does anybody know, and/or is there a way to track down why it is looking for this?

Extend the Visual Studio C++ Build Process

A found an article (Extend the Visual Studio Build Process) that explained how to override build targets in a C# project file. I tested this, and it seems to work well. However, what I really want to do is override a build target in a C++ project (with Visual Studio 2005). The problem is that C++ projects use different XML. Instead of having <project> as the root, C++ projects have <VisualStudioProject> as the root. When I add the <target> tag to a C++ project file and try to open the project in Visual Studio, I get this error:
The following error has occurred during XML parsing:
File:
[Path to Project File].vcproj
Line: 304 Column: 30 Error Message:
Element 'Target' is unexpected
according to content model of parent
element 'VisualStudioProject'.
The file
'[Path to Project File].vcproj'
has failed to load.
How can I override a Visual Studio build target for a C++ project? Or is there a better way to customize what happens during a C++ build?
In Visual Studio 2005 there are no build "targets" for C++ builds as the C++ build system does not use MSBuild.
However, VC++2005 defines the Pre-Build, Pre-Link, Post-Build Events as well as the ability to add a Custom Build Step for non-standard files.
You may be able to achieve what you want using these settings.
Note:
VC++2005 projects can be built using MSBuild, it's just not what Visual Studio does out of the box.
Visual Studio 2010 uses MSBuild for all project types.