Проблема с явным подключением библиотекиC++

Программы на C++. Форум разработчиков
Ответить
Гость
 Проблема с явным подключением библиотеки

Сообщение Гость »


Я написал динамическую библиотеку

Код: Выделить всё

libsort.so
and connected it implicitly. Then I connected it explicitly through the keyboard. After compiling, I got the error

Код: Выделить всё

undefined symbol
. The file

Код: Выделить всё

sort.cpp
and are the sources of the dynamic library,

Код: Выделить всё

example.cpp
this is the program that I have connected the library to.

Код: Выделить всё

// sort.cpp
#include 
#include 

void merge(int array[], int const left, int const mid, int const right) {
int const subArrayOne = mid - left + 1;
int const subArrayTwo = right - mid;

auto *leftArray = new int[subArrayOne], *rightArray = new int[subArrayTwo];

for (auto i = 0; i < subArrayOne; i++)
leftArray[i] = array[left + i];
for (auto j = 0; j < subArrayTwo; j++)
rightArray[j] = array[mid + 1 + j];

auto indexOfSubArrayOne = 0, indexOfSubArrayTwo = 0;
int indexOfMergedArray = left;

while (indexOfSubArrayOne < subArrayOne && indexOfSubArrayTwo < subArrayTwo) {
if (leftArray[indexOfSubArrayOne] = end)
return;

int mid = begin + (end - begin) / 2;
mergeSort(array, begin, mid);
mergeSort(array, mid + 1, end);
merge(array, begin, mid, end);
}

void printArray(int A[], int size) {
for (int i = 0; i < size; i++)
std::cout 

Источник: [url]https://stackoverflow.com/questions/78130737/the-problem-with-explicitly-linking-the-library[/url]
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C++»