GLBasic forum

Main forum => Bug Reports => Topic started by: Hemlos on 2009-Aug-17

Title: export
Post by: Hemlos on 2009-Aug-17
Ok im working on testing the export ability again..

1. The wrapper looks great gernot, very nice looking.

2. I switched to win32-dll, but the file.dll doesnt appear to be visible after compiling(only the gbas is built), what did i do wrong?
Title: Re: export
Post by: MrTAToad on 2009-Aug-18
I'm finding that with

Code (glbasic) Select
FUNCTION AddFloat#: var1#, var2#
  RETURN var1+var2
ENDFUNCTION


EXPORT AddFloat#


I'm getting :

Warning: unresolved EXPORT: AddFloat#
Warning: unresolved EXPORT: AddFloat#
Wordcount:1 commands
Warning: unresolved EXPORT: AddFloat#

or

gpc_temp1.o:gpc_temp1.cpp:(.text+0x20): multiple definition of `_AddFloat'
gpc_temp0.o:gpc_temp0.cpp:(.text+0xf0): first defined here

depending on whether the # symbol is removed off the function and EXPORT command

It's also creating an exe file, and not DLL...
Title: Re: export
Post by: Hemlos on 2009-Aug-18
A.
Confirmed, a # in the function name causes an error.

B.
With your issue for the multi count error....
1. clear your temp dir.
2. put all your exporting functions in a separate file.function.gbas, for the functions exported.
3. go through, and make sure, you are only calling these functions once.

multi-count, I had this problem when i tried to export 40 functions, i accidently had 2 identical calls.

C.
for me, i dont see any dll, no matter what i do..it doesnt seem to be building anything except the wrapper.gbas



Title: Re: export
Post by: Kitty Hello on 2009-Aug-18
The dll should be in the .app directory. It works for me.
Title: Re: export
Post by: Hemlos on 2009-Aug-18
Heres a screenshot, options are all correct, nothing is hidden, program is compiled.
dll not present

[attachment deleted by admin]
Title: Re: export
Post by: MrTAToad on 2009-Aug-18
One thing that will be worth trying is an uninstall & re-install...

No, that didn't solve it either...  However, this code was stopping it compiling :

Code (glbasic) Select
FUNCTION foo:
ENDFUNCTION


INLINE
}
//extern "C" unsigned long GetUserDefaultUILanguage();
namespace __GLBASIC__ {
ENDINLINE


FUNCTION GetLangID%:
INLINE
//return GetUserDefaultUILanguage();
ENDINLINE
ENDFUNCTION


However, commenting everything out doesn't solve it - it appears that no source files are allowed with the WinDLL option, and the only way to get it to compile is to remove the source file.  However, whilst compiling & linking succeeded, there is no DLL
Title: Re: export
Post by: Hemlos on 2009-Aug-18
Here is a project, a simple one, where no dll is created....i rar the whole directory.



[attachment deleted by admin]
Title: Re: export
Post by: trucidare on 2009-Aug-18
Hi all,

check attachement, works for me



[attachment deleted by admin]
Title: Re: export
Post by: trucidare on 2009-Aug-18
No only the project, compile as DLL

i can Send the compiled project too if you want.
Title: Re: export
Post by: Hemlos on 2009-Aug-18
The problem is NO DLL

The wrapper is working fine......there is no driver.dll file created.

test-dll.gbas is just a wrapper...its not the driver.

Download my attachment above, look inside, you will find the entire project, compiled ..
As you can see, a test-dll.gbas is created, but not test.dll
Title: Re: export
Post by: trucidare on 2009-Aug-18
come to chat, i?m online
Title: Re: export
Post by: Hemlos on 2009-Aug-18
ok ill brt
Title: Re: export
Post by: trucidare on 2009-Aug-18
Compiled as DLL, hmm have you installed any instance of mingw oder cygwin?

EDIT:// Screenshot

[attachment deleted by admin]
Title: Re: export
Post by: Hemlos on 2009-Aug-18
Quotemingw oder cygwin
This is a result of cygwin1.dll search in the harddrive, see untitled.JPG (below my sysinfo)


I saw a dll get compiled a few versions back in time, but not V7.085.
So something is wrong with the editorE.exe maybe?

system info:



EditorE.exe v7.085
GLBasic Precompiler V.7.038





[attachment deleted by admin]
Title: Re: export
Post by: MrTAToad on 2009-Aug-18
I dont have it installed...
Title: Re: export
Post by: Hemlos on 2009-Aug-18
hard drive search results for cygwin1.dll:
5 copies in glbasic compiler directories, as shown in screenshot below:

[attachment deleted by admin]
Title: Re: export
Post by: trucidare on 2009-Aug-18
Ok all fine, sounds like a EditorE bug. We will see what gernot find.
Title: Re: export
Post by: Kitty Hello on 2009-Aug-19
It seems you pressed F8 or F5 to build. That makes a Win32 exe file. Press Shift-F8 and select "Win32-dll". It should build fine then.
Title: Re: export
Post by: Schranz0r on 2009-Aug-19
Doesn't work Gernot! There is a bug ...
Title: Re: export
Post by: MrTAToad on 2009-Aug-19
The Shift+F8, and select Win32-DLL works here...
Title: Re: export
Post by: Schranz0r on 2009-Aug-19
Ok works, was my bad xD
Title: Re: export
Post by: Hemlos on 2009-Aug-19
stupid human bugs LMAO


Gernot can you add the shift f8 thing to the export command in the manual? :)

QuoteEXPORT function_name
If you create a DLL, this function will be exposed to the public interface and the wrapper-gbas file will yield it, too.


What exactly does this mean:
'function will be exposed to the public interface '

Does it mean dll will be decompiled into a legible cpp?
Title: Re: export
Post by: Kitty Hello on 2009-Aug-19
No. A dll is sort of an exe file w/o main entry point. But you can have a list of functions that are exposed to a readable interface. Thus, you can dynamically link to these functions and use them as if you linked then into your program in the first place.
Title: Re: export
Post by: Hemlos on 2009-Aug-19
Thank you for all that, Gernot.

One more question(for now hehe),

The dll file has internal functions, called by other functions, in the dll.
Is that going to work without wrapping them into the public files?
Or do i need to have those internal system functions wrapped into the readable wrapperdll.gbas too?



Title: Re: export
Post by: Hemlos on 2009-Aug-19
ok cool that got rid of all the error messages.
The program starts now...
...and results with a windows error, first thing. :(
check screenshot screenshot.jpg


I need to investigate the exact cause...ill be back.


[attachment deleted by admin]
Title: Re: export
Post by: MrTAToad on 2009-Aug-19
Could be almost anything :)
Title: Re: export
Post by: Hemlos on 2009-Aug-20
Found it....

GETSCREENSIZE and SHOWSCREEN both crashes the dll program.

My api has an internal error checker/messaging system, these 2 commands are needed.

Anyone aware of a workaround?
Title: Re: export
Post by: Schranz0r on 2009-Aug-20
you can't export GLB intern functions :D
Only Gernot can help you :)
Title: Re: export
Post by: Hemlos on 2009-Aug-20
Quote from: Schranz0r on 2009-Aug-20
you can't export GLB intern functions :D

Very funny.  :puke:

Is there something that distinguishes commands, as "intern functions" ?
Title: Re: export
Post by: Kitty Hello on 2009-Aug-20
Oh dear. I think I was too quick with the idea that a dll might help. If you use graphics functions, I'm uncertain if they use the same window.

I think what we really need is a safe way for gbal. I see what I can do there. Everything else would just "cripple" the libraray.
Title: Re: export
Post by: Hemlos on 2009-Aug-20
Ouch, SpriteZ is crippled.  :'(

Well, at least we found some more knowledge, about dll's for GLBasic.

Goodluck with the GBAL thing Gernot.
May the force be with you!