|
-
Jan 1st, 2003, 04:12 PM
#1
Thread Starter
<?="Moderator"?>
static libraries
im trying to make a *simple* static library with only one function inside it. all it does it multiply two numbers together and thats it. now when i compile the .lib file there are no errrors and theres nothing wrong. When i include the header file with another project (header file has been copyed to the same directory) it gives me these error.
uselibtest error LNK2019: unresolved external symbol "double __stdcall multnum(double,double)" (?multnum@@YGNNN@Z) referenced in function _main
uselibtest fatal error LNK1120: 1 unresolved externals
any ideas whats wrong?
Cheers
-
Jan 1st, 2003, 04:31 PM
#2
Monday Morning Lunatic
Did you move the .lib file to somewhere in the compiler's library path? Also you need to tell it to link against that library.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 1st, 2003, 04:35 PM
#3
Thread Starter
<?="Moderator"?>
Originally posted by parksie
Also you need to tell it to link against that library.
how do i do that?
Cheers
-
Jan 1st, 2003, 04:37 PM
#4
Monday Morning Lunatic
For VC++, go to Project Settings, then the Linker tab. Add the filename of the .lib file to the list
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 1st, 2003, 04:57 PM
#5
Thread Starter
<?="Moderator"?>
do u know where it is in VC++ 7, because i cant find it?
-
Jan 1st, 2003, 08:04 PM
#6
Right-click the project in the solution explorere, select properties.
Go to Linker->Input and add the name to the additional dependencies.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 2nd, 2003, 08:26 AM
#7
Thread Starter
<?="Moderator"?>
okay, i can only get to the linker part when the project congiuration is set as .DLL and im trying to make a .LIB???
-
Jan 2nd, 2003, 08:28 AM
#8
Monday Morning Lunatic
No, you've *made* the .lib already. You need to add it to the linker settings for the DLL or program you're creating. A .lib file doesn't go through the linker, therefore no Linker settings.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|