I am very new to c++ but i know a couple other languages (ie. python, java, a little C). The problem is when i compile my code and try to open a new ImGui window it gives a "undefined reference" error. I think it is a problem with how i the setup the files. both my main.cpp file and the imgui library are in the same directory and when i try to import the file by using "#include "imgui/imgui.h" " it still gives my the undefined reference error. I have tried to pull all the .h and .cpp files out of the imgui folder and into the same directory as my "Main.cpp" file but it still gives me a undefined reference error. I have read the install instructions where you put the .cpp files into the working directory and it still didn't work and gave me the same error. Any help would be appreciated. --------------------------------------------MyCode--------------------------------------------
#include <iostream>
using namespace std;
#include "imgui/imgui.h"
int main(){
ImGui::Begin("Window");
ImGui::End();
}
---------------------------------------------Output---------------------------------------------
/tmp/ccMXHI3r.o: In function `main':
Main.cpp:(.text+0x16): undefined reference to `ImGui::Begin(char const*, bool*, int)'
collect2: error: ld returned 1 exit status
-------------------------------my working directory-----------------------
imgui // imgui library folder that i downloaded from github
Main.cpp // my cpp file where my code is