Click here to Skip to main content
15,888,802 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CeratingNameePipe Server Application Using C++ Classes Pin
Victor Nijegorodov15-Feb-19 14:18
Victor Nijegorodov15-Feb-19 14:18 
AnswerRe: CeratingNameePipe Server Application Using C++ Classes Pin
Richard MacCutchan15-Feb-19 3:18
mveRichard MacCutchan15-Feb-19 3:18 
GeneralRe: CeratingNameePipe Server Application Using C++ Classes Pin
Member 1271142615-Feb-19 4:55
Member 1271142615-Feb-19 4:55 
QuestionWants guidance. Pin
Member 1415146014-Feb-19 23:46
Member 1415146014-Feb-19 23:46 
AnswerRe: Wants guidance. Pin
CPallini15-Feb-19 1:45
mveCPallini15-Feb-19 1:45 
QuestionSelected Row while updating in CListCtrl in MFC Pin
Anu_Bala13-Feb-19 22:29
Anu_Bala13-Feb-19 22:29 
AnswerRe: Selected Row while updating in CListCtrl in MFC Pin
Victor Nijegorodov14-Feb-19 1:24
Victor Nijegorodov14-Feb-19 1:24 
QuestionHow to resolve: error LNK2001: unresolved external symbol "public: static void * Pin
mlong3013-Feb-19 20:10
mlong3013-Feb-19 20:10 
Hi All,

I'm trying to create a C++ DLL using the WinInet API, but for some odd reason, I get no errors during compiling but get external link errors regarding variables within my class. Any idea how I can resolve this? Visual Studio 2015.



----------------------------------------header test.h -------------------------------------------
// #include "stdafx.h"
using namespace std;
// #include <Winineti.h>
#include <windows.h>
#include <strsafe.h>
#include <wininet.h>
#include <math.h>
#include <cstring>
#include <WinInet.h>
//#include <string>
#pragma comment(lib, "wininet.lib")
#pragma comment(lib, "user32.lib")
#define  FTP_FUNCTIONS_BUFFER_SIZE          MAX_PATH+8


namespace Win32_FTP
{
        class FTP_Win32_ClientV1
        {
        private:


        public:
                        static LPCWSTR sFileSearch;
                        static char * sIpAddress;
                        static  LPCWSTR sUsername;
                        static LPCWSTR sPassword;
                        static string sRemoteDir;
                        static string sLocalDir;
                        static string sFilename;
                        static DWORD dwError;
                        static HINTERNET hFTPConnect;
                        static HINTERNET hFind;
                        static HINTERNET hConnect;

                        static HANDLE hFile;
                        static WIN32_FIND_DATA   FindFileData;
                        static string strTemp;


                static  __declspec(dllexport) void Test1();
                static  __declspec(dllexport) void FtpCloseConnection();

        };
}


----------------------------------------source test.cpp -------------------------------------------

//using namespace std;
#include <iostream>
#include "test.h"
// using namespace std;


namespace Win32_FTP
{


        void FTP_Win32_Client::Test1()
        {
                cout << "This is a test from Cplus to Csharp DLL";
        }


        void FTP_Win32_Client::FtpCloseConnection()
        {

                InternetCloseHandle(FTP_Win32_Client::hFind);
                InternetCloseHandle(FTP_Win32_Client::hFTPConnect);
                InternetCloseHandle(FTP_Win32_Client::hConnect);
        }

}



***************************LINK ERRORS ************************
Test.obj : error LNK2001: unresolved external symbol "public: static void * Win32_FTP::FTP_Win32_Client::hFTPConnect" (?hFTPConnect@FTP_Win32_Client@Win32_FTP@@2PAXA)

Test.obj : error LNK2001: unresolved external symbol "public: static void * Win32_FTP::FTP_Win32_Client::hFind" (?hFind@FTP_Win32_Client@Win32_FTP@@2PAXA)

Test.obj : error LNK2001: unresolved external symbol "public: static void * Win32_FTP::FTP_Win32_Client::hConnect" (?hConnect@FTP_Win32_Client@Win32_FTP@@2PAXA)

AnswerRe: How to resolve: error LNK2001: unresolved external symbol "public: static void * Pin
Victor Nijegorodov13-Feb-19 21:34
Victor Nijegorodov13-Feb-19 21:34 
AnswerRe: How to resolve: error LNK2001: unresolved external symbol "public: static void * Pin
CPallini13-Feb-19 21:40
mveCPallini13-Feb-19 21:40 
QuestionRe: How to resolve: error LNK2001: unresolved external symbol "public: static void * Pin
Richard MacCutchan13-Feb-19 21:43
mveRichard MacCutchan13-Feb-19 21:43 
AnswerRe: How to resolve: error LNK2001: unresolved external symbol "public: static void * Pin
Davie2124014-Feb-19 5:02
Davie2124014-Feb-19 5:02 
QuestionOverriding problem Pin
NoviceEx10-Feb-19 7:02
NoviceEx10-Feb-19 7:02 
AnswerRe: Overriding problem Pin
Richard Andrew x6410-Feb-19 12:34
professionalRichard Andrew x6410-Feb-19 12:34 
GeneralRe: Overriding problem Pin
NoviceEx10-Feb-19 19:47
NoviceEx10-Feb-19 19:47 
AnswerRe: Overriding problem Pin
CPallini10-Feb-19 21:07
mveCPallini10-Feb-19 21:07 
GeneralRe: Overriding problem Pin
Davie2124014-Feb-19 5:03
Davie2124014-Feb-19 5:03 
QuestionUsing OpenMP - #of CPU or # of threads ? Pin
Vaclav_8-Feb-19 10:19
Vaclav_8-Feb-19 10:19 
AnswerRe: Using OpenMP - #of CPU or # of threads ? Pin
leon de boer8-Feb-19 21:35
leon de boer8-Feb-19 21:35 
AnswerRe: Using OpenMP - #of CPU or # of threads ? Pin
Richard MacCutchan8-Feb-19 22:36
mveRichard MacCutchan8-Feb-19 22:36 
GeneralRe: Using OpenMP - #of CPU or # of threads ? Pin
Vaclav_9-Feb-19 4:14
Vaclav_9-Feb-19 4:14 
GeneralRe: Using OpenMP - #of CPU or # of threads ? Pin
Richard MacCutchan9-Feb-19 6:40
mveRichard MacCutchan9-Feb-19 6:40 
GeneralRe: Using OpenMP - #of CPU or # of threads ? Pin
Vaclav_9-Feb-19 7:17
Vaclav_9-Feb-19 7:17 
GeneralRe: Using OpenMP - #of CPU or # of threads ? Pin
k50549-Feb-19 8:20
mvek50549-Feb-19 8:20 
GeneralRe: Using OpenMP - #of CPU or # of threads ? Pin
k50549-Feb-19 8:38
mvek50549-Feb-19 8:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.