You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am on Windows 10 and last VS code + MSYS2 env. I cloned this repo and created a main.cpp file as advised and attempted to compile it in VS code (using VS compiler):
olcPixelGameEngine.h:4212:17: error: ‘glDeviceContext_t’ does not name a type
4212 | glDeviceContext_t glDeviceContext = 0;
Considering that VS code is one of the most popular C++ dev environments it would be very useful to explain how to compile this using VS code.
The text was updated successfully, but these errors were encountered:
fabriziotappero
changed the title
Compile with clang or (msys) g++ in VS code does not seem to work
Compile with clang or (msys2) g++ in VS code does not seem to work
Dec 27, 2022
Hello,
I am on Windows 10 and last VS code + MSYS2 env. I cloned this repo and created a main.cpp file as advised and attempted to compile it in VS code (using VS compiler):
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\x64\bin\clang++.exe" -fcolor-diagnostics -fansi-escape-codes -std=c++17 -g C:\CODE\TRYME\main.cpp -o C:\CODE\TRYME\main.exe
The first error is:
error: use of undeclared identifier 'dbuffer'; did you mean 'dfbuffer'?
vFiles.push_back(std::string(dbuffer));
changing it to:
vFiles.push_back(std::string(dfbuffer));
might fix this problem (not sure) but led to more errors
main-5c57b5.o : error LNK2019: unresolved external symbol __imp_DragAcceptFiles referenced in function "public: virtual enum olc::rcode __cdecl olc::Platform_Windows::CreateWindowPane(struct olc::v2d_generic const &,struct olc::v2d_generic &,bool)" (?CreateWindowPane@Platform_Windows@olc@@UEAA?AW4rcode@2@AEBU?$v2d_generic@H@2@AEAU42@_N@Z)
main-5c57b5.o : error LNK2019: unresolved external symbol __imp_DragQueryFileA referenced in function "public: static __int64 cdecl olc::Platform_Windows::olc_WindowEvent(struct HWND *,unsigned int,unsigned __int64,int64)" (?olc_WindowEvent@Platform_Windows@olc@@SA_JPEAUHWND@@I_K_J@Z)
main-5c57b5.o : error LNK2019: unresolved external symbol __imp_DragQueryPoint referenced in function "public: static __int64 cdecl olc::Platform_Windows::olc_WindowEvent(struct HWND *,unsigned int,unsigned __int64,int64)" (?olc_WindowEvent@Platform_Windows@olc@@SA_JPEAUHWND@@I_K_J@Z)
main-5c57b5.o : error LNK2019: unresolved external symbol __imp_DragFinish referenced in function "public: static __int64 cdecl olc::Platform_Windows::olc_WindowEvent(struct HWND *,unsigned int,unsigned __int64,int64)" (?olc_WindowEvent@Platform_Windows@olc@@SA_JPEAUHWND@@I_K_J@Z)
C:\CODE\TRYME\main.exe : fatal error LNK1120: 4 unresolved externals
clang++: error: linker command failed with exit code 1120 (use -v to see invocation)
Any idea how to fix it? I shall also add that compiling it (as advised) with msys2 g++ like this:
C:\msys64\usr\bin\g++.exe -fdiagnostics-color=always -luser32 -lgdi32 -lopengl32 -lgdiplus -lShlwapi -ldwmapi -lstdc++fs -static -std=c++17 C:\CODE\TRYME\main.cpp -o C:\CODE\TRYME\main.exe
leads to tons of errors like this one
olcPixelGameEngine.h:4212:17: error: ‘glDeviceContext_t’ does not name a type
4212 | glDeviceContext_t glDeviceContext = 0;
Considering that VS code is one of the most popular C++ dev environments it would be very useful to explain how to compile this using VS code.
The text was updated successfully, but these errors were encountered: