CMake libraries in Visual Studio

Viewed 5

How can I build static (.lib) and dynamic (.dll) libraries in Visual Studio 2022 for Linux Ubuntu? Linux machine has to get .a and .so files. I wrote static library's code below.

#include "StaticLibrary.h"
 
using namespace std;
 
class RectangleArea {
public:
  double width, height;
  RectangleArea()
  {
    width = 0; height = 0;
  }
private:
  double Area()
  {
    return width * height;
  }
};

.h file:
#pragma once
 
#include <iostream>
 
class RectangleArea {
public:
  RectangleArea();
private:
  double Area();
};
0 Answers
Related