Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ : Why am i getting Linker errors?
    text
    copied!<p>Note that i am using Windows Forms Applications with the .NET </p> <p>Here is my code:</p> <pre><code>#pragma once #include &lt;cstdlib&gt; #include &lt;Windows.h&gt; #include &lt;string.h&gt; #include &lt;stdlib.h&gt; #include &lt;algorithm&gt; #include &lt;stdio.h&gt; #include &lt;string&gt; #include &lt;cstring&gt; #include &lt;iostream&gt; #include &lt;vcclr.h&gt; #include &lt;hashlibpp.h&gt; namespace Launcher { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; using namespace System::Diagnostics; using namespace MySql::Data::MySqlClient; using namespace std; using namespace System::Runtime::InteropServices; /// &lt;summary&gt; /// Summary for Form1 /// &lt;/summary&gt; public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); // //TODO: Add the constructor code here // } protected: /// &lt;summary&gt; /// Clean up any resources being used. /// &lt;/summary&gt; ~Form1() { if (components) { delete components; } } //Component properties (not important) } #pragma endregion void convert(String^ total1, char *ch){ //Converts string to const char* // Pin memory so GC can't move it while native function is called pin_ptr&lt;const wchar_t&gt; c1 = PtrToStringChars(total1); printf_s("%S\n", c1); // Conversion to char* : // Can just convert wchar_t* to char* using one of the // conversion functions such as: // WideCharToMultiByte() // wcstombs_s() // ... etc size_t convertedChars = 0; size_t sizeInBytes = ((total1-&gt;Length + 1) * 2); errno_t err = 0; ch = (char *)malloc(sizeInBytes); err = wcstombs_s(&amp;convertedChars, ch, sizeInBytes, c1, sizeInBytes); if (err != 0) printf_s("wcstombs_s failed!\n"); printf_s("%s\n", ch); } void MarshalString ( String ^ s, string&amp; os ) { //Another converter using namespace Runtime::InteropServices; const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(s)).ToPointer(); os = chars; Marshal::FreeHGlobal(IntPtr((void*)chars)); } void MarshalString ( String ^ s, wstring&amp; os ) { //Another converter using namespace Runtime::InteropServices; const wchar_t* chars = (const wchar_t*)(Marshal::StringToHGlobalUni(s)).ToPointer(); os = chars; Marshal::FreeHGlobal(IntPtr((void*)chars)); } private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { } //I removed some other functions from here because they are blank private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { //MySQL variables try{ conDataBase-&gt;Open(); myReader=cmdDataBase-&gt;ExecuteReader(); while(myReader-&gt;Read()){ String^ atmp_user = textBox1-&gt;Text; String^ user = (myReader-&gt;GetString(1));//Gets Usernames from database String^ atmp_pass = textBox2-&gt;Text; String^ pass = (myReader-&gt;GetString(2));//Gets Passwords from database atmp_pass-&gt;ToLower();//Lower Case's variable atmp_user-&gt;ToLower(); String^ total1 = gcnew String(atmp_user+atmp_pass);//Combines 2 strings string totala;//std::string MarshalString(total1, totala);//Copies data from (total1) to (totala) hashwrapper *myWrapper = new sha1wrapper();//SHA1 hashing begins string hash1 = myWrapper-&gt;getHashFromString(totala);//creates new variable(hash1) and copies data from (totala) String^ finalpass;//Creates new System::String MarshalString(finalpass, hash1);//Copies data from (hash1) to (finalpass) delete myWrapper;//Ends SHA1 hashing //Login Script if(atmp_user == user &amp;&amp; finalpass == pass){ textBox1-&gt;Text = ("It worked!"); } } } catch(Exception^ex) { MessageBox::Show(ex-&gt;Message); } } //Other blank functions created }; } </code></pre> <p>Here are the errors:</p> <pre><code>Error 4 error LNK2028: unresolved token (0A0000D5) "public: __clrcall md5wrapper::md5wrapper(void)" (??0md5wrapper@@$$FQAM@XZ) referenced in function "public: class hashwrapper * __clrcall wrapperfactory::create(enum HL_Wrappertype)" (?create@wrapperfactory@@$$FQAMPAVhashwrapper@@W4HL_Wrappertype@@@Z) C:\Users\Jeremy\Documents\Visual Studio 2010\Projects\Launcher\Launcher\hl_wrapperfactory.obj Error 3 error LNK2028: unresolved token (0A00009D) "public: __clrcall sha384wrapper::sha384wrapper(void)" (??0sha384wrapper@@$$FQAM@XZ) referenced in function "public: class hashwrapper * __clrcall wrapperfactory::create(enum HL_Wrappertype)" (?create@wrapperfactory@@$$FQAMPAVhashwrapper@@W4HL_Wrappertype@@@Z) C:\Users\Jeremy\Documents\Visual Studio 2010\Projects\Launcher\Launcher\hl_wrapperfactory.obj Error 2 error LNK2028: unresolved token (0A000094) "public: __clrcall sha512wrapper::sha512wrapper(void)" (??0sha512wrapper@@$$FQAM@XZ) referenced in function "public: class hashwrapper * __clrcall wrapperfactory::create(enum HL_Wrappertype)" (?create@wrapperfactory@@$$FQAMPAVhashwrapper@@W4HL_Wrappertype@@@Z) C:\Users\Jeremy\Documents\Visual Studio 2010\Projects\Launcher\Launcher\hl_wrapperfactory.obj Error 1 error LNK2028: unresolved token (0A00005B) "public: __clrcall sha256wrapper::sha256wrapper(void)" (??0sha256wrapper@@$$FQAM@XZ) referenced in function "public: class hashwrapper * __clrcall wrapperfactory::create(enum HL_Wrappertype)" (?create@wrapperfactory@@$$FQAMPAVhashwrapper@@W4HL_Wrappertype@@@Z) C:\Users\Jeremy\Documents\Visual Studio 2010\Projects\Launcher\Launcher\hl_wrapperfactory.obj Error 5 error LNK2019: unresolved external symbol "public: __clrcall sha512wrapper::sha512wrapper(void)" (??0sha512wrapper@@$$FQAM@XZ) referenced in function "public: class hashwrapper * __clrcall wrapperfactory::create(enum HL_Wrappertype)" (?create@wrapperfactory@@$$FQAMPAVhashwrapper@@W4HL_Wrappertype@@@Z) C:\Users\Jeremy\Documents\Visual Studio 2010\Projects\Launcher\Launcher\hl_wrapperfactory.obj Error 6 error LNK2019: unresolved external symbol "public: __clrcall sha384wrapper::sha384wrapper(void)" (??0sha384wrapper@@$$FQAM@XZ) referenced in function "public: class hashwrapper * __clrcall wrapperfactory::create(enum HL_Wrappertype)" (?create@wrapperfactory@@$$FQAMPAVhashwrapper@@W4HL_Wrappertype@@@Z) C:\Users\Jeremy\Documents\Visual Studio 2010\Projects\Launcher\Launcher\hl_wrapperfactory.obj Error 7 error LNK2019: unresolved external symbol "public: __clrcall sha256wrapper::sha256wrapper(void)" (??0sha256wrapper@@$$FQAM@XZ) referenced in function "public: class hashwrapper * __clrcall wrapperfactory::create(enum HL_Wrappertype)" (?create@wrapperfactory@@$$FQAMPAVhashwrapper@@W4HL_Wrappertype@@@Z) C:\Users\Jeremy\Documents\Visual Studio 2010\Projects\Launcher\Launcher\hl_wrapperfactory.obj Error 8 error LNK2019: unresolved external symbol "public: __clrcall md5wrapper::md5wrapper(void)" (??0md5wrapper@@$$FQAM@XZ) referenced in function "public: class hashwrapper * __clrcall wrapperfactory::create(enum HL_Wrappertype)" (?create@wrapperfactory@@$$FQAMPAVhashwrapper@@W4HL_Wrappertype@@@Z) C:\Users\Jeremy\Documents\Visual Studio 2010\Projects\Launcher\Launcher\hl_wrapperfactory.obj Error 9 error LNK1120: 8 unresolved externals C:\Users\Jeremy\Documents\Visual Studio 2010\Projects\Launcher\Debug\Launcher.exe 1 </code></pre> <p>I don't understand these so i hope you guys can. Btw i am using the hashlib++ library in this project for the SHA1 hashing. I am assuming that's why there are so many references to it. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload