How to find the library name give a system include file

F

Franky

I have a cpp program that use to compile in C++6 but gives a bunch of
errors in VS2005

Error 12 error LNK2019: unresolved external symbol _strstr referenced in
function "char * __cdecl strstr(char *,char const *)"
(?strstr@@YAPADPADPBD@Z) AnnGame.obj

I'm wondering if I'm missing a library or two.

If I look up strstr I find I need <string.h> which I have.

But in the doc I can't seen to learn what library is needed.

Can you tell me how to find the library name give a system include file?


thanks
 
D

David Lowndes

I have a cpp program that use to compile in C++6 but gives a bunch of
errors in VS2005

Error 12 error LNK2019: unresolved external symbol _strstr referenced in
function "char * __cdecl strstr(char *,char const *)"
(?strstr@@YAPADPADPBD@Z) AnnGame.obj

That error looks a bit odd. Do you have your own function named strstr
in module AnnGame?
I'm wondering if I'm missing a library or two.

I think that the library containing strstr would be a standard one
depending on the compiler run-time model you've used. You shouldn't
need to explicitly specify it unless you're using the NODEFAULTLIB
switch.

You don't by any chance have a path to the VC6 libraries that's
causing the linker to pick up the old libraries before the new ones?

Merry Christmas
Dave
 
F

Franky

David Lowndes said:
That error looks a bit odd. Do you have your own function named strstr
in module AnnGame?

No. I checked
I think that the library containing strstr would be a standard one
depending on the compiler run-time model you've used. You shouldn't
need to explicitly specify it unless you're using the NODEFAULTLIB
switch.

You don't by any chance have a path to the VC6 libraries that's
causing the linker to pick up the old libraries before the new ones?

Property Pages for the project:
Configuration Properties/ Linker/ Command Line::
/OUT:".\Release/AnnGame.exe" /INCREMENTAL:NO /NOLOGO /MANIFEST
/MANIFESTFILE:".\Release\AnnGame.exe.intermediate.manifest"
/NODEFAULTLIB:"LIBCMT.LIB" /PDB:".\Release/AnnGame.pdb" /SUBSYSTEM:WINDOWS
/MACHINE:X86 /ERRORREPORT:pROMPT odbc32.lib odbccp32.lib comctl32.lib
htmlhelp.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
odbc32.lib odbccp32.lib

I see the NODEFAULTLIB:"LIBCMT.LIB" but don't know how to remove it. I
can't edit it in the property pages.
Merry Christmas
Dave

same to you and thanks
 
D

David Lowndes

I see the NODEFAULTLIB:"LIBCMT.LIB" but don't know how to remove it. I
can't edit it in the property pages.

Is it not showing in the Linker, Input, Ignore Specific Library entry?

If you click the ... for that item, does it show up in the inherited
values? If it's in the inherited values, is it defined in a property
manger setting?

Merry Christmas
Dave
 
F

Franky

Thanks, you were correct, it was the NODEFAULTLIB. Under
"linker/input/ignore library" was a reference to LIBCMT.LIB which resulted
in NODEFAULTLIB:"LIBCMT.LIB" being on the Command line entry. Removing
LIBCMT.LIB from the ignore library removed NODEFAULTLIB:"LIBCMT.LIB" from
the Command line display.
thanks again for the help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top