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 / DarkBASIC Pro porject does not compile

Author
Message
programing dude
18
Years of Service
User Offline
Joined: 22nd Jul 2008
Location:
Posted: 20th Mar 2010 02:49
I have a project, when I went to compile and run it it started compiling. The status bar did not fill up showing the compiling progress. It just didn't compile. For a few seconds the compile button was gray but then it colored again.

I tried compiling another project and that compiles fine.

(I say compile but I mean compile and run)

I been sing dbp for a long time and never have encountered this problem.

help pls
programing dude
18
Years of Service
User Offline
Joined: 22nd Jul 2008
Location:
Posted: 20th Mar 2010 03:06
I looked at my code

Main Source



Character Controller Function



I remed everything out and inserted one command at a time and compiled.

It compiled and ran fine until I un-remed the #include command in the main source.

Why is this not working?

is it for sure the #include command?
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 20th Mar 2010 11:06
I don't think it should really matter, as the precompiler is ought to remove the #include statement in an early pass, but you really shouldn't have it in a loop.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Mar 2010 22:01
Quote: "but you really shouldn't have it in a loop"


Yes, try putting it at the start of your code and report back.
tiresius
23
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 21st Mar 2010 07:15
Quote: "I don't think it should really matter, as the precompiler is ought to remove the #include statement in an early pass, but you really shouldn't have it in a loop."

I'm pretty sure it matters. I think the precompiler takes the file pointed to by the #include and sticks it in the code at that point. So what you are really running is this:

Checking FullSourceDump.dba in your DBPro TEMP folder should confirm this.


A 3D marble platformer using Newton physics.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Mar 2010 13:36
Included files are tagged on to the end of the source.

It's fairly easy to prove this - try the attached example and notice that the print statement in the include.dba file is not executed.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Mar 2010 13:52
Quote: "Included files are tagged on to the end of the source."


Why do I keep forgetting that? Thanks.
programing dude
18
Years of Service
User Offline
Joined: 22nd Jul 2008
Location:
Posted: 21st Mar 2010 19:08
LOL I forgot that I don't need to include since I already added the Character control file to my main source through the solution explorer.

thnx any way though

Login to post a reply

Server time is: 2026-07-26 21:12:14
Your offset time is: 2026-07-26 21:12:14