The goal is just compile that code. There is no chance with "wrong path" to header file. IDE is able easily to find header file.
Code example:
#include <fstream>
#include <vector>
#include <iostream>
#include "./sample/UniLib.h"
using namespace std;
void sleepcp(int milliseconds);
void sleepcp(int milliseconds) // Cross-platform sleep function
{
#ifdef WIN32
Sleep(milliseconds);
#else
usleep(milliseconds * 1000);
#endif // win32
}
int main(int argc, char **argv) {
printf("IP: %s\n", argv[1]);
printf("Name: %s\n", argv[2]);
void *ctx = create_context(argv[1], argv[2]);
print_unilib_version();
long int len;
char *str;
clearBuffer(&len, &str);
printf("getPrinterConfiguration: %i\n", getPrinterConfiguration(ctx, &str, &len));
sleepcp(10000);
}
function getPrinterConfiguration that is declared in UniLib.h produces the error like undefined reference to 'getPrinterConfiguration'. Generally, it looks like functions from UniLib.h are not used. Why it is possible?