Disphelper FB Howto ?

Windows specific questions.
K128
Posts: 33
Joined: Jun 14, 2011 3:23
Location: Kathmandu, Nepal

Disphelper FB Howto ?

Postby K128 » Jul 25, 2011 11:00

How to use Disphelper in Freebasic? Where can I get an example of a FB App using 'FileSystemobject' and 'WScript.Shell' ?

Also, I don't know why but some posts and even replies from other members / gurus of FB get lost automatically after some time.

Also, is there some BCX (Basic to C) like plugin or something in Freebasic (or maybe a new upcoming implementation ?), I read about such feature of FB in some website, can't remember the Website name though.

Thanks....
dkl
Site Admin
Posts: 3206
Joined: Jul 28, 2005 14:45
Location: Germany

Postby dkl » Jul 25, 2011 19:59

There are some examples in FreeBASIC/examples/libraries/disphelper, maybe they can help you.

Lost posts? Maybe it's this: http://www.freebasic.net/forum/viewtopic.php?t=18249

Basic to C? Well, sort of... fbc has a -gen gcc option that tries to generate C and use gcc to compile it, as a sort-of high level assembler, so it's not pretty C, or a translator, or such.
K128
Posts: 33
Joined: Jun 14, 2011 3:23
Location: Kathmandu, Nepal

Postby K128 » Jul 26, 2011 1:40

dkl wrote:There are some examples in FreeBASIC/examples/libraries/disphelper, maybe they can help you.

Lost posts? Maybe it's this: http://www.freebasic.net/forum/viewtopic.php?t=18249

Basic to C? Well, sort of... fbc has a -gen gcc option that tries to generate C and use gcc to compile it, as a sort-of high level assembler, so it's not pretty C, or a translator, or such.


Thankyou

I tried it and it said no gcc.exe found, I copied the gcc.exe from MinGW to win32 of freebasic and now i get the new error:

gcc.exe: CreateProcess: No such file or directory

Do I have to have some addin(s) or something to get the 'C Emitter' running ?

Thank you...
dkl
Site Admin
Posts: 3206
Joined: Jul 28, 2005 14:45
Location: Germany

Postby dkl » Jul 26, 2011 5:44

Hmm, gcc also needs the cc1.exe (the actual compiler) in some path, I think it must be similar to MinGW directory layout.
K128
Posts: 33
Joined: Jun 14, 2011 3:23
Location: Kathmandu, Nepal

Postby K128 » Jul 26, 2011 6:56

Wow!, C Emitter is great...

dkl wrote:Hmm, gcc also needs the cc1.exe (the actual compiler) in some path, I think it must be similar to MinGW directory layout.


Thankyou @dkl, I copied the entire MinGW directory and joined it with the FB's Win32 and it did work but, I expected the 'C' Source file to stay but, it(gcc ?) directly deletes the 'C' Source file and generates the EXE. How do I configure it to prevent the C Source file from being deleted.


Is there any tutorial on 'C Emitter' usage ?

Thanks....
TJF
Posts: 3467
Joined: Dec 06, 2009 22:27
Location: N47°, E15°

Postby TJF » Jul 26, 2011 11:32

K128 wrote:How do I configure it to prevent the C Source file from being deleted.

Have a look at

K128 wrote:Is there any tutorial on 'C Emitter' usage ?

C emitter is experimental. Feel free to add some stuff to the wiki pages. (But I guess most issues are covered allready, as in the page mentioned above.)
dkl
Site Admin
Posts: 3206
Joined: Jul 28, 2005 14:45
Location: Germany

Postby dkl » Jul 26, 2011 11:32

You can pass -R to fbc, then it will preserve the intermediate .c files (just like with the .asm files from the normal -gen gas).
creek23
Posts: 260
Joined: Sep 09, 2007 1:57
Location: Philippines
Contact:

Re:

Postby creek23 » Mar 10, 2012 5:33

K128 wrote:Wow!, C Emitter is great...
...
Thankyou @dkl, I copied the entire MinGW directory and joined it with the FB's Win32 and it did work...

What exactly did you copy to FB's Win32 directory? I tried copying the content of MinGW\bin to it but it still didn't work. I tried copying the content of MinGW (bin, include, lib, directories and etc) to it but FBC can't find the GCC as it's already in C:\FBC-0.23.0\bin\win32\bin\{here}.

May I know what files/folders are there in your C:\FBC-0.23.0\bin\win32\?

Thanks.

~creek23
dkl
Site Admin
Posts: 3206
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Disphelper FB Howto ?

Postby dkl » Mar 10, 2012 9:03

gcc.exe must be at FreeBASIC\bin\win32\gcc.exe for fbc 0.23. Then in addition to that, gcc needs its own stuff, if I remember correctly that would be the C:\MinGW\mingw32 (gcc's private binutils) and C:\MinGW\libexec\gcc (gcc's cc1.exe etc.) directories, which must be placed relative to gcc.exe as in the MinGW tree, so that would be FreeBASIC\bin\mingw32 and FreeBASIC\bin\libexec\gcc.
creek23
Posts: 260
Joined: Sep 09, 2007 1:57
Location: Philippines
Contact:

Re: Disphelper FB Howto ?

Postby creek23 » Mar 26, 2012 5:45

Hi dkl,

I already did copy everything like what K128 did, but I'm still getting the gcc CreateProcess error.

Anyone else got -gen gcc working?

Or maybe, has anyone created an FB to C++ converter?

~creek23

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 2 guests