sublime text 2 C++ run error on windows - c++

I am using Windows 7 x32 and have already installed, sublime text 2, MinGW, also set PATH for minGW in system variables, but it still does not work.
I try to build it get [Finished in 0.8s] and then I try run, get this:
[Error 2] The system cannot find the file specified
[cmd: [u'bash', u'-c', u"g++ 'C:\\Users\\air\\Desktop\\test.cpp' -o 'C:\\Users\\air\\Desktop/cc' && 'C:\\Users\\air\\Desktop/test'"]]
[dir: C:\Users\air\Desktop]
[path: C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Program Files\MySQL\MySQL Server 5.5\lib;D:\QtSDK\Desktop\Qt\4.7.4\mingw\bin;D:\QtSDK\Desktop\Qt\4.8.1\mingw\bin;D:\Program Files\CodeBlocks\MinGW\bin]
[Finished]
It seems that because linux uses "/", but windows uses "\" in the file path. I try to change the "C++.sublime-build", but failed. I really don't know how to fix it, Can anybody help me?

I had the same problem and the answer came simple as 42: since bash needs to be run in cmd command, it must be in the path variable. In my case, bash was contained in MSYS (which can be installed optionally with MinGW), I added C:\MinGW\msys\1.0\bin to path, restarted Sublime Text and now run command is working.

Related

Fatal error: cannot open file '-c= ' : No such file or directory (SPP, phantompeakqualtools)

I am trying to run phantompeakqualtools in the terminal, I am using a WSL in Visual Studio Code.
I have followed all the steps and installed dependencies to use this program as listed here: https://code.google.com/archive/p/phantompeakqualtools/ and here: https://github.com/kundajelab/phantompeakqualtools
However when I try to execute, it says no such file or directory while clearly the file is there.
The file is in the correct format, a tagAlign.gz file. But somehow it can't find it. I also tried to run it as sudo but that didn't work either.

Program won't start because libmpc-3.dll is missing

I'm trying to compile c++ code in Notepad++. The command I'm running is as follows in the Program to Run box.
C:\MinGW\bin\g++.exe -o "$(NAME_PART)" "$(FULL_CURRENT_PATH)"
I get the error saying "The program can't start because libmpc-3.dll is missing...". I checked the MinGW file path and the libmpc-3.dll file is there in the bin folder.
Why would it say the file is missing, or is there something wrong with my command?
Please take a look at this solved question:
MinGW gcc -> libmpc-3.dll missing on 64-Bit Windows 7
Maybe it helps you.

Visual Studio cross platform makefile project, command not found

I'm trying to build a cross platform project for Ubuntu. In my makefile I have the line
"PSPSDK=$(shell psp-config --pspsdk-path)"
which gives the error "psp-config: Command not found."
psp-config is in my path and running make from the Ubuntu system on the files that get copied over from Visual Studio works fine. It also works if I manually ssh into the Ubuntu system from windows and run the command from there.
Why can't it find the command when run through Visual Studio?
You should update PATH at the beginning of "~/.bashrc" file (and not at the end) because it starts with somethign like:
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
Also, if you add code before these lines, it will be invoked for every subshell execution, so it is better to add a guard for it as well so it is invoked only once per session:
if [ -z $HOME_OPT_PATH_SET ]; then
export PATH=$PATH:$HOME/opt
export HOME_OPT_PATH_SET=1
fi
# If not running interactively, don't do anything
...

LNK1181 error when compiling V8 engine on Win10

I'm following this guide on building V8 but I am hitting some issues on the compilation step. I am running Windows 10 x64. I am trying to compile with options to embed the engine also.
Running the following command:
ninja -C out.gn/x64.release
Gives me this error:
ninja: Entering directory `out.gn/x64.release'
[1/471] LINK mksnapshot.exe mksnapshot.exe.pdb
FAILED: mksnapshot.exe mksnapshot.exe.pdb
C:/Workspace/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo /OUT:./mksnapshot.exe /PDB:./mksnapshot.exe.pdb #./mksnapshot.exe.rsp
LINK : fatal error LNK1181: cannot open input file 'comdlg32.lib'
ninja: build stopped: subcommand failed.
Now I believe I have narrowed down the error to looking for the .lib files in the wrong directory. I have (had) multiple versions installed, so there were multiple folders in my Windows Kit install.
Windows Kits/10/Lib/10.0.16299.0
Windows Kits/10/Lib/10.0.15xxx.0
If I dragged and dropped the comdlg32.lib file from 10.0.16299.0 into the 10.0.15xxx.0 directory then the error changed to a LNK1181 error with a different input file. I did this a few times but I was unsure if this was going to cause issues with different versions and there was probably going to be a lot.
I uninstalled the 10.0.15xxx.0 version which left behind the folder I mentioned, so I removed that and after doing so I have started getting the LNK1181 error with a different input file (advapi32.lib I assume the very first file it can't find). This is how I came to the conclusion about the path being incorrect.
So I have tried a few things to change the path (I hoped just uninstalling the old version would fix it) such as:
Uninstalling the old version.
Going through registry entries to see if I can find an install path or something using that path, which I didn't. I did notice that there was still installation and data in the registry for the 10.0.15xxx.0 install, I might try deleting that from the registry directly as a last resort?
I have tried to explicitly set the path by setting <TargetUniversalCRTVersion>10.0.16299.0</TargetUniversalCRTVersion> in this file: C:\Program Files (x86)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\uCRT.props
I have never used Ninja before so I tried looking for a way to set some kind of lib-path in the command but couldn't really find anything.
I looked through the python scripts being executed to try and locate something to do with the libs path but couldn't see anything.
I would be grateful for any help and suggestions. Thanks.
You can try to compile v8 using Visual Studio as explained here: https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#using-the-visual-studio-ide
By running the following commands:
$ gn gen --ide=vs out.gn/x64.release
$ cd out.gn/x64.release
$ msbuild all.sln
You can see a full example here: https://github.com/phpv8/v8js/issues/272#issuecomment-262848754
Apparently this method is not officially supported anymore, but I had the same problem as you have and this solved the issue for me.
Note that after this I had another issue, the unit tests failed to be compiled due to a linking error, but I had the necessary libraries to use v8. So there may be deeper problem that is causing all of this that I'm missing.
Edit:
Also, you could try to set the following parameters with gn args:
visual_studio_path = "..."
visual_studio_version = "2017"
wdk_path = "..."
windows_sdk_path = "C:\Program Files (x86)\Windows Kits\10"
To set those parameters, do:
gn args out.gn/x64.release
This will open a text editor where you can write the extra parameters you are interested in.
To see the full list of parameters you can specify:
gn args --list out.gn/x64.release
I was following this guide https://medium.com/dailyjs/how-to-build-v8-on-windows-and-not-go-mad-6347c69aacd4 and also ran into the error
LINK1181: cannot open input file 'advapi32.lib'
I'm pretty sure it was because I had the wrong versions of the Windows 10 SDK. Similar to you I had versions:
Windows Kits/10/Lib/10.0.10240.0
Windows Kits/10/Lib/10.0.16299.0
But according to https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#Setting-up-Windows (Which I think is relevant) you need version 10.0.15063.0
After installing version 10.0.15063.0 (with the visual studio installer) to
Windows Kits/10/Lib/10.0.15063.0
I was able to continue with the build.

Error 2 The system cannot find the file specified in Sublime Text 2, Windows 8

Just installed Sublime Text 2, try to build hello world program, and get this message:
[Error 2] The system cannot find the file specified
[cmd: [u'g++', u'', u'-o', u'/']]
[dir: C:\Windows\system32]
[path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\]
[Finished]
What do I need to do to compile a program correctly in ST2?
Solved. Sublime Text 2 needs g++, bash, etc in order to compile. These files (?) need to be installed in your computer, as per the instructions on this page:
http://www.claremontmckenna.edu/pages/faculty/alee/g++/g++.html
Make sure you save the file you're working on, where ever on your drive before building and running.