Skip to content

Instantly share code, notes, and snippets.

@msmoiz

msmoiz/main.cpp

Created Apr 13, 2021
Embed
What would you like to do?
Source and header files accompanying the Unrealistic.dev post on complex C++ compilation from the command line.
#include "static.h"
#include "shared.h"
#include <iostream>
void local_hello()
{
std::cout << "Hello local world!" << std::endl;
}
int main()
{
local_hello();
static_hello();
shared_hello();
}
#include "shared.h"
#include <iostream>
void shared_hello()
{
std::cout << "Hello shared world!" << std::endl;
}
#pragma once
#ifdef _WIN32
#ifdef EXPORTING
#define SHARED_API __declspec(dllexport)
#else
#define SHARED_API __declspec(dllimport)
#endif
#else
#define SHARED_API
#endif
SHARED_API void shared_hello();
#include "static.h"
#include <iostream>
void static_hello()
{
std::cout << "Hello static world!" << std::endl;
}
#pragma once
void static_hello();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment