俞晓磊
2011-03-27 07:24:21 UTC
Hello,
I'm a newbie in C/C++ and have encountered some problems when linking
against dlls. After some googling, I think I need some basic knowledge of
linking, object, impport, exort library ...:
1. In which circumstance will external functions be prefixed by __imp_ and
suffixed by @xxx?
2. Can I have some control over these prefixes and suffixes?
I found "extern" keyword removes the __imp_ prefix, but I just couldn't
remove @xxx suffix,
or I am just wrong
3. If __imp_ is a convention to indicate external functions imported from a
dll, how will @xxx help, and what does the number xxx mean?
I believe gcc does not know how linking will happen when compiling
source code,
thus @xxx suffixes have no use at all
I may solve my problem when I have some info on these questions, but I think
it proper to describe my situation:
I wrote some opengl es code and found it handy to just link them against
libEGL and libGLESv2 shipped with Firefox. But the linking fails because
objects expects __imp_* functions while functions in the dlls contains no
prefix
`pexport libEGL.dll` produces:
LIBRARY libEGL.dll
EXPORTS
eglBindAPI
eglBindTexImage
eglChooseConfig
eglCopyBuffers
...
`nm EGLExample.o` produces:
...
U ***@4
U ***@0
U ***@12
I'm a newbie in C/C++ and have encountered some problems when linking
against dlls. After some googling, I think I need some basic knowledge of
linking, object, impport, exort library ...:
1. In which circumstance will external functions be prefixed by __imp_ and
suffixed by @xxx?
2. Can I have some control over these prefixes and suffixes?
I found "extern" keyword removes the __imp_ prefix, but I just couldn't
remove @xxx suffix,
or I am just wrong
3. If __imp_ is a convention to indicate external functions imported from a
dll, how will @xxx help, and what does the number xxx mean?
I believe gcc does not know how linking will happen when compiling
source code,
thus @xxx suffixes have no use at all
I may solve my problem when I have some info on these questions, but I think
it proper to describe my situation:
I wrote some opengl es code and found it handy to just link them against
libEGL and libGLESv2 shipped with Firefox. But the linking fails because
objects expects __imp_* functions while functions in the dlls contains no
prefix
`pexport libEGL.dll` produces:
LIBRARY libEGL.dll
EXPORTS
eglBindAPI
eglBindTexImage
eglChooseConfig
eglCopyBuffers
...
`nm EGLExample.o` produces:
...
U ***@4
U ***@0
U ***@12