Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6809645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:06:38+00:00 2026-05-26T20:06:38+00:00

I’ve making a shared library (cross-platform), but when trying to compile the Windows build

  • 0

I’ve making a shared library (cross-platform), but when trying to compile the Windows build I’m encountering the error:

secure_string.h(43) : error C2059: syntax error : ‘type’

This is in regards to the SECURESTRING_API macro. It doesn’t complain about the two usages in strlcpy and strlcat, but when trying to use it for ‘str_from_last’ it generates the above error.
If I remove it, it compiles fine, but the function then isn’t exported from the DLL, making it quite useless!

A Google search has yielded no (relevant) results; has anyone encountered this before? I’ve tested on both Visual Studio 2008 and 2010, and the result is identical. The source file includes string.h and then this file – nothing else.

Header file:

#ifndef SECURE_STRING_H
#define SECURE_STRING_H


/* Provide MS Builds with import/export functionality
 * BUILD_SECURE_STRING should be added to project preprocessor macros */
#if _WIN32
#   if defined(BUILD_SECURE_STRING)
#       define SECURESTRING_API __declspec(dllexport)
#   else
#       define SECURESTRING_API __declspec(dllimport)
#   endif
#else
#   define SECURESTRING_API
#endif


/* Windows on the whole, and glibc do not have/support strlc[at|py]
 * This will almost certainly need revision for proper cross-platform checks */
#if _WIN32 || __GLIBC__ || !defined(HAVE_STRLCPY)
    size_t SECURESTRING_API strlcat(char* dst, const char* src, size_t size);
    size_t SECURESTRING_API strlcpy(char* dst, const char* src, size_t size);
#else
#   define HAVE_STRLCPY     1
#endif


/* In case the active project has yet to include headers for 'BOOL' */
#ifndef BOOL
#   define BOOL     int
#   define TRUE     1
#   define FALSE    0
#endif


/*
 | Locates 'search' within 'source', and if found, returns either the
 | character itself, or the character after it if 'return_from_after_found'
 | is TRUE.
 | If it is not found, or any parameter is invalid, a NULL pointer is returned.
 */
char* SECURESTRING_API
    str_from_last(char* source,
                  char search,
                  BOOL return_from_after_found);



#endif  /* SECURE_STRING_H */
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:06:39+00:00Added an answer on May 26, 2026 at 8:06 pm
    #if _WIN32
    

    Are you sure you’re entering this? I would:

    #if defined(WIN32)
    

    EDIT: That looks OK but this I think is it:
    move the SECURESTRING_API before the return type (char*):

    SECURESTRING_API char*
    

    With this change your code compiles for me under VS2010 and MSDN confirms that is the required order:

    The decl-specifier-seq should contain, among other things, a base type
    (e.g. int, float, a typedef, or a class name), a storage class (e.g.
    static, extern), or the __declspec extension. The init-declarator-list
    should contain, among other things, the pointer part of
    declarations.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.