Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working in eclipse Indigo IDE with MINGW installed .But when i am trying to call string functions like strlen(),strcmp(),its gives an error as:-Description Resource Path Location Type
Function 'strlen' could not be resolved dir.cpp /dir/src line 73 Semantic Error

Please help me resolve it.
Thank You.
Posted
Updated 6-Nov-11 22:21pm
v2
Comments
Mohibur Rashid 7-Nov-11 4:35am    
make sure you have included string.h and also make sure your compiler knows the path for library
Abhinay Kumar 7-Nov-11 4:39am    
i have included string.h and the compiler sure knows the path of library as it was building earlier ok.
Richard MacCutchan 7-Nov-11 5:14am    
Post the code (use Improve question)around line 73 of your source file dir.cpp so we can see exactly what you are doing.

Solved.Earlier it was #include <string>
i changed it to #include <string.h>
 
Share this answer
 
v3
strlen is defined in libc.a
It should be done automatically, but make sure -lc is in the command line for the linker. I am not familiar with Eclipse for C++, but there is probably a project properties somewhere. Add -lc into the Additional Libraries setting.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900