Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by BarShiftGames · Aug 11, 2017 at 06:53 AM · visual studiodlldllimport

Visual studio from unity not recognizing imported c++ CLR DLL

Hello, I don't think this is a repeat question, as I'm not getting a physical error, it's just plain not letting me do something. So I have a custom-made data structure that I made a while back, (an AVL Tree as visual studio doesn't have a good one built in), and it was coded in c++ (it's verified to have none or rare memory leaks). I want to use it in unity but when I created a CLR class in visual studio 2008 and connected it with the c++ class, and plugged in the methods and such, when creating the DLL it doesn't seem to want to be referenced in the unity project I'm making. As in, I'll drag it to the assets folder and unity will do it's thing, then when I go into visual studio it doesn't recognize any new classes like "AVLTreeWrapper" or even a using statement. Dragging it into visual studio itself doesn't do anything either. Any help?

Here is the main blocks of code for the wrapper:

 // CppWrapper.h
 #ifndef AVLTREE_WRAPPER
 #define AVLTREE_WRAPPER
 
 //#pragma once
 
 #define NODE TreeNode<int>*&
 
 using namespace System;
 
 #include "C:\Users\[redacted]\Documents\Visual Studio 2017\Projects\AVLTree\AVLTree\AVLTree.h"
 #include "C:\Users\[redacted]\Documents\Visual Studio 2017\Projects\AVLTree\AVLTree\dllqueue.h"
 #include "C:\Users\[redacted]\Documents\Visual Studio 2017\Projects\AVLTree\AVLTree\TreeNode.h"
 
 #include "C:\Users\[redacted]\Documents\Visual Studio 2017\Projects\AVLTree\AVLTree\AVLTree.cpp"
 
 namespace CppWrapper {
 
     public ref class AVLTreeWrapper
     {
     public:
         AVLTreeWrapper();
         AVLTreeWrapper(int keyToInsert);
     
         ~AVLTreeWrapper();
 
         NODE Insert(int data); //for users
         NODE Insert(NODE n, int data); //for users
         NODE Insert(NODE n, int data, bool& toCheck); //the recursive algorithm
         void leftBalance(NODE n, bool& toCheck);
         void rightBalance(NODE n, bool& toCheck);
 
         void rotateLeft(NODE n);
         void rotateRight(NODE n);
 
         bool AVLDelete(int data); //if they only give the key    
         void Purge();
     
         void InOrderTraversal(TreeNode<int>& node, void(*visit)(TreeNode<int>& n));
         void PreOrderTraversal(TreeNode<int>& node, void(*visit)(TreeNode<int>& n));
         void PostOrderTraversal(TreeNode<int>& node, void(*visit)(TreeNode<int>& n));
         void BreadthFirstTraversal(TreeNode<int>& node, void(*visit)(TreeNode<int>& n));
 
         NODE retrieve(int data);
         NODE retrieve(NODE node, int data);
 
         int height();
 
     private:    
         AVLTree* treePointer;
 
         int itemCount;
         TreeNode<int>* root;
     };
 }
 
 #endif

 // CPPWrapper.cpp
 
 #include "stdafx.h"
 
 #include "CppWrapper.h"
 
 
 #include "C:\Users\[redacted]\Documents\Visual Studio 2017\Projects\AVLTree\AVLTree\dllqueue.h"
 #include "C:\Users\Wyatt\Documents\Visual Studio 2017\Projects\AVLTree\AVLTree\TreeNode.h"
 
 #include "C:\Users\[redacted]\Documents\Visual Studio 2017\Projects\AVLTree\AVLTree\AVLTree.h"
 #include "C:\Users\[redacted]\Documents\Visual Studio 2017\Projects\AVLTree\AVLTree\AVLTree.cpp"
 
 CppWrapper::AVLTreeWrapper::AVLTreeWrapper()
 {
     treePointer = new AVLTree();
 }
 
 CppWrapper::AVLTreeWrapper::AVLTreeWrapper(int keyToInsert)
 {
     treePointer = new AVLTree(keyToInsert);
 }
 
 CppWrapper::AVLTreeWrapper::~AVLTreeWrapper()
 {
     treePointer->Purge();
     delete treePointer;
 }
 
 NODE CppWrapper::AVLTreeWrapper::Insert(int data)
 {
     return treePointer->Insert(data);
 }
 
 NODE CppWrapper::AVLTreeWrapper::Insert(NODE n, int data)
 {
     return treePointer->Insert(n, data);
 }
 
 NODE CppWrapper::AVLTreeWrapper::Insert(NODE n, int data, bool & toCheck)
 {
     return treePointer->Insert(n, data, toCheck);
 }
 
 void CppWrapper::AVLTreeWrapper::leftBalance(NODE n, bool & toCheck)
 {
     treePointer->leftBalance(n, toCheck);
 }
 
 void CppWrapper::AVLTreeWrapper::rightBalance(NODE n, bool & toCheck)
 {
     treePointer->rightBalance(n, toCheck);
 }
 
 void CppWrapper::AVLTreeWrapper::rotateLeft(NODE n)
 {
     treePointer->rotateLeft(n);
 }
 
 void CppWrapper::AVLTreeWrapper::rotateRight(NODE n)
 {
     treePointer->rotateRight(n);
 }
 
 bool CppWrapper::AVLTreeWrapper::AVLDelete(int data)
 {
     return treePointer->AVLDelete(data);
 }
 
 void CppWrapper::AVLTreeWrapper::Purge()
 {
     treePointer->Purge();
 }
 
 void CppWrapper::AVLTreeWrapper::InOrderTraversal(TreeNode<int>& node, void(*visit)(TreeNode<int>&n))
 {
     treePointer->InOrderTraversal(node, visit);
 }
 
 void CppWrapper::AVLTreeWrapper::PreOrderTraversal(TreeNode<int>& node, void(*visit)(TreeNode<int>&n))
 {
     treePointer->PreOrderTraversal(node, visit);
 }
 
 void CppWrapper::AVLTreeWrapper::PostOrderTraversal(TreeNode<int>& node, void(*visit)(TreeNode<int>&n))
 {
     treePointer->PostOrderTraversal(node, visit);
 }
 
 void CppWrapper::AVLTreeWrapper::BreadthFirstTraversal(TreeNode<int>& node, void(*visit)(TreeNode<int>&n))
 {
     treePointer->BreadthFirstTraversal(node, visit);
 }
 
 NODE CppWrapper::AVLTreeWrapper::retrieve(int data)
 {
     return treePointer->retrieve(data);
 }
 
 NODE CppWrapper::AVLTreeWrapper::retrieve(NODE node, int data)
 {
     return treePointer->retrieve(node, data);
 }
 
 int CppWrapper::AVLTreeWrapper::height()
 {
     return treePointer->height();
 }
 

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by BarShiftGames · Aug 22, 2017 at 06:27 PM

Hello? No one? It got moved to moderation for no reason, it says 'contact a system administrator" but how am I supposed to do that? Now that it's out, it doesn't get placed as a new question, it just places the question at the time of when it was originally submitted, so no one will ever see it. Lovely.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

109 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

EmguCV 'Assets/Plugins/Emgu.CV.UI.dll' will not be loaded due to errors... 0 Answers

Importing external DLLs to satisfy AssetBundle MonoBehaviour references 0 Answers

using Google.Protobuf & ZeroMQ 0 Answers

I upgraded to Unity 2019.3.7 from 2018.4.0. Firebase cannot found dll. Below is the error which appears on pressing Play button. 0 Answers

Removing Stubborn Dependencies in Visual Studio 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges