Re: Problems creating dll / preprocessor

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hi

mattlewis said...
andi49 said...

Hi

I worked a little on my problem, but still got no solution.

i still can't produce working dll's on Windows using gcc (i tried WIn8.1 64bit and WinXP 32bit)

Okay, it's not completly correct i can produce very simple dll's using Eu4.0.x and Eu 4.1 64bit.

 
-- This is the dll code 
 
global function add(integer a, integer b) 
 
	return a+b 
 
end function 
 

One problem here is that you're trying to export a function with the same name as a backend function. I'm not sure how we can solve this sort of conflict. If you tried this under Linux, you'd get a linker error similar to:

/usr/local/lib/euso.a(be_runtime.o): In function `add': 
be_runtime.c:(.text+0x137): multiple definition of `add' 

The translator code doesn't attempt to alias function names on Windows, however (we used a different way of naming exports under Watcom). That needs to be fixed. I could import the function using "_1add@8" under Windows, but was still getting machine errors. I suspect this is happening in the C calling code, but I haven't gotten that far yet.

Matt

I can confirm this partly, but i got no linking error on Win32 or Win64. This simple dll above just works as it it should.

global function add(atom a, atom b) 
 
	return a+b 
 
end function 

But this one crashes silently if i call it with floatingpoint values (not with integer values).

I think there is a problem with gcc and dll's on Windows.

For now it is okay for me as i got OpenWatcom working on Win8.1 64bit. So i can use Eu4.0.x and everything works just fine.

I'am now heading for holydays :)

Andreas

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu