string.h library and strncmp function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-06-29 03:16 PM
Hi,
I want to use strncmp function in my code [ if (strnicmp(temp, GPVTG, 5)) ], but I've got an error: &sharperror cpstm8 ..\..\src\main.c:278(12) missing prototype I have string.h file in my include files, but I think that is not enough ;], what should i do now? #rtfm- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-06-30 04:14 AM
''string.h library''
Note that string.h is a so-called ''Header'' file - it is
not
a library! In addition to the header file, you will also require the appropriate library.''#error cpstm8 ..\..\src\main.c:278(12) missing prototype''
The words seem perfectly clear & plain: the function protoype is missing; ie, not present.''I have string.h file in my include files''Have you checked that it does actually contain a prototype for the function that gives the above error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-07-01 05:08 AM
From where can i get whole library?
int strnicmp (const char* sz1, const char* sz2, size_t sizeMaxCompare); is in my header, so now i need c file with this function witch is in library?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-07-01 06:16 AM
''From where can i get whole library?''
Your compiler manuals wll tell you that.''int strnicmp (const char* sz1, const char* sz2, size_t sizeMaxCompare); is in my header''
But you said you wanted to use strncmp - not strnicmp.
''so now i need c file with this function witch is in library?'' Not necessarily. Most likely, your compiler will not provide it as a 'C' source file - but as (part of) a library. Again, you will have to study your compiler manuals for details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-07-01 09:28 AM
Okelm
Based on the error message you're getting I'm assuming that you have the Cosmic compiler. If you're using STVD I'd suggest first looking at your ''Project Settings'' and the ''General'' tab. Your toolset should be ''STM8 Cosmic'' AND you should check the ''Project specific toolset path'' box. The ''Root path'' on my system is ''C:\Program Files\COSMIC\CXSTM8'' When you do this the other path boxes should automatically fill. ''Bin path'' - Blank, ''Include path'' = ''Hstm8'' & ''Library path'' = ''Lib'' Try removing your own function prototype and include string.h again. #include <string.h> Once the correct paths are set up you shouldn't have to mess with finding the headers or libraries. STVD is pretty poorly documented & you learn these things with years of hand-to-hand combat. Have fun & good luck. jdf- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-07-02 12:53 PM
Thanks,
but after changing those paths problem still exist. I'm sending my code and errors in attached files.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-07-05 07:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-07-06 03:00 AM