Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How are source code files passed to the DBPro compiler

Author
Message
Kenjar
20
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 2nd Feb 2016 16:43
Hi,

I've got a fresh download of the new DBPro open source files and I have a very silly question.

How are source code files (DBA) sent to the compiler.exe? Can this be done via command line? Are there switches for different things?

I'm interested in creating my own IDE for the open source edition just for fun, and finding out how the source code is passed into the compiler will be a fun thing to experiment with!

Thank you for reading.
Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 2nd Feb 2016 20:17
It can be done from command line, just call the compiler and pass it the file path to the .dbpro project file as argument.

the .dbpro file needs the addition of a line:

final source=Main.dba

or whatever your main .dba file is called, it should be referenced in terms relative to the directory where the .dbpro file is located
Kenjar
20
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 2nd Feb 2016 22:11
Thank you very much.
Kenjar
20
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 2nd Feb 2016 23:08
Hi,

I attempted to do what you said, however I just get the error failed to 'LoadDBA' when I use the dbpro file. If I use the dba file it generates a default.exe application which runs great with a simple hello world application.

All I did was dump test.dbpro and test.dba into the compiler folder then call

DBPCompiler test.dba

Can you define the name and location of the resulting EXE via switches, or is it all controlled via the DBPro file? And if so, why is this DBPro file not working?



Please note I tried changing final source to Hello World.dba as well, and this didn't affect the resulting error message.

Many thanks in advance.
Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 3rd Feb 2016 04:52
the failed to load dba error is usually a file path problem.

given the following files:

c:\Dark Basic Professional Online\Compiler\DBPCompiler.exe
c:\temp\main.dbpro
c:\temp\main.dba

with the following content in main.dbpro:



and main.dba:



at command prompt:
c:\Users\Ortu>"c:\Dark Basic Professional Online\Compiler\DBPCompiler.exe" c:\temp\main.dbpro

will compile without issue.

Kenjar
20
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 3rd Feb 2016 10:33
Hi,

I replicated the dbpro and dba file exactly as you posted. My paths are a little different with:

C:\Project_DBPro\Install\Compiler
C:\Project_DBPro\Install\Projects\Hello_World

I've also created the files main.dbpro and main.dba

I then called the command:

"C:\Project_DBPro\Install\Compiler\DBPCompiler.exe" C:\Project_DBPro\Install\Projects\Hello_World\main.dbpro

It's writing out to the correct folder, but it's just a log file giving the same error message.

I hope I'm just doing something fundamentally wrong here! Cause I'm scratching my head.

Many thanks again.

Le Verdier
13
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 3rd Feb 2016 12:01
Maybe this can be useful:
https://forum.thegamecreators.com/thread/56639


All hail the new flesh
John Y
Synergy Editor Developer
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: UK
Posted: 3rd Feb 2016 16:31 Edited at: 3rd Feb 2016 16:32
Try setting the current working directory for the DBP Compiler to the directory containing the .dbpro and .dba file

https://msdn.microsoft.com/en-us/library/windows/desktop/bb762153(v=vs.85).aspx
See the lpDirectory parameter
Synergy Editor - Available for free HERE!
Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 4th Feb 2016 01:51
Hmm, this is tested ok as described above on my machine using the U77 compiler on Windows 10.

have not tested with the new open source compiler (nor on other versions of windows), if that is what you are using, that may handle things differently.

Login to post a reply

Server time is: 2025-08-08 17:18:35
Your offset time is: 2025-08-08 17:18:35