If compile my code in the IDE it works fine but if i use pbcompiler I get the following message:-
Error: Assembler
purebasic.asm [119]:
extrn SetCurrentDirectoryA
processed: extrn SetCurrentDirectoryA
error: symbol already defined.
..
that's a windows call (SetCurrentDirectoryA)
..
is there some sort of switch I am missing on the compiler ??
[EDIT] I just noticed. If I run the compiler with the -c option (produce a commented asm output [purebasic.asm]) then I also get a PureBasic.exe that seems to run fine ???
Cheers
Roger
IDE works - Compiler doesn't
Re: IDE works - Compiler doesn't
The right environment must be set.
See in the installation of PB "PureBasic-CLI.cmd"
Or start it.
See in the installation of PB "PureBasic-CLI.cmd"
Or start it.
Code: Select all
;-TOP Run from PB-IDE. Not das Compiled Program
; Set enviroment automatik
RunProgram("cmd", "/K SET", "")
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
-
RogerTunnicliffe
- User

- Posts: 24
- Joined: Fri Oct 17, 2025 10:10 pm
Re: IDE works - Compiler doesn't
"PureBasic-CLI.cmd" This is not in my install directories of PureBasic
RunProgram("cmd", "/K SET", "") and sorry I don't know what this means. Is this to be coded in the program, because when i do it does nothing.
I just get
Error: Line 1 - Syntax error
??
RunProgram("cmd", "/K SET", "") and sorry I don't know what this means. Is this to be coded in the program, because when i do it does nothing.
I just get
Error: Line 1 - Syntax error
??
Re: IDE works - Compiler doesn't
The question is, which options (compiler flags) do you use?
I would recommend at least: (call compiler with /? to see all flags)
The batch file “PureBasic-CLI.cmd” should be located in the PureBasic installation directory. (Where the Purebasic.exe file is also located.)
This is the content. (I have never used it.)
I would recommend at least: (call compiler with /? to see all flags)
Code: Select all
/OUTPUT -o --output "Filename" ; Create an executable or a dll to the given filenameThis is the content. (I have never used it.)
Code: Select all
@echo off
SET PUREBASIC_HOME=%cd%
SET PATH=%PUREBASIC_HOME%/compilers;%PATH%
cmd
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).

