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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:57:11+00:00 2026-05-28T04:57:11+00:00

I want to write a dll for an api of a device. since i

  • 0

I want to write a dll for an api of a device. since i am new to dlls i wanted to implement it on a simple text editor and then make one for the api.
I have made header file and cpp file but when i run the code i get error lnk2001 followed by lnk1120 which is unresolved external error.

I really have no idea where did i make a mistake, as far as i see i did it the right way. i was wondering if you guys could help me out. tnx.

here is my header file

// EditFuncsDll.h
#include <cstdio>
#include <vector>
#include <string>

namespace EditFuncs
{
    class MyEditFuncs
{
private:
    static std::vector<std::string> MyTextBox;

public:
    static __declspec(dllexport) void Load(std::string command);
    static __declspec(dllexport) void Save(std::string command);
    static __declspec(dllexport) int Lines();
    static __declspec(dllexport) void Add(std::string command);
    static __declspec(dllexport) void Remove(std::string command);
    static __declspec(dllexport) void Insert(std::string command);
    static __declspec(dllexport) int wc(std::string command);
    static __declspec(dllexport) void GetInfo();
};
}

and in my cpp file i just define the functions i declared in header file.

and these are the errors i get

Error 25 error LNK2001: unresolved external symbol “private: static class std::vector,class std::allocator >,class std::allocator,class std::allocator > > > EditFuncs::MyEditFuncs::MyTextBox” (?MyTextBox@MyEditFuncs@EditFuncs@@0V?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@A) C:\Users\Lucy\Desktop\Erfan\Text_Editor_DLL\Text_Editor_DLL\EditFuncsDll.obj Text_Editor_DLL

and

Error 26 error LNK1120: 1 unresolved externals C:\Users\Lucy\Desktop\Erfan\Text_Editor_DLL\Debug\Text_Editor_DLL.dll Text_Editor_DLL

  • 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-28T04:57:11+00:00Added an answer on May 28, 2026 at 4:57 am

    The head of your cpp should be like this :

        #include "EditFuncsDll.h"
    #include <iostream>
    #include <fstream>
     using namespace std;
     namespace EditFuncs 
     { 
         std::vector<std::string> EditFuncs::MyEditFuncs::MyTextBox;  
         void MyEditFuncs::Load(string command) 
         { 
            string filename; // The name of the file starts at the fifth character of the command and goes to the end 
            filename = command.substr(5,command.size()); 
            ifstream inFile;
            inFile.open(filename);
            .
            .
            .
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to write a c++ dll that read certificate from my USB device
I want to write nuspec for MEF plugin. I can copy xxx.dll to content
I want to use Microsoft.Office.Interop.Excel dll to write the data into excel sheet. I
I want write a simple query which will fetch data from a table (which
I want to write a wrap for a DLL file, in this case for
I want to write a Delphi function to register a dll. I want the
I have a signed applet and I want to write out dll files which
I want to write a batch file that updates a DLL that is in
I want to debug one api call of dll? It is written in C
I want to use dll from ssdeep ( http://ssdeep.sourceforge.net/ ). The API is: int

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.