warning messages

I got the following Link warning messages:

Linking...
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4049: locally defined symbol "_strrchr" imported
LINK : warning LNK4049: locally defined symbol "_strstr" imported
LINK : warning LNK4049: locally defined symbol "_malloc" imported

I would like to know what the possible reasons cause these warning messages and how to let them go away.

Thanks.
yc_ycAsked:
Who is Participating?
 
Kent OlsenConnect With a Mentor Data Warehouse Architect / DBACommented:

Some warning messages can be safely ignored, others indicate a serious problem.  Often times, the same message may point out a trivial problem in one application and a serious problem in another.

The only real help will be experience.  Knowing what an error message means and if/how to deal with the issue.

Many compilers let you choose the level of warning message that is displayed.  You might investigate the options on your compiler.

Good Luck,
Kent
0
 
Kent OlsenData Warehouse Architect / DBACommented:

Offhand, it looks like you've created functions for strrchr(), strstr(), and malloc() in your code and the linker is trying to link the modules from the library, too.


Kent
0
 
WoodsterCommented:
I have had this occur before and I did not declare my own functions.  If you go to the project settings / options window there will  (should) be an option to include default libraries.  Uncheck this box and recompile and see if that resolves the problem.
0
Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

 
yc_ycAuthor Commented:
In project settings / options, ignore libraries: libc.lib. After doing this, the warning message LNK4098 gone. I use a library module developed by other persons, which may be the reason to get rest of warning messages.

I would like to know how a programmer should treat the warning messages usually? Is it ok to ignore some warning messages for unknown reasons or unsolvable?

Thanks.

0
 
yc_ycAuthor Commented:
The compiler I used is the Microsoft Visual C++ 6.0, the warning level setting is: level 3.

I want to know how to chose the warning level usually? Is the higher the warning level, the better to compile the program?

I change the warning level to 4, and recompile the same program. Then warning messages more than 800, does this make sense?

Thanks.
0
 
Kent OlsenData Warehouse Architect / DBACommented:
Sure.

You're probably getting warnings on things like recasting, superfluous &, ANSI violations, and other things that you can ignore.

Level 3 is a pretty good at selecting "general purpose" warning.  Things that you probably need to be aware of, but aren't necessarily fatal to your program.


Kent
0
All Courses

From novice to tech pro — start learning today.