I've got a very simple piece of code that runs prefectly on Window's visual studio but doesn't on Linux (g++).
I get the following error on Linux:
1 2 3 4 5
/usr/bin/ld: ../builds/Debug-x86_64/engine/libengine.a(app.o): in function `std::_MakeUniq<Engine::Profiler>::__single_object std::make_unique<Engine::Profiler>()':
/usr/include/c++/9/bits/unique_ptr.h:857: undefined reference to `Engine::Profiler::Profiler()'
/usr/bin/ld: ../builds/Debug-x86_64/engine/libengine.a(app.o): in function `std::default_delete<Engine::Profiler>::operator()(Engine::Profiler*) const':
/usr/include/c++/9/bits/unique_ptr.h:81: undefined reference to `Engine::Profiler::~Profiler()'
Again it works on Windows, but not sure what I'm doing wrong with G++. By the way, I'm using C++17 and make_unique works with another class I got on Linux, but not this Profiler class in particular.
I'll share the code below. Thanks for reading, hope this makes sense.
any chance its just the order of your includes? Visual studio, in my experience, sometimes handles includes in a more friendly way that it strictly should, breaking things if you move off the platform.
Hey Jonnin! Thanks for the quick reply. You mean in the profiler class? I could try switching them around, but is it possible it works on Visual Studio and not linux?