Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

using opencv with c++ .net application compilation issues

$
0
0
I didn't face any issues while linking opencv library with basic console application but when I moved to do the same in a .net framework template I got many LNK errors ![image description](/upfiles/14802349823868271.jpg) I didn't do anything strange except that I included the include and using namespace only. I appreciate any assistance provided PS: I managed to run it if I install the opencv package via NuGet but I don't wan't to use NuGet. (I tried to get frames from video but it is not working and I get an unhalded error while the same code is running with console without an issue) This is a clean Form header. Whenever I place the include tags of opencv I will not be able to compile:


include "opencv2/objdetect/objdetect.hpp"
include "opencv2/highgui/highgui.hpp"
include "opencv2/imgproc/imgproc.hpp"
include opencv2/ml.hpp
include ctime

namespace VisionApp01
{
	using namespace cv;
	using namespace cv::ml;
	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	/// 
	/// Summary for MyForm
	/// 
	public ref class MyForm : public System::Windows::Forms::Form
	{
	public:
		MyForm(void)
		{
			InitializeComponent();
			//
			//TODO: Add the constructor code here
			//
		}

	protected:
		/// 
		/// Clean up any resources being used.
		/// 
		~MyForm()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::PictureBox^  beforeBox;
	private: System::Windows::Forms::PictureBox^  afterBox;
	protected:

	protected:

	private:
		/// 
		/// Required designer variable.
		/// 
		System::ComponentModel::Container ^components;


		/// 
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// 
		void InitializeComponent(void)
		{
			this->beforeBox = (gcnew System::Windows::Forms::PictureBox());
			this->afterBox = (gcnew System::Windows::Forms::PictureBox());
			(cli::safe_cast(this->beforeBox))->BeginInit();
			(cli::safe_cast(this->afterBox))->BeginInit();
			this->SuspendLayout();
			// 
			// beforeBox
			// 
			this->beforeBox->Location = System::Drawing::Point(12, 12);
			this->beforeBox->Name = L"beforeBox";
			this->beforeBox->Size = System::Drawing::Size(300, 300);
			this->beforeBox->TabIndex = 0;
			this->beforeBox->TabStop = false;
			// 
			// afterBox
			// 
			this->afterBox->Location = System::Drawing::Point(353, 12);
			this->afterBox->Name = L"afterBox";
			this->afterBox->Size = System::Drawing::Size(300, 300);
			this->afterBox->TabIndex = 0;
			this->afterBox->TabStop = false;
			// 
			// MyForm
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(665, 330);
			this->Controls->Add(this->afterBox);
			this->Controls->Add(this->beforeBox);
			this->Name = L"MyForm";
			this->Text = L"MyForm";
			this->Load += gcnew System::EventHandler(this, &MyForm::MyForm_Load);
			(cli::safe_cast(this->beforeBox))->EndInit();
			(cli::safe_cast(this->afterBox))->EndInit();
			this->ResumeLayout(false);

		}

	private: System::Void MyForm_Load(System::Object^  sender, System::EventArgs^  e)
	{

	}
	};
}

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>