Lets say you have the following class.
Do i also need to export the transform and tag variables? Or __declspec only reference to methods and functions?Code:#pragma once #include <iostream> #include <vector> //-_-_-_-_-_-Class Declerations-_-_-_-_-_-// class Renderer; class Brain; class Transform; //-_-_-_-_-_-Class Declerations-_-_-_-_-_-// class Sprite { //Public Members. public: Transform *transform; std::string tag; //Private Members. private: std::vector<Brain *> m_brains; //Public Methods. public: //Constructor. __decspec(dllexport) Sprite(std::string imagePath, glm::vec2 position = glm::vec2(0.0f, 0.0f), std::string tag = ""); //Deconstructor. __decspec(dllexport) ~Sprite(); //Private Methods. private: //Render Method. __decspec(dllexport) void Render(Renderer *rednerer); };
The reason I'm not putting __declspec before the class name but I manually place it in each method is because i get a link warning
for the std::string tag .I searched on google and they say that you should not export std::base_string templates because they are
already exported. So i tried to fix that by manually choosing which method i want to export.
Also does it make sense to export private Methods?




Reply With Quote
