Click here to Skip to main content
14,768,148 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CeratingNameePipe Server Application Using C++ Classes Pin
Victor Nijegorodov15-Feb-19 15:18
MemberVictor Nijegorodov15-Feb-19 15:18 
AnswerRe: CeratingNameePipe Server Application Using C++ Classes Pin
Richard MacCutchan15-Feb-19 4:18
mveRichard MacCutchan15-Feb-19 4:18 
GeneralRe: CeratingNameePipe Server Application Using C++ Classes Pin
Member 1271142615-Feb-19 5:55
MemberMember 1271142615-Feb-19 5:55 
QuestionWants guidance. Pin
Member 1415146015-Feb-19 0:46
MemberMember 1415146015-Feb-19 0:46 
AnswerRe: Wants guidance. Pin
CPallini15-Feb-19 2:45
mveCPallini15-Feb-19 2:45 
QuestionSelected Row while updating in CListCtrl in MFC Pin
Anu_Bala13-Feb-19 23:29
MemberAnu_Bala13-Feb-19 23:29 
AnswerRe: Selected Row while updating in CListCtrl in MFC Pin
Victor Nijegorodov14-Feb-19 2:24
MemberVictor Nijegorodov14-Feb-19 2:24 
QuestionHow to resolve: error LNK2001: unresolved external symbol "public: static void * Pin
mlong3013-Feb-19 21:10
Membermlong3013-Feb-19 21: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 22:34
MemberVictor Nijegorodov13-Feb-19 22:34 
AnswerRe: How to resolve: error LNK2001: unresolved external symbol "public: static void * Pin
CPallini13-Feb-19 22:40
mveCPallini13-Feb-19 22:40 
QuestionRe: How to resolve: error LNK2001: unresolved external symbol "public: static void * Pin
Richard MacCutchan13-Feb-19 22:43
mveRichard MacCutchan13-Feb-19 22:43 
AnswerRe: How to resolve: error LNK2001: unresolved external symbol "public: static void * Pin
Davie2124014-Feb-19 6:02
MemberDavie2124014-Feb-19 6:02 
QuestionOverriding problem Pin
NoviceEx10-Feb-19 8:02
MemberNoviceEx10-Feb-19 8:02 
AnswerRe: Overriding problem Pin
Richard Andrew x6410-Feb-19 13:34
professionalRichard Andrew x6410-Feb-19 13:34 
GeneralRe: Overriding problem Pin
NoviceEx10-Feb-19 20:47
MemberNoviceEx10-Feb-19 20:47 
AnswerRe: Overriding problem Pin
CPallini10-Feb-19 22:07
mveCPallini10-Feb-19 22:07 
GeneralRe: Overriding problem Pin
Davie2124014-Feb-19 6:03
MemberDavie2124014-Feb-19 6:03 
QuestionUsing OpenMP - #of CPU or # of threads ? Pin
Vaclav_8-Feb-19 11:19
MemberVaclav_8-Feb-19 11:19 
AnswerRe: Using OpenMP - #of CPU or # of threads ? Pin
leon de boer8-Feb-19 22:35
Memberleon de boer8-Feb-19 22:35 
AnswerRe: Using OpenMP - #of CPU or # of threads ? Pin
Richard MacCutchan8-Feb-19 23:36
mveRichard MacCutchan8-Feb-19 23:36 
GeneralRe: Using OpenMP - #of CPU or # of threads ? Pin
Vaclav_9-Feb-19 5:14
MemberVaclav_9-Feb-19 5:14 
GeneralRe: Using OpenMP - #of CPU or # of threads ? Pin
Richard MacCutchan9-Feb-19 7:40
mveRichard MacCutchan9-Feb-19 7:40 
GeneralRe: Using OpenMP - #of CPU or # of threads ? Pin
Vaclav_9-Feb-19 8:17
MemberVaclav_9-Feb-19 8:17 
GeneralRe: Using OpenMP - #of CPU or # of threads ? Pin
k50549-Feb-19 9:20
mvek50549-Feb-19 9:20 
GeneralRe: Using OpenMP - #of CPU or # of threads ? Pin
k50549-Feb-19 9:38
mvek50549-Feb-19 9: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.