Created
March 3, 2016 15:35
-
-
Save daviddoria/0debb957378d22ee4690 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "AbstractPoint.h" | |
//BOOST_CLASS_EXPORT_IMPLEMENT(AbstractPoint) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef ABSTRACT_POINT_H | |
#define ABSTRACT_POINT_H | |
class AbstractPoint | |
{ | |
public: | |
virtual ~AbstractPoint(){} | |
virtual void DoSomething() = 0; | |
}; | |
//BOOST_SERIALIZATION_ASSUME_ABSTRACT(AbstractPoint) | |
//BOOST_CLASS_EXPORT_KEY(AbstractPoint) | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.6) | |
Project(Linking) | |
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11") | |
add_custom_target(projectHeaders SOURCES AbstractPoint.h Point.h Library.h) | |
# Either of the following lines are ok | |
add_library(TestLib Library.cpp AbstractPoint.cpp Point.cpp) | |
ADD_EXECUTABLE(TestExe Linking.cpp) | |
#ADD_EXECUTABLE(TestExe Linking.cpp AbstractPoint.cpp Point.cpp) | |
target_link_libraries(TestExe TestLib) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Library.h" | |
#include <iostream> | |
#include "Point.h" | |
void LibraryFunction() | |
{ | |
std::cout << "LibraryFunction()" << std::endl; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef LIBRARY_H | |
#define LIBRARY_H | |
void LibraryFunction(); | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "Library.h" | |
#include "Point.h" | |
int main() | |
{ | |
LibraryFunction(); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Point.h" | |
//BOOST_CLASS_EXPORT_IMPLEMENT(Point) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef POINT_H | |
#define POINT_H | |
#include "AbstractPoint.h" | |
class Point : public AbstractPoint | |
{ | |
public: | |
Point() = default; | |
Point(const double data) : mData(data) {} | |
void DoSomething(){} | |
double mData; | |
}; | |
//BOOST_CLASS_EXPORT_KEY(Point) | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment