title: Libcurl error in a Windows Forms Application in Visual C++ 2010 express edition
body: <p>I have used libcurl in win32 console application and it is working fine. I have followed instruction from here. <a href="http://theetrain.ca/tech/installing-curl-using-visual-studio-2010-beginners-guide/" rel="nofollow">http://theetrain.ca/tech/installing-curl-using-visual-studio-2010-beginners-guide/</a>. Now I want to use Lib curl in Windows Forms Application. But it is showing some errors.</p>
  
  <p>1>Read website app.obj : error LNK2031: unable to generate p/invoke for "extern "C" void * __clrcall curl_easy_init(void)" (?curl_easy_init@@$$J0YMPAXXZ); calling convention missing in metadata
  1>Read website app.obj : error LNK2028: unresolved token (0A000011) "extern "C" void * __clrcall curl_easy_init(void)" (?curl_easy_init@@$$J0YMPAXXZ) referenced in function "private: void __clrcall Readwebsiteapp::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@Readwebsiteapp@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
  1>Read website app.obj : error LNK2019: unresolved external symbol "extern "C" void * __clrcall curl_easy_init(void)" (?curl_easy_init@@$$J0YMPAXXZ) referenced in function "private: void __clrcall Readwebsiteapp::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@Readwebsiteapp@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
  1>C:\Documents and Settings\nemo1\my documents\visual studio 2010\Projects\Readwebsiteapp\Debug\Read website app.exe : fatal error LNK1120: 2 unresolved externals</p>
  
  <p>Please give me some advise to solve this problem. Thank you. My code is:</p>
  
  <pre><code>#define CURL_STATICLIB
  #include &lt;stdio.h&gt;
  #include &lt;curl/curl.h&gt;
  #include &lt;curl/types.h&gt;
  #include &lt;curl/easy.h&gt;
  #include &lt;string.h&gt;
  using namespace std;
  #pragma once
  namespace Readwebsiteapp {
  
      using namespace System;
      using namespace System::ComponentModel;
      using namespace System::Collections;
      using namespace System::Windows::Forms;
      using namespace System::Data;
      using namespace System::Drawing;
  
      /// &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;
              }
          }
      private: System::Windows::Forms::Button^  button1;
      protected: 
      private: System::Windows::Forms::TextBox^  textBox1;
  
      private:
          /// &lt;summary&gt;
          /// Required designer variable.
          /// &lt;/summary&gt;
          System::ComponentModel::Container ^components;
  
  #pragma region Windows Form Designer generated code
          /// &lt;summary&gt;
          /// Required method for Designer support - do not modify
          /// the contents of this method with the code editor.
          /// &lt;/summary&gt;
          void InitializeComponent(void)
          {
              this-&gt;button1 = (gcnew System::Windows::Forms::Button());
              this-&gt;textBox1 = (gcnew System::Windows::Forms::TextBox());
              this-&gt;SuspendLayout();
              // 
              // button1
              // 
              this-&gt;button1-&gt;Location = System::Drawing::Point(120, 70);
              this-&gt;button1-&gt;Name = L"button1";
              this-&gt;button1-&gt;Size = System::Drawing::Size(75, 23);
              this-&gt;button1-&gt;TabIndex = 0;
              this-&gt;button1-&gt;Text = L"button1";
              this-&gt;button1-&gt;UseVisualStyleBackColor = true;
              this-&gt;button1-&gt;Click += gcnew System::EventHandler(this, &amp;Form1::button1_Click);
              // 
              // textBox1
              // 
              this-&gt;textBox1-&gt;Location = System::Drawing::Point(120, 153);
              this-&gt;textBox1-&gt;Name = L"textBox1";
              this-&gt;textBox1-&gt;Size = System::Drawing::Size(100, 20);
              this-&gt;textBox1-&gt;TabIndex = 1;
              // 
              // Form1
              // 
              this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);
              this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
              this-&gt;ClientSize = System::Drawing::Size(420, 337);
              this-&gt;Controls-&gt;Add(this-&gt;textBox1);
              this-&gt;Controls-&gt;Add(this-&gt;button1);
              this-&gt;Name = L"Form1";
              this-&gt;Text = L"Form1";
              this-&gt;ResumeLayout(false);
              this-&gt;PerformLayout();
  
          }
  #pragma endregion
      private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e)
      {
          textBox1-&gt;Text = "hello";
  
          CURL *curl;
          CURLcode result;
  
          curl = curl_easy_init();
       }
      };
  }
  </code></pre>