x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

fatal error LNK1120 and LNK2019

I have the errors LNK2019 and LNK1120 when I build my cpp.(Include a thirdpaty)I don't know how to fix these errors and hope, that someone can help me.

HalfEdge.h

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #pragma once
 
 #include "CoreMinimal.h"
 #include "Components/ActorComponent.h"
 #include"glm/HalfEdgeMesh/HalfEdgeMesh.h"
 #include "HalfEdge.generated.h"
 
 
 UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
 class TESTBLUEWRITE_API UHalfEdge : public UActorComponent
 {
     GENERATED_BODY()
 
 public:    
     // Sets default values for this component's properties
     UHalfEdge();
 
 protected:
     // Called when the game starts
     virtual void BeginPlay() override;
 
 public:    
     // Called every frame
     virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
 
         
 public:
     UPROPERTY(BlueprintReadWrite)
         TArray<FVector> vetices;
     UPROPERTY(BlueprintReadWrite)
         TArray<int> Triangles;
     UPROPERTY(BlueprintReadWrite)
         TArray<FVector> normals;
 
 
     
 
     void init();
     glm::vec3 transfromFvectovec(FVector vector);
     TArray<glm::vec3> vecvetices;
 };


halfedge.cpp

 #include "HalfEdge.h"
 
 
 // Sets default values for this component's properties
 UHalfEdge::UHalfEdge()
 {
     // Set this component to be initialized when the game starts, and to be ticked every frame.  You can turn these features
     // off to improve performance if you don't need them.
     PrimaryComponentTick.bCanEverTick = true;
 
     // ...
 }
 
 
 // Called when the game starts
 void UHalfEdge::BeginPlay()
 {
     Super::BeginPlay();
 
     // ...
     
 }
 
 
 // Called every frame
 void UHalfEdge::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
 {
     Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
 
     // ...
 }
 
 void UHalfEdge::init()
 {
     HalfEdgeMesh mesh;
     /*if (vetices.Num() <= 3)
         return;
     for (TArray<FVector>::TIterator it = vetices.CreateIterator(); it; ++it)
     {
         glm::vec3 tempvec3 = transfromFvectovec(*it);
         vecvetices.Push(tempvec3);
     }
     for (TArray<glm::vec3>::TIterator it = vecvetices.CreateIterator(); it; ++it)
     {
         mesh.CreateVertex(*it);
     }
     if (Triangles.Num() <= 3)
         return;
     for (TArray<int>::TIterator it = Triangles.CreateIterator(); it; )
     {
         std::vector<VertexHandle> vecprimitive;
         vecprimitive.push_back(long(*it));
         vecprimitive.push_back(long(*(it+1)));
         vecprimitive.push_back(long(*(it+2)));
         mesh.AddFace(vecprimitive);
 
 
 
 
         it += 3;
     }*/
 }
 
 glm::vec3 UHalfEdge::transfromFvectovec(FVector vector)
 {
     float x = vector.X;
     float y = vector.Y;
     float z = vector.Z;
     float a[3] = { x,y,z };
     glm::vec3 vec(x, y, z);
     return vec;
 }
 
 


halfedgemesh.h:`#ifndef __BuildingSketcher_HalfEdgeMesh #define BuildingSketcherHalfEdgeMesh_ #include #include #include "MeshVertex.h" #include "MeshHalfEdge.h" #include "MeshEdge.h" #include "MeshFace.h"

include "Iterators/FaceHalfEdgeIterator.h"

include "Iterators/FaceIterator.h" #include "Iterators/VertexIterator.h" #include "Iterators/FaceVertexIterator.h" #include "Iterators/EdgeIterator.h"

typedef long VertexHandle; typedef long HalfVertexHandle; typedef long EdgeHandle; typedef long HalfEdgeHandle; typedef long FaceHandle;

class HalfEdgeMesh{ public: struct EdgeKey{ VertexHandle v1; VertexHandle v2; }; private: / Next Available Handles */ VertexHandle mNextVertex; HalfEdgeHandle mNextHalfEdge; EdgeHandle mNextEdge; FaceHandle mNextFace;

 /* **********
  * Elements *
  * *********/
 MeshVertex      **mVertices;
 VertexHandle    mNumVerts;
 VertexHandle    mVertsCapacity;
 
 MeshHalfEdge    **mHalfEdges;
 HalfEdgeHandle  mNumHalfEdges;
 HalfEdgeHandle  mHalfEdgeCapacity;
 
 MeshEdge        **mEdges;
 EdgeHandle      mNumEdges;
 EdgeHandle      mEdgeCapacity;
 
 MeshFace        **mFaces;
 FaceHandle      mNumFaces;
 FaceHandle      mFaceCapacity;
 
 /* *****************************
  * Hash tables for performance *
  * ****************************/
 std::map<EdgeKey, EdgeHandle> mEdgeTable;

public:

 /* ****************************
  * Construction & Destruction *
  * ***************************/
 HalfEdgeMesh(VertexHandle nVertices = 8, EdgeHandle nEdges = 12, FaceHandle nFaces = 6);
 ~HalfEdgeMesh();
 
 /* *******************
  * Mesh Manipulation *
  * ******************/
 VertexHandle CreateVertex(glm::vec3 vertex);
 void DeleteVertex(const VertexHandle& vHandle);
 FaceHandle AddFace(std::vector<VertexHandle> vertices);
 void DeleteFace(const FaceHandle& fHandle);
 void DeleteEdge(const EdgeHandle& eHandle);
 void Clear();
 
 // TODO: Refactor to be removed
 void UpdateIndexInformation();
 
 /* ***********
  * Accessors *
  * **********/
 MeshVertex* GetVertex(const VertexHandle &vh ) { return mVertices[vh]; };
 MeshFace* GetFace(const FaceHandle &fHandle) { return mFaces[fHandle]; };
 VertexHandle GetNumberVertices() const { return mNumVerts; };
 HalfEdgeMesh GetNumberHalfEdges() const { return mNumHalfEdges; };
 EdgeHandle  GetNumberEdges() const { return mNumEdges; }
 FaceHandle GetNumberFaces() const { return mNumFaces; }
 
 
 /* ***************
  * Stream Output *
  * **************/
 friend std::ostream& operator<< (std::ostream& o, const HalfEdgeMesh& mesh);
 
 /* ***********
  * Iterators *
  * **********/
 friend class FaceHalfEdgeIterator;
 FaceHalfEdgeIterator FaceEdgeBegin(const FaceHandle &face);
 FaceHalfEdgeIterator FaceEdgeLast(const FaceHandle &face);
 
 friend class VertexIterator;
 VertexIterator VerticesBegin();
 VertexIterator VerticesLast();
 
 friend class FaceIterator;
 FaceIterator FacesBegin();
 FaceIterator FacesEnd();
 
 friend class FaceVertexIterator;
 FaceVertexIterator FaceVertexBegin(const FaceHandle &face);
 FaceVertexIterator FaceVertexEnd(const FaceHandle &face);
 
 friend class EdgeIterator;
 EdgeIterator EdgeBegin();
 
 friend class MeshFace;

private: void findOrCreateEdge(HalfEdgeHandle heHandle);

 HalfEdgeHandle createHalfEdge(const VertexHandle& source, const VertexHandle& target);
 
 /* *********************
  * Next Handle Updates *
  * ********************/
 void increaseNextVertex();
 void increaseNextHalfEdge();
 void increaseNextEdge();
 void increaseNextFace();
 void freeVertex(const VertexHandle& vHandle);
 void freeHalfEdge(const HalfEdgeHandle& heHandle);
 void freeEdge(const EdgeHandle& eHandle);
 void freeFace(const FaceHandle& fHandle);
 
 /* *******************
  * Alocation Methods *
  * ******************/
 void allocateVerticesIfNeeded(const VertexHandle& vHandle);
 void allocateHalfEdgesIfNeeded(const HalfEdgeHandle& heHandle);
 void allocateEdgesIfNeeded(const EdgeHandle& eHandle);
 void allocateFacesIfNeeded(const FaceHandle& fHandle);

};

bool operator==(const HalfEdgeMesh::EdgeKey& ek1, const HalfEdgeMesh::EdgeKey& ek2); bool operator<(const HalfEdgeMesh::EdgeKey& ek1, const HalfEdgeMesh::EdgeKey& ek2); #else typedef long VertexHandle; typedef long EdgeHandle; typedef long HalfEdgeHandle; typedef long FaceHandle;

class HalfEdgeMesh; #endif / defined(__BuildingSketcher_HalfEdgeMesh_) /

Product Version: UE 4.16
Tags:
more ▼

asked Apr 13 '18 at 09:10 AM in C++ Programming

avatar image

Ricardolo
6 1 1 3

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question