If not, sure would like that feature in the next release.
Location of the Executable
Location of the Executable
When you Compile/Run or Compile/Debug, is there a way to force the executable that is created in the [PB folder]\Compilers (has the name PureBasic#######.exe) to the same folder as the source code other than the "Create an Executable" feature.
If not, sure would like that feature in the next release.
If not, sure would like that feature in the next release.
This already Works! But the IDE does not support it!
I checked it with a small example. I created a test.pb in directory C:\TEST:
Than I opened the cmd-console:AND test.exe was created in the directory test!
Here is a simple batch file (name it i.e. pb_debug.bat):
For instance ... put the batch file on the desktop. Than drag-and-drop the file test.pb from the explorer window to the batch file ... it will compile the dropped file to an exe with the same name as the file ... in the same directory
cu, helpy
I checked it with a small example. I created a test.pb in directory C:\TEST:
Code: Select all
Debug "TEST"
MessageRequester("","TEST")Code: Select all
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\path to\username>cd \TEST
C:\TEST>D:\path to Compiler\PBCompiler.exe test.pb /DEBUGGER /EXE .\test.exe
******************************************
PureBasic v3.92 - Windows x86
******************************************
Compiling test.pb
Loading external libraries...
Starting compilation...
2 lines processed.
Creating executable.
- Feel the ..PuRe.. Power -
C:\TEST>Here is a simple batch file (name it i.e. pb_debug.bat):
Code: Select all
@echo off
REM check if a file was given as arguemnt
REM if no file was given ... show the usage
if "%~1"=="" goto :ShowUsage
REM set environment variable PBCompiler
set PBCompiler=Drive:\path to compiler\PBCompiler.exe
REM change to drive, where the pb-file is
%~d1
REM change to directory of the pb-file
cd "%~dp1"
REM compile the file
"%PBCompiler%" "%~nx1" /DEBUGGER /EXE "%~n1.exe"
REM call the exe file
echo.
echo.-------------------------------------------------------------------------------
echo program is running in debug mode ...
"%~n1.exe"
echo program execution stopped ...
echo.-------------------------------------------------------------------------------
echo.
REM pause the execution of the batchfile,
REM so you can check the output of PBCompiler
pause
:REM end the batchfile
goto :EOF
REM usage of batch file
:ShowUsage
echo.
echo Usage: pb_debug.bat <source_file.pb>
echo pb_debug <source_file.pb>
echo.
pause
goto :EOFcu, helpy
Of course the IDE does support it; when you select "create executable" and you're prompted for the exe folder and name, the IDE calls the compiler with the same options you're using in your example.
You can also add those options for the PBCompiler as a new Tool (in the Tools menu), without having to use a .bat file.
You can also add those options for the PBCompiler as a new Tool (in the Tools menu), without having to use a .bat file.
El_Choni
Hi El_Choni,
Maybe you can explain me how it will work ...
And with [F5] (menu Compiler->Compile/Run) an random exe name is created and the exe file will be located in the compilers directory. If I have some external files which are relative to the exe-path, than I have to copy these files in to the compilers directory ... I do not like this behavior.
cu, helpy
No! That is not true! I activated debugger in IDE (with menu Compiler->Debugger) than I created the exe and started it. The debugger window does not show up!El_Choni wrote:Of course the IDE does support it; when you select "create executable" and you're prompted for the exe folder and name, the IDE calls the compiler with the same options you're using in your example.
Maybe you can explain me how it will work ...
But in this case I cannot tell the compiler that the exe name should be extracetd from the source-filename (i.e. file.pb => file.exe).El_Choni wrote:You can also add those options for the PBCompiler as a new Tool (in the Tools menu), without having to use a .bat file.
And with [F5] (menu Compiler->Compile/Run) an random exe name is created and the exe file will be located in the compilers directory. If I have some external files which are relative to the exe-path, than I have to copy these files in to the compilers directory ... I do not like this behavior.
cu, helpy
Hmm. Hopefully the windows port off the new PBIDE will have this.
So far I've been using jaPBe and it lucikly seems to change work directory to the source folder so you can just leave all dll's and .ini files in the source folder.
OTH shouldn't be that hard to change the origial IDE to use a workfolder either.
But right now I'm sticking with jaPBe until the new PBIDE is avail on windows
So far I've been using jaPBe and it lucikly seems to change work directory to the source folder so you can just leave all dll's and .ini files in the source folder.
OTH shouldn't be that hard to change the origial IDE to use a workfolder either.
But right now I'm sticking with jaPBe until the new PBIDE is avail on windows
In jaPBe with [F5] (Compile/Run) and [F6] (Compile/Debug) the EXE with the name "Purebasic[Number].exe" is also created in the Compilers directory (.\PureBasic\Compilers).Rescator wrote:So far I've been using jaPBe and it lucikly seems to change work directory to the source folder so you can just leave all dll's and .ini files in the source folder.
With "Create Executable" you can choose where to put the exe file (in jaPBe and also in the PureBasic editor). BUT in this case the exe is always compiled without the compiler option /DEBUGGER.
In jaPBe you the the menu point Project->Compile manual... where you can give your own compiler switches. This is the only way to put a debug-version of the exe file in a different directory and not in the compilers directory.
cu, helpy



