Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Invalid arguments to strncpy()(Why can't Eclipse resolve library calls)
Invalid arguments to strncpy() [message #1237684] Thu, 30 January 2014 10:12 Go to next message
Charles Smith is currently offline Charles SmithFriend
Messages: 12
Registered: May 2011
Junior Member
Hi,

Eclipse (Kepler) is driving me crazy.

The code snippet (C++ perspective) below compiles but I get red squiggly line under strncpy.

char buffer[200];
char test[] = "hello world";
strncpy(buffer, test, 4);


Invalid arguments '
Candidates are:
char * strncpy(char *, const char *, ?)

Why can't eclipse resolve this. I've included the correct header files.

I get hundreds of red lines under library function calls.

Thanks in advance for any help.

[Updated on: Thu, 30 January 2014 10:16]

Report message to a moderator

Re: Invalid arguments to strncpy() [message #1239541 is a reply to message #1237684] Tue, 04 February 2014 12:20 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
I cannot reproduce this with a small test file. Did you rebuild your index?

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Invalid arguments to strncpy() [message #1239941 is a reply to message #1239541] Wed, 05 February 2014 10:59 Go to previous messageGo to next message
Charles Smith is currently offline Charles SmithFriend
Messages: 12
Registered: May 2011
Junior Member
Yes I built the index many times with no success.

I've now turned off code analysis.

Kepler seems to have more bugs than ever.

Also I noticed that even though the include paths are shown in project explorer I still get warnings that the include files can't be resolved. So what I did was to include the same include path so that it shows up twice in project explorer and that seems to resolve that issue.
Re: Invalid arguments to strncpy() [message #1240394 is a reply to message #1239941] Thu, 06 February 2014 11:02 Go to previous message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Charles Smith wrote on Wed, 05 February 2014 11:59
Yes I built the index many times with no success.

I've now turned off code analysis.

Kepler seems to have more bugs than ever.

Also I noticed that even though the include paths are shown in project explorer I still get warnings that the include files can't be resolved. So what I did was to include the same include path so that it shows up twice in project explorer and that seems to resolve that issue.

strncpy() is part of the system libraries. There should be no need to manually add include paths for system headers. So I guess your project is somehow not properly configured.
The autodiscovery is described here
http://help.eclipse.org/kepler/topic/org.eclipse.cdt.doc.user/tasks/cdt_t_sd.htm?cp=9_3_7


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:Internal error building project
Next Topic:Debugging existing executable doesn't allow to set breakpoints
Goto Forum:
  


Current Time: Fri Apr 26 06:34:08 GMT 2024

Powered by FUDForum. Page generated in 0.04562 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top