Created
April 8, 2016 12:07
Star
You must be signed in to star a gist
mkdir build
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 <stdio.h> | |
#include "SomeFunctions.h" | |
#include "Car.h" | |
void Car::print() { | |
printf("Car::print()\n"); | |
test_function(); | |
} |
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 CAR_H | |
#define CAR_H | |
class Car { | |
public: | |
void print(); | |
}; | |
#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.8) | |
project(PluginTest) | |
add_library(Transportation STATIC Car.cpp SomeFunctions.c) | |
add_library(Plugin MODULE Plugin.cpp) | |
target_link_libraries(Plugin Transportation) |
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 <stdio.h> | |
#include <stdlib.h> | |
int main() { | |
printf("Test with Plugin.\n"); | |
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 <stdio.h> | |
#include "Plugin.h" | |
#include "Car.h" | |
void plugin_init() { | |
printf("plugin_init().\n"); | |
Car car; | |
car.print(); | |
} | |
void plugin_update() { | |
printf("plugin_update().\n"); | |
} |
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 PLUGIN_H | |
#define PLUGIN_H | |
#if defined(__cplusplus) | |
extern "C" { | |
#endif | |
void plugin_init(); | |
void plugin_update(); | |
#if defined(__cplusplus) | |
} | |
#endif | |
#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 <stdio.h> | |
void test_function() { | |
printf("test function.\n"); | |
} |
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 SOME_FUNCTIONS_H | |
#define SOME_FUNCTIONS_H | |
void test_function(); | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment