Please add instruction how to run samples
Closed this issue · 3 comments
repl-shenoy-sukumaran commented
Can you please give some instruction how to run samples e.g. Demo? Sorry i am new to C++ cmake etc
i have cloned the repo and tried within folder samples\Demo
cmake -Bbuildme
success. buildme folder is generatedcmake --build buildme --config Release
- error C1083: Cannot open include file: 'plog/Log.h': No such file or directory [C:\Workspaces\plog\samples\Demo\buildme\Demo.vcxproj]
Do we need to copy the include/plog
manually somewhere?
paule32 commented
Hi,
you don't need cmake. PLOG is logging comes with header only usage.
So, you only need to give the path to plog/include with the g++ Option -I
source code (test.cc):
// -----------------------------------------------------------------
// standard header stuff ...
// -----------------------------------------------------------------
# include <stdio.h>
# include <stdlib.h> // for _countof
# include <string.h> // for strcpy_s
// -----------------------------------------------------------------
// c++ header prototype's/signature's:
// -----------------------------------------------------------------
# include <iostream> // std c++ signatures
# include <string>
# include <cstdlib>
# include <cstring>
// -----------------------------------------------------------------
// loggin specified header files ...
// -----------------------------------------------------------------
# include <plog/Log.h>
# include <plog/Initializers/RollingFileInitializer.h>
namespace plog;
namespace std;
int main(int argc, char **argv)
{
// ----------------------------------
// initialize logging stuff ...
// ----------------------------------
plog::init(plog::debug, "app.log");
PLOGI << "start application";;
return EXIT_SUCCESS;
}
console:
g++ -O2 -std=c++20 -Wno-write-strings -I../plog/include -o test.exe test.cc -L. -lz
SergiusTheBest commented
@repl-shenoy-sukumaran Oh, you need to run cmake from the root folder and not from the samples\Demo
. It will build the samples by default.
repl-shenoy-sukumaran commented
Thank you :)