-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/23/2010 23:39, Luis Lavena wrote:
> Hello,
> 
> I was attempting to port a program from Linux to Windows where certain
> functions are exported and used by plugin/extensions. Since the
> program is not a shared object, there is no import library to link
> with.
> 
> Since PE do not allow unresolved symbols to compile, I couldn't find a
> way to work on this port for Windows without altering the whole
> application a lot.
> 
> To make things a bit clearer, this is what I wanted to achieve:
> 
> test.exe needs to remain the executable but also export some symbols:
> foo_help and foo_hello
> 
> Needed to create a import library for these symbols (libtest.a) and
> allow plugin.dll link to it
> 
> Every time tried using extern and export these symbols ended with
> unresolved references to foo_help and foo_hello, even when libtest.a
> contains those definitions.
> 
> Also tried with __cdeclspec(dllexport) and __cdeclspec(dllimport) in
> test and plugin respectively without avail.
> 
> As I've been suing dynamic languages for quite long, I'm definitely
> getting rusty at C.
> 
> Does anyone have a hint to achieve this without radically altering the
> original program?
> 
> Thank you.

Hello,

you should use a callback to set a pointer to your function in your
executable.

You don't need to link to your executable.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (MingW32)

iEYEARECAAYFAkzDA/cACgkQp56AKe10wHfmSgCcDDeCT3/fzzxvk9GGA5GpWRvI
epIAoIIvI5JtiR6SuYV5QP9o12hb+tBY
=cAYg
-----END PGP SIGNATURE-----

Attachment: 0xED74C077.asc
Description: application/pgp-keys

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to