Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old September 2nd, 2008, 11:37 AM
Greg Fuller
Guest
 
Posts: n/a
Default Mangled static library entry points

I'm trying to port a library originally written for unix to Windows.
After a bit of work I've finally gotten it to compile and create the
..lib

For the purposes of example, let's say the .lib contains the functions
"foo", "fooey" and "foolish". When I create a test program and try
linking it to the .lib, I get:

error LNK2001: unresolved external symbol _foo testlib.obj
error LNK2001: unresolved external symbol _fooey testlib.obj
error LNK2001: unresolved external symbol _foolish testlib.obj
etc...

Why is it putting an underscore in front of all the function names?

Thanks!
-Greg
  #2  
Old September 2nd, 2008, 12:55 PM
Pavel Minaev
Guest
 
Posts: n/a
Default Re: Mangled static library entry points

"Greg Fuller" <noemail@forspambots.comwrote in message
news:655qb4l0n48f28ud996m10h5me8hucfkp7@4ax.com...
Quote:
I'm trying to port a library originally written for unix to Windows.
After a bit of work I've finally gotten it to compile and create the
.lib
>
For the purposes of example, let's say the .lib contains the functions
"foo", "fooey" and "foolish". When I create a test program and try
linking it to the .lib, I get:
>
error LNK2001: unresolved external symbol _foo testlib.obj
error LNK2001: unresolved external symbol _fooey testlib.obj
error LNK2001: unresolved external symbol _foolish testlib.obj
etc...
>
Why is it putting an underscore in front of all the function names?
It's the standard mangling convention for "cdecl" (i.e. default calling
convention) functions, both on Unix and on Windows.


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles