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 6389063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:21:27+00:00 2026-05-25T03:21:27+00:00

I am trying to take some functions that I’ve made and tested with in

  • 0

I am trying to take some functions that I’ve made and tested with in a standalone application. Now that I am trying to make a DLL I am getting a few errors stating that the function has been redefined and that the return parameters don’t match. This seems to be the only time I am getting these errors, I’ve tested it by removing this class and it compiles fine as well as the stand-alone app with a main.cpp referencing these directly. Below are the errors and the h and cpp files:

Error 7 error C2371: ‘Parser::parse’ : redefinition; different basic
types c:\users\seb\documents\visual studio
2005\projects\TestDLL\TestDLL\parser.cpp 17

Error 4 error C2526: ‘Parser::parse’ : C linkage function cannot
return C++ class ‘std::vector<_Ty>’ c:\users\seb\documents\visual
studio 2005\projects\TestDLL\TestDLL\parser.h 28

Error 6 error C2556: ‘IDVec Parser::parse(const char *)’ : overloaded
function differs only by return type from ‘void Parser::parse(const
char *)’ c:\users\seb\documents\visual studio
2005\projects\TestDLL\TestDLL\parser.cpp 17

Also find the .h file and the function from the .cpp as well:

Parser.h

#ifndef PARSER_H
#define PARSER_H

#if defined DLL_EXPORT
#define TESTAPI __declspec(dllexport)
#else
#define TESTAPI __declspec(dllimport)
#endif

#include <iostream>
#include <vector>

typedef struct _ListEntry {
    std::string id, path;
} ListEntry;

typedef std::vector<ListEntry> IDVec;

extern "C"
{
    class TESTAPI Parser
    {
    public:
        Parser(void);
        ~Parser(void);
        static IDVec parse(const char* Buffer);
    private:
        static size_t nextLine(std::string& rstrText, size_t pos);
        static std::string nextWord(std::string& rstrText, size_t pos);
        static void fixOSSpecificPath(std::string& rstrPath);
    };
}

#endif

Parser.cpp

IDVec Parser::parse(const char* Buffer) 
{

    std::string s = Buffer;
    IDVec v;

    // Doing stuff here

    return v;
}

Thanks for any advice

  • 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-25T03:21:28+00:00Added an answer on May 25, 2026 at 3:21 am

    Remove extern "C" around your class definition.

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

Sidebar

Related Questions

I am trying to re-bind some of the functions in scala.math to take and
I'm testing out some functions I made and I am trying to figure out
I am trying to implement a simple queue for functions that take callbacks. My
I am trying to take a shapefile of subdivisions within a county that I
I am trying to write a powershell script that will take in a text
I'm trying to take a python class (in IronPython), apply it to some data
I am trying to write a function that will take an xml object, an
I'm trying to take a screenshot of my Android application using Robotium, I'm using
I am trying to write some code to optimize some Open GL functions for
I'm struggling with PL/SQL functions. I'm trying to write a function which would take

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.