Why this sublimetext build file dont work? - regex

I am trying to capture the output of the build, for open the file with the syntax error.
This is the build file:
{
"cmd": ["D:\\xampp\\apache\\conf\\buildApache.bat"],
"file_regex": "of (.*?)(?=:)",
"line_regex": "line ([0-9]*) ",
"selector":"source.apacheconf"
}
This is the response from the build File
AH00526: Syntax error on line 19 of D:/xampp/apache/conf/extra/httpd-vhosts.conf:
Invalid command 'Liste', perhaps misspelled or defined by a module not included in the server configuration
[Finished in 0.3s]
What I am trying to do, is when the user, dbl-click on the error, it's will open the file, on line 19.
How Do I write the build file?

In SublimeText 2, The source code file name must appear BEFORE the line number in the build output.
That way, It's impossible to capture the output.

Related

cc1plus.exe: fatal error: world.cpp: No such file or directory compilation terminated

i have problem with the code
everytime the code is done, running the code is still normal. when exiting visual code studio and re-entering, the code does not run end show the error as below
cc1plus.exe: fatal error: world.cpp: No such file or directory
compilation terminated.
I also got the same error, and to fix the error is easy. It may because your file name contains spaces. More information about this and how I know this is here:https://www.youtube.com/watch?v=Z5QxAjaiQp8. (Altough he got the different error raised but the way to fix it is still the same).
I resolved the error by removing the spaces between the name of the file I was saving. Earlier I was naming my c++ file as example- "test file.cpp", but when I removed the blank space i.e. "testfile.cpp" or "test_file.cpp", the error resolved.
If you are compiling the code using your terminal, you could check if the file you want to run is in that folder using dir for Windows or ls for Linux. If it is not, change to the folder where the file is and try running the file again.

MS Visual c++ "The number of source files and corresponding outputs must match"

I'm trying to compile my code on c++ in msVisual2019 but I get an error at every try:
Severity Code Description Project File Line Suppression State Error MSB6001 Invalid command line switch for "CL.exe". System.ArgumentException: The number of source files and corresponding outputs must match. at Microsoft.Build.Shared.ErrorUtilities.ThrowArgument(Exception innerException, String resourceName, Object[] args) at Microsoft.Build.Utilities.CanonicalTrackedOutputFiles.RemoveDependenciesFromEntryIfMissing(ITaskItem[] source, ITaskItem[] correspondingOutputs) at Microsoft.Build.CPPTasks.CL.PostExecuteTool(Int32 exitCode) at Microsoft.Build.CPPTasks.TrackedVCToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) at Microsoft.Build.Utilities.ToolTask.Execute() HelloWorld C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets 687
This first happened after I created (on accident) a header file inside "Source Files" (img attached), compiled it, then realized my mistake and placed it back in "Header Files". Now every time I build it, even after every change I make...
I can't get this error to go away and haven't found a solution to a similar problem yet.
Any help would be greatly apreciated, thanks.
[mistake, build after][1]
[correction, build after][2]
[errors displayed][3]
[1]: https://i.stack.imgur.com/SDAzP.png
[2]: https://i.stack.imgur.com/PG54S.png
[3]: https://i.stack.imgur.com/ZhEsH.png
Preprocess to a File doesn't seem like a good idea according to its description: This option suppresses compilation... I'm glad you set it to No. – rturrado Jul 10 at 21:04
Thanks #rturrado :D

Not able read from input output files in Sublime Text 3

I have successfully installed MinGW and have tried running cpp programs from command prompt and it runs perfectly. In Sublime I tried using default build system 'C++ Single File', it prints simple statements in the console below but it cannot take input. After building the programs with 'cin' commands the program does not show any output and I try giving input in the console below and press ENTER but nothing happens. Then I found a method of using 'freopen' command to take input from a file and output to a different file. But the programs runs successfully but doesn't output anything in the output file. Same problem -- mingw64 + sublime 3 input output files not working
After this I tried many other build files I found on web but none of them work.
{
"cmd": ["g++.exe", "-std=c++17", "${file}",
"-o", "${file_base_name}.exe",
"&&", "${file_base_name}.exe<input.in>output.out"],
"shell":true,
"working_dir":"$file_path",
"selector":"source.cpp"
}
The output.out file is always empty. I have input and output files in same directly and I think it is reading input correctly because when I delete the input file it gives an error that it cannot find the input file. I even tried using text files (input.txt, output.txt) after moding build system code but it doesn't work.
I have many other build codes but none of them works.
I tried running g++.exe -std=c++17 contest1a.cpp -o contest1a.exe && contest1a.exe<input.in>output.out in command prompt but the output.out file is still empty.
I replaced first line with "cmd" : ["g++ -std=c++14 $file_name -o $file_base_name && timeout 4s $file_base_name < input.in > output.out"], but it gives error because I think .exe is not suffixed which I tried adding and program runs but output is still empty.
Why is 'freopen' not working, why is any build not able to write in output file ?
So it turns out Windows defender has a new feature 'Block Folder Access' which blocked my program from modifying the output file. I wasted one day solving this issue smh

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.

Permission denied error while running a code on google cloud ML

I am getting an error while trying to read a file within the code.
File isn't open for reading") PermissionDeniedError: File isn't open for reading
file is located within the trainer folder on the google cloud shell. This is what I have given to read the file with file_io.FileIO('/home/arpit_agrawal/DeepSpeech/trainer/data/‌​spell/words.txt','r+‌​') as f: WORDS = set(words(f.read()))
THIS WAS THE ERROR IN LOG FILES : WORDS = set(words(f.read())) File "/root/.local/lib/python2.7/site-packages/tensorflow/python/‌​lib/io/file_io.py", line 106, in read self._preread_check() File "/root/.local/lib/python2.7/site-packages/tensorflow/python/‌​lib/io/file_io.py", line 70, in _preread_check "File isn't open for reading") PermissionDeniedError: File isn't open for reading
result of ls -la for words.txt
-rwxr-xr-x 1 arpit_agrawal arpit_agrawal 12124743 Apr 11 17:53 words.txt
It looks like it is a unicode issue in the code you pasted. Specifically there are non printable unicode characters there. I copied and pasted from the code you wrote and ran the following.
In [2]: 'r+‌​'=='r+'
Out[2]: False
The left one was copied from the original stackoverflow post. I'd suggest deleting that code and retyping it.