Skip to content

Commit dd0b458

Browse files
johnsonshihnuclearsandwich
authored andcommitted
add missing export variable (#102)
Add CLASS_LOADER_PUBLIC to ClassLoader::has_unmananged_instance_been_created_ or it won't build on Windows
1 parent 0ee5281 commit dd0b458

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ set(${PROJECT_NAME}_HDRS
5656
include/class_loader/multi_library_class_loader.hpp
5757
include/class_loader/register_macro.hpp
5858
)
59-
add_library(${PROJECT_NAME} ${${PROJECT_NAME}_SRCS} ${${PROJECT_NAME}_HDRS})
59+
if(WIN32)
60+
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SRCS} ${${PROJECT_NAME}_HDRS})
61+
else()
62+
add_library(${PROJECT_NAME} ${${PROJECT_NAME}_SRCS} ${${PROJECT_NAME}_HDRS})
63+
endif()
64+
6065
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} ${console_bridge_LIBRARIES} ${Poco_LIBRARIES})
6166
if(WIN32)
6267
# Causes the visibility macros to use dllexport rather than dllimport

include/class_loader/class_loader.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ class ClassLoader
330330
boost::recursive_mutex load_ref_count_mutex_;
331331
int plugin_ref_count_;
332332
boost::recursive_mutex plugin_ref_count_mutex_;
333+
334+
CLASS_LOADER_PUBLIC
333335
static bool has_unmananged_instance_been_created_;
334336
};
335337

include/class_loader/meta_object.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
#define CLASS_LOADER__META_OBJECT_HPP_
3737

3838
#include <console_bridge/console.h>
39+
#include "class_loader/visibility_control.hpp"
40+
3941
#include <typeinfo>
4042
#include <string>
4143
#include <vector>
@@ -54,7 +56,7 @@ typedef std::vector<class_loader::ClassLoader *> ClassLoaderVector;
5456
* @class AbstractMetaObjectBase
5557
* @brief A base class for MetaObjects that excludes a polymorphic type parameter. Subclasses are class templates though.
5658
*/
57-
class AbstractMetaObjectBase
59+
class CLASS_LOADER_PUBLIC AbstractMetaObjectBase
5860
{
5961
public:
6062
/**

0 commit comments

Comments
 (0)