I'm pulling all my code from my instructor that should be compiling but it seems that my library file is not being linked correctly so the file runs as undefined.
My main file runs in src and looks like this with a lot of unused include statements after the # include <Lib.h> statement.
#include <iostream>
#include <Lib.h>
#include "Lib.h"
#include "../include/Lib.h"
//#include "../lib/libalgos-win.a"
using namespace std;
int main() {
//you must change/expand this code
int n = 20;
//Lib guy = new Lib();
Lib::algorithmA(n);
cout << "Successful execution" <<endl;
return 0;
}
My Lib.h file looks like the following
#ifndef LIBRARY_LIB_H
#define LIBRARY_LIB_H
class Lib {
public:
static void algorithmA(const int& n);
static void algorithmB(const int& n);
static void algorithmC(const int& n);
};
#endif //LIBRARY_LIB_H
In my Cmake file I have the following code:
target_link_libraries(a2-program "${PROJECT_SOURCE_DIR}/lib/libalgos-win.a")
This should, in theory, link the library file to the library I have in lib but instead, I'm getting an error about the reference not being defined. He didn't give more instructions on how to edit the code so I'm completely lost.