Sublime Text 2 Wants to Only Build Using Java - build

For some reason, if I try to run and build a .py .cpp .tex or etc and I try to build any file it tries to run java and returns an error like this:
[Error 2] The system cannot find the file specified
[cmd: [u'javac', u'C:\\Users\\name\\Documents\\evolve1\\case0\\herp.cpp']]
[dir: C:\Users\name\Documents\evolve1\case0]
[path: C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\ImageMagick-6.8.9-Q16;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime Alternative\QTSystem;C:\Program Files\MATLAB\R2012b\runtime\win64;C:\Program Files\MATLAB\R2012b\bin;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\WinMerge;C:\Python27\;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Avogadro\bin]
[Finished]
This is weird on multiple levels, but I'm primarily concerned with getting it to stop building with Java (which I never use anyways) and im a tad confused about why its looking in that particular dir in the third line considering I never even ran code in there.

Select Tools -> Build System -> Automatic, and Sublime should pick the correct build system depending on the syntax of the source file. For example, when editing a .py file, after saving and hitting CtrlB, you should build with Python. If for some reason that doesn't work, just select your desired build system before you build.

Related

How to run a BOOST test using vstest.console.exe?

I am using BOOST test to test my C++ code. The tests typically look like below and the test project is built as a exe. In order to collect Code Coverage information, I am hoping to be able to run my tests using vstest.console.exe so I can try using its /Enablecodecoverage option.
#include <boost/test/unit_test.hpp>
... other includes ...
class TestContext {...}
BOOST_AUTO_TEST_SUITE(MyTests);
BOOST_FIXTURE_TEST_CASE(SomeTest, TestContext)
{
// test code
}
BOOST_AUTO_TEST_SUITE_END()
I keep running into "No test is available in .exe. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again." I am clueless at this point.
When running using --diagnostic option, I see this in the generated file:
"C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\Common7\IDE\Extensions\TestPlatform TpTrace
Warning: 0 : 13924, 3, 2020/10/15, 14:33:27.926, 1817417335033,
testhost.exe, TestPluginDiscoverer: Failed to load extensions from
file 'C:\Program Files (x86)\Microsoft Visual
Studio\2019\Enterprise\Common7\IDE\Extensions\TestPlatform\Extensions\Microsoft.VisualStudio.Coverage.Interop.dll'.
Skipping test extension scan for this file. Error:
System.BadImageFormatException: Could not load file or assembly
'Microsoft.VisualStudio.Coverage.Interop' or one of its dependencies.
An attempt was made to load a program with an incorrect format. File
name: 'Microsoft.VisualStudio.Coverage.Interop'"
Visual Studio Installer on my machine confirms Boost.Test test adapter is already installed.
Figured it out. The issue was a right TestAdapter path. I have Boost.Test adapter installed already (if you don't you can do so from VS Installer). Adapters are located on my machine in folders under C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions and vstest.console.exe is able to detect and execute tests even if I gave path to the root directory like /TestAdapterPath:"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise".

MSBUuild is looking for "...\v4.0\V110\Microsoft.Cpp.Default.props" when we have ".../\v4.0\V140\Microsoft.Cpp.Default.props"

While building the project "Common.vcxproj", We are getting Error message : error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
The machine has the tool installed at "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Default.props" , but the .vcxproj is looking for "V110" folder.
In the Project file ""
and We have registry key = "VCTargetsPath" and value = $([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))
Question is why the MSBUuild is looking for "...\v4.0\V110\Microsoft.Cpp.Default.props" when we have ".../\v4.0\V140\Microsoft.Cpp.Default.props"?
Thanks
Question is why the MSBUuild is looking for
"...\v4.0\V110\Microsoft.Cpp.Default.props" when we have
".../\v4.0\V140\Microsoft.Cpp.Default.props"?
Please try these:
1) please check register editor and enter both HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\MSBuild\ToolsVersions\14.0 and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0 and then make sure that it uses v140's path as this link shows.
2) Right-click on your project in VS 2015 IDE-->Properties-->Configuration Properties-->General-->change Platform Toolset to v140.
3) Also, check whether you define any VCTargetPath under Project Properties(right-click on your project)-->xxxxx-->Command Line
4) Run npm install -g --production windows-build-tools in Powershell as administrator
5) If these does not work, please go back to step one, and then change VCTargetsPath to C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\ directly.
Or run [Environment]::SetEnvironmentVariable("VCTargetsPath", "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140", "Machine") in powershell.
Hope these could help you.

Build a Visual Studio C++ project using the Command Line

I''ve written this batch script to build a Visual Studio C++ project using the Command Line:
pushd C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\
VsDevCmd.bat
pushd F:\Master_Copy2\embedded\IFV-170\visualC12
Msbuild.exe DSP1_Emu.vcxproj
The script changes to C:\Program Files (x86)\ ... directory, runs the VsDevCmd.bat, and then don't complete the commands, and I don't know what's wrong.
Note: When I run these commands one by one in a Command window it runs properly and builds the project.
Edit: #roalz pointed out that I should use Call with the batch file VsDevCmd.bat, and this solved the problem.
I think you need to use the call batch command to call VsDevCmd.bat from inside your batch file.
"The CALL command will launch a new batch file context along with any specified parameters. When the end of the second batch file is reached (or if EXIT is used), control will return to just after the initial CALL statement."
Please see the reference here
Another suggestion is to enclose paths containing spaces inside double quotes, i.e.
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\"

binary_log_types.h: No such file or directory

I was compiling a small mysql C project and
got stuck with the below error :
C:\Program Files (x86)\MySQL\MySQL Server 5.7\include/mysql_com.h:22:30: fatal error: binary_log_types.h: No such file or directory.
I did a dir binary_log_types.h /b /s at C: drive but i didn't find any binary_log_types.h file as such.
What is a possible workaround?
After a bit of research I figured out that for some reason the two files binary_log_funcs.h and binary_log_types.h are missing from the mysql 5.7 community installer installation.
Fix :
1) Download the MySQL Server Source code from the MySQL Site.
2) Extract the the tar archive. ( I used Winrar for this)
3) Goto Your\Download\Location\Here\mysql-5.7.7-rc\mysql-5.7.7-rc\libbinlogevents\export\
4) Copy the binary_log_funcs.h and binary_log_types.h from this folder and
paste them in Path\to\your\mysql\server\include.
5) Rebuild the Code::Blocks application.
Note : Make sure that Code::Blocks has the permission to access the the files and folders in the C: directory. Also, this could be a temporary fix as I strongly feel that I didn't do a complete mysql installation which should automatically include these files. Anyway I am temporarily happy :)
Just confirmed the existence of this bug in MySQL 5.7.9 (64bit) as well:
C:\Program Files\MySQL\MySQL Server 5.7\include\mysql_com.h(22): fatal error C1083: Cannot open include file: 'binary_log_types.h': No such file or directory`
I got this error message while compiling in Visual Studio 2013 Update 5, code based on communication with MySQL to store data in a database.
My solution is a variant of sjsam's own answer. Go to the GitHub MySQL repository and open this folder/directory:
https://github.com/mysql/mysql-server/blob/5.7/libbinlogevents/export/ :
There are 2 files in that folder:
binary_log_funcs.h
binary_log_types.h
Save the 2 files to your own computer by using the file links (or copy the text from the file contents, then save the text to straight text files with the same names as the originals), then put both files in your MySQL Server 5.7\include\ folder. Depending on your configuration, this can be one of these 2:
C:\Program Files\MySQL\MySQL Server 5.7\include\
C:\Program Files (x86)\MySQL\MySQL Server 5.7\include\
Congratulations, you have now solved your issue. But I am wondering why the developers at mysql.com haven't added those 2 files to the MySQL Community Server 5.7.9 installer package...
the following statement, from: http://dev.mysql.com/doc/refman/5.6/en/binary-log.html
indicates the mysql server must be started with the right parameter
for the log to exist.
"To enable the binary log, start the server with the --log-bin[=base_name] option. If no base_name value is given, the default name is the value of the pid-file option (which by default is the name of host machine) followed by -bin. If the basename is given, the server writes the file in the data directory unless the basename is given with a leading absolute path name to specify a different directory. It is recommended that you specify a basename explicitly rather than using the default of the host name; see Section B.5.8, “Known Issues in MySQL”, for the reason. "
There is lots of related info at that same web page.

mingw32-g++.exe: error: (invalid): No such file or directory

--- Not a useful topic --- Problem occurred in project...
I viewed this page: mingw32-g++.exe: error: CreateProcess: No such file or directory
I installed MinGW(32) first, and installed MinGW64 (by mingw-builds).
And this error occurred. I know i installed EGCS(64bit MinGW).
I tried to uninstall(by wizard) and reboot but i still can't build in C::B.
And i now uninstalled mingw(the original version) and installed TDM-GCC-32 and 64.
The configure is not wrong, and the files is correct.
My %Path%:
PATH=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program File
s (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Window
s;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Progra
m Files\Lenovo\Bluetooth Software\;C:\Program Files\Lenovo\Bluetooth Software\sy
swow64;C:\Program Files (x86)\Windows Live\Shared;depot_tools;C:\Program Files (
x86)\Common Files\Acronis\SnapAPI\;C:\Program Files\Microsoft SQL Server\110\Too
ls\Binn\;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program File
s (x86)\NArrange 0.2.9\;C:\TDM-GCC-64\bin;C:\TDM-GCC-32\bin
I'm going to assume from your above comment that the mingw toolchain you installed on your machine is working properly. The next thing you need to verify is that code::blocks is looking in the right place for that install.
To do this goto Settings->Compiler. This brings up the "Global compiler settings" window. Click on the "Toolchain executables" tab. You should see something like the following:
Check that the "Compiler's installation directory" has the correct path for your mingw install. Also check and make sure the various fields below point to the correct compiler executable name.
Your global variable setup is incorrect for cb_release_type. It is (invalid) in base field.
You need to re-point the base to some other useful directory.
For example i put c:\codeblocks\src\bin and compilation started
Thanks