Sublime Text 2 and HTML5 Boilerplate build script - build-script

After falling in love with Sublime Text I'm now getting ready to leave Aptana. ST2 seems to have a built in build function. If i go to "Tools"->"Build System"->"New Build System" i can define my own build commands but can i some how tell ST2 to use the build script from HTML5 Boilerplate? So that when i press F7 or ctrl+B it builds from there.

Tools -> Build System -> New Build System...
It will open a new custom build file you can customize. Then you just have to save it with your desired name, restart Sublime and it will appear in the list along with the others.
Here you can find the customization options and instructions.
To run boilerplate you have to specify the right path to Boilerplate runbuildscript.bat, by default it's inside the build folder.

Related

"SDL2.DLL missing from computer" but is in the same folder as program?

SDL Folder in the same directory:
Contents of SDL folder:
I cant get my program to run as it says it cannot find SDL2.DLL? Any ideas?
Programs don't search your entire hard drive for DLLs. That would be expensive, horribly insecure, and bug prone.
Instead they have a search path, which depends on how you load it. Often your PATH environment variable is used, together with various other system places, as well as the directory of the process loading the dynamic library.
This list rarely includes "a subdirectory of the process executable called SDL". You can, however, modify the search path; how exactly depends on how you are trying to load SDL.
The easy solution is to try to copy them all into the same directory.
You can use a Post-Build-Event to copy sdl2.dll into the directory where your .exe is built. Manually copying the file is fine for a quick test, but having Visual Studio do it for you has some advantages. For example, this lets you completely delete your Debug and Release directories and have the correct file copied when you do a clean build.
In your directory listing I see bin32 and bin64 directories inside the SDL directory. I assume that there is a copy of sdl2.dll directly inside each of those directories, but there are no separate debug and release versions, just 32-bit and 64-bit. Let me know if this is incorrect, otherwise, you can do this:
Open the Solution Explorer and select your project (not the solution). Then use Alt+Enter to go directly to the Property Pages. (Or right-click the project and select Properties at the bottom of the menu.)
In the selection panel on the left, go to Configuration Properties/Build Events/Post-Build Event.
At the top of the property sheet, set the Configuration dropdown to All Configurations and the Platform dropdown to All Platforms.
Click the edit box to the right of Command Line and enter this command:
copy "$(SolutionDir)SDL\bin$(PlatformArchitecture)\sdl2.dll" "$(TargetDir)"
Now click OK, and save and build your solution. You should find that it copies the correct version (32-bit or 64-bit) of sdl2.dll into the build directory.
The various $(FooBar) entries in the command line are macros which ar automatically expanded according to things like your project directory location, the type of platform you're building for, etc.
$(SolutionDir) is the directory containing your .sln file, with a trailing backlash.
$(PlatformArchitecture) is 32 or 64 depending on which platform you're building for.
$(TargetDir) is the directory that VS creates your .exe file in.
So this command line is an ordinary copy command as you might use in a command prompt, with the paths filled in to copy either SDL\bin32\sdl2.dll or SDL\bin64\sdl2.dll to your build target directory. We use quotes around the source and destination paths in case you have any spaces in your project path.
In some cases you may need specific commands for a particular configuration (Debug/Release) or platform (Win32/x64). You can do this by selecting that configuration or platform at the top of the property sheet. In our case, we can use one command for both 32-bit and 64-bit builds thanks to the $(PlatformArchitecture) macro.
To learn more about the macros, you can select the Command Line box in the property page and then click the drop-down arrow that appears to the right of the box, and select <Edit...>. This opens a multiline edit window (you can use more than one command in the build event), with an Evaluated value below it that shows the actual command that will be used for your current configuration and platform. You can inspect this command to see if it looks right, and you can also copy the evaluated command and paste it into a command prompt window for a quick test.
To see a full list of available macros and what they expand to for your current configuration/platform, click the Macros>> button below that and look through the list or use the search box at the top.

How to run a script\executable before start debugging in VS2015?

I need to run a code generator before starting compilation\execution of my code in Visual Studio 2015.
Is there any way to add a script that will run my .bat.py file when I click "Start Local Debugger"?
I use UnrealEngine 4 and in my project there already are some .cs files that use precompilation scripts, but these scripts are not fired if the project is already up-to-date.
Any solutions?
Open properties of your startup project in VS (should be your game, not UE4). You need Configuration Properties → Debugging.
When you click Local Windows Debugger (this is what it's labeled in my VS) it runs whatever is specified under Command with Command Arguments. UE4 projects usually have $(TargetPath) and "$(SolutionDir)$(ProjectName).uproject" specified but you can change it to run your .bat script and add custom logic.
However, if your project is not up to date, Build Command Line is going to be called before the debugger (Configuration Properties → NMake). For UE4 that would be UnrealEngine\Engine\Build\BatchFiles\Build.bat script. If you need your logic to run before Build.bat you can put it here. Or replace this script with your own.

Eclipse C++ Setup, Path to executable not set

I try to program some stuff in c++ with eclipse, but I have slight difficulties.
When I create a new Project compiling and making works fine but when I try to run the Application I get the following error message:
"Launch failed. Binary not found"
So what I found out by using google is this workaround:
-right-click on the projekt in the projekt explorer
-select "run as" and then "run configurations"
-expand "c/c++ application" in the navbar on the left
-and in the main tab of the project select "browse"
-navigate to folder "debug" and select the .exe
after I do that, running works fine but I have to do it again every time I create a new Project, is there a way to automate this process?
And what I also noticed: I don't have a "binaries" folder in my projects in the project explorer, maybe its related to that, but I really don't know.
Any help is appreciated
Thanks
Tim
Edit: added a video: http://youtu.be/RKnTOkoHFRU
There will only be a Binaries folder if the build was successful. You will have to manually build to get a binary in order for the Binaries folder to appear. Likewise, if you clean (remove) your build folder then Binaries will disappear.
I would guess that Eclipse cannot find your binary "out-of-the-box" because you are using external tools to manage the build process; that is, if you have a custom makefile project (or another type of project that uses another tool to handle the building) then Eclipse will not be able to provide a default run configuration because it does not "know" where the binary is or even which binary to run if there are multiple. Thus, you have to set up the Run Configuration as you are doing now.
If you create a project and let Eclipse do the building, then Eclipse can find the binaries automatically. For example, simply create an "Empty C++ Project" under "Executable". Write some hello world code. Click build. Then click run. Eclipse launches the binary because it is managing the build process and thus "knows about" where the binary ends up.
Open project properties (Right click on your project, choose Properties on the menu)
C/C++ Build -> Settings
Click on Binary Parsers tab and check PE Windows Parser
as seen here stackoverflow.com/questions/9407430, answer number 3 or 4
In my case
I just save the programme. Press CTRL+B to build it.
Refresh it.
Then run the programme.
Now you can see this will work fine.
I have already answered this for other question see the link Launch Failed Binary not found Eclipse for C in Windows at 10th number.

Change output directory of an Eclipse CDT project

I cannot find the possibility to change the output of the built files. The only I've found deactivates the whole generated makefile process, which I don't want to.
Right-click on your project and choose Properties.
Go under C/C++ Build, under Settings.
Click on the Build Artifact tab.
Under "Output prefix", enter the directory that you want to contain your built file (including a trailing slash).
It looks like you'll also need to modify your Run / Debug Settings with the updated path.
(However, writing your own makefile really isn't hard, especially if you use Eclipse's generated makefiles as a starting point, and it can give you a lot more flexibility.)

How Do I Use Eclipse to Debug a C++ Program on Linux?

I don't use Eclipse as an IDE, and have no interest in doing so. However, I do like its source-level debugging.
Is there any way I can use it to debug a C++ Linux app without going through the ritual of creating a project? (In effect, can I just use it like a frontend to gdb?)
If not, what are the steps I need to follow to create a project that I can use to just debug an existing C++ program that is built using Makefiles or other tools (SCons, CMake, etc.). I don't want to be able to "develop" in Eclipse; all I need to do is debug.
Take a look at this question. Create a C/C++-project, use your project's source directory as project directory, select to use the external builder, and change "make" to whatever tool you want.
The tricky part is to get the indexer to work correctly and find all your header files.
EDIT: CMake 2.6.x has support for generating CDT project files, which might be a more straightforward solution.
I don't know if this has changed in the 4+ years since the question was posted, but there's a much easier way to do this. I'm on Eclipse Luna (4.4.2).
> eclipse&
then
File > Import > C/C++ > C/C++ Executable > Next > browse to executable > Next > choose a project name > Finish
No other project setup required, no source paths (which should be in the object code). Just like running gdb/insight/etc. Almost makes it worth installing Java.
Configuration for debugging in Eclipse.
In eclipse,
Go to Window->preferences
A popup will appear then select C/C++ , click on drop down arrow ,then select Debug and click on drop down arrow.
Select Source Lookup Path and then click on Add.
After clicking on Add, click on Path Mapping and then click on OK.
Specify the mapping path name and then click on Add .
In compilation path select Cygwin path (need to install) and then click ok .
In debug option,click on source Lookup Path and select Path Mapping:Project source and click on apply and then ok.