makedll.exe - make dll's in blitzmax

BlitzMax Forums/BlitzMax Programming/makedll.exe - make dll's in blitzmax

skn3(Posted 2005) [#1]
Please use sweenies tool. its much better :D

http://www.blitzbasic.com/Community/posts.php?topic=50045&hl=dll


Michael Reitzenstein(Posted 2005) [#2]
BlitzMax comes with the source of bmk - how about implementing it as bmk.exe makedll?


Perturbatio(Posted 2005) [#3]
you need to escape your quotes in the last Else block:
	Print "#         <a href=~qhttp://www.acoders.com~q target=~q_blank~q>www.acoders.com</a>       #"



semar(Posted 2005) [#4]
That's really interesting skn3[ac] !

Now, if we could put an handy button on the Bmax IDE, whith a caption like 'Make DLL', which would make all that stuff automatically...

Anyway, regarding CreateProcess, since it returns a stream, you can try this to wait the process end:
process_stream = createprocess("whatever.exe")
while not eof process_stream
wend


From the help B+ file:

CreateProcess launches a 'console based' app and returns a handle to a stream representing its input/output.

If the app is expecting input, you can write to the stream to automatically enter lines of input using WriteLine.

If the app is generating output, you can read back from the stream to receive the lines using ReadLine.

*Note* This only works with console based apps that using stdin/stdout. Windows apps typically generate no output.

Blitz Print/Input are supposed to use stdin/stdout, but that feature is not quite working properly yet.




This, for example, works fine (BlitzPlus):

process$ = "calc.exe"
s = CreateProcess (process)


While Not Eof(s)

	If MilliSecs() - t >= 1000 Then
		DebugLog.Print "process " + process + " running"
		t = MilliSecs()
	EndIf

Wend

DebugLog.Print "process " + process + " terminated"

WaitKey


End



Sergio.


FBEpyon(Posted 2005) [#5]
If you used Dlls in your games, would it reduce the exe file size for linking sources??


skn3(Posted 2005) [#6]
Michael Reitzenstein, Id rather wait until there is a working CreateProcess function. That way can get rid of the batch file malarky. Also, where is teh bmk source .. it didn't come with my version ?

Perturbatio, that was the sites fault.. XD

Semar, bmax doesn't has CreateProcess yet.. ?


Michael Reitzenstein(Posted 2005) [#7]
For me it's in blitzmax\src\bmk - I'm still using a prerelease beta though, so it might have been taken out.


marksibly(Posted 2005) [#8]
Yes, bmk source was taken out.

Should be back in soon along with bbdoc source.


fredborg(Posted 2005) [#9]
Hi,

Really nice skn3[ac], but I'm having some problems with compiling stuff that needs extra functions. Ie. stuff that uses 'Import whatever' won't compile, any ideas what is needed to get that to work?


skn3(Posted 2005) [#10]
Check line 94
file.WriteLine("START /WAIT/B gcc -shared -o "+output+" "+modpath+".bmx/"+modname+".bmx.o "+bmaxpath+"mod/brl.mod/blitz.mod/blitz.a "+modpath+modname+".def")


It's importing the brl.blitz module when it calls gcc to create the dll. Uou can try modifying this, I wasn't sure if it was possible to import multiple files, you probably can.. if it is the case, it would be easy enough to make the blitz parser return a list of imports.


fredborg(Posted 2005) [#11]
Yep, I've been trying to add the imports, but the imports imports imports, if you know what I mean :)

So, I tried adding all the .a files found in the mod folder, but then the shell complains that the command is too long :(

Is there a way to define a file that has a list of all the imports, like the .def file that defines what is being exported?


skn3(Posted 2005) [#12]
I was wondering that too. If you find out post it here X)


Filax(Posted 2005) [#13]
Hi Snk3 :) do you continue your makedll project ? and where i can load it ?


DocFritz(Posted 2005) [#14]
sorry, I don't know very much about Cpp or C, but your program says, that it did not found gcc... isn't that the Gnu Cpp-Compiler? Whatever, I've installed DevCPP, that includes Gcc. Whats wrong?


N(Posted 2005) [#15]
Fritz: Check your paths. Good chance that GCC isn't in your PATH environment variable (because, as far as I know, Dev-C++ generates makefiles which point directly to GCC).


skn3(Posted 2005) [#16]
I might redo this sometime.. somone else with better knowledge of gcc should fix it X)


MattVonFat(Posted 2005) [#17]
Hi. I having a problem with this that it does everything it should and shows it as completed but the dll isn't actually created - it mentions something about not finding C:\Programs?


GW(Posted 2005) [#18]
blitzmax has all kinds of troubles with spaces in dir or filenames. If its refering to 'program files' that might be the cause.


Perturbatio(Posted 2005) [#19]
most programs will have trouble with spaces in directory or filenames if they are not quoted.

i.e. use "c:\program files" instead of c:\program files.

since arguments use a space as a delimiter.


Red(Posted 2005) [#20]
I wonder if this tool could be launched by my BMK preprocessor ? why not included ?
I have no problem with spaces.
Blitzmax could make DLL in transparently way.

I'll try to do it.

BMK addon : here


Azathoth(Posted 2005) [#21]
Is there a way to mark which functions to export and which not to in the DLL?


Red(Posted 2005) [#22]
Private, Public ?
Private should hide functions. Am I wrong ?


Azathoth(Posted 2005) [#23]
I thought that was only for modules.


Artemis(Posted 2005) [#24]
I've the "gcc" Problem too! Then I've installed Dev-Cpp and Edited Line 94 form "gcc" to Mypath+"gcc"
So there was no errormessage, but the dll wasn't compiled too.
I used Dev-Cpp4 because Dev-Cpp5(Beta) Causes very much Erorrs.

What's wrong??


Artemis(Posted 2005) [#25]
no one nows???
i'm going to cry... hit my head against a wall.. and die


Paul "Taiphoz"(Posted 2005) [#26]
should this not get a sticky post ?

iv only just found it but i think its an important add for the community.


SillyPutty(Posted 2005) [#27]
yeah for sure, i forgot about this, this should definately get a sticky !

I am gonna be using this shortly.


skn3(Posted 2006) [#28]
bump bump bump


Chris C(Posted 2006) [#29]
presumably is you use framework with a dummy module then you are okay with the liecence for max, is that right?


N(Posted 2006) [#30]
As long as you don't link to BRL's modules then you're fine.

However, I'm not sure if this is even possible with BMax.


Azathoth(Posted 2006) [#31]
Aren't even the most basic commands in BRL's modules, like brl.blitz, and brl.retro?