Category : linker

I am having problems with my linking stage. I am using asio and std::thread. My problem is that when I try to link my compiled sources I get the following error from ld: /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.so: undefined reference to `pthread_create’ /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.so: undefined reference to `pthread_join’ /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.so: undefined reference to `pthread_detach’ collect2: error: ld returned 1 exit status ..

Read more

I am trying to link a header file which has a class defined in it and a .cpp file that has the actual functions of that class to my main cpp file but I’m getting this error c++ DataMembers.cpp -o DataMembers Undefined symbols for architecture x86_64: "Cat::eat()", referenced from: _main in DataMembers-053507.o "Cat::meow()", referenced from: ..

Read more

I’m trying to use precompiled headers for the first time. Using command line. Here is it: cl /Yu"pch.h" src/main.cpp src/shader.cpp src/camera.cpp /std:c++17 /MT -EHsc glfw3.lib glew32.lib GlU32.lib OpenGL32.lib -I include /link "pch.obj" /LIBPATH:"C:UsersyuryiDesktopC++CMDOGLlib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /OUT:"C:UsersuserDesktopC++CMDOGLa.exe" /MACHINE:X64 /nologo But it prints: pch.obj : LNK2011: precompiled ..

Read more

Im getting this error: mingw32-make: Circular square.o <- square.o dependency dropped. g++ -o main.exe square.o application.cpp -DGLEW_STATIC -LC:Codinglib -IC:\CodingLearn-OpenGLinclude -lglfw3 -lglew32 -lgdi32 -lopengl32 c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: square.o:square.cpp:(.text+0xf): undefined reference to `_imp____glewGenBuffers’ c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: square.o:square.cpp:(.text+0x2a): undefined reference to `_imp____glewGenBuffers’ c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: square.o:square.cpp:(.text+0x45): undefined reference to `_imp____glewBindBuffer’ c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: square.o:square.cpp:(.text+0x62): undefined reference to `_imp____glewBindBuffer’ c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: square.o:square.cpp:(.text+0x7f): undefined reference to `_imp____glewBufferData’ c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: square.o:square.cpp:(.text+0xaf): ..

Read more

I have installed libraries with vcpkg using the correct triplet : C:Users***>vcpkg list libnoise libnoise:x64-windows 1.0.0 A general-purpose library that generates three-d… Then I have executed the following command : C:Users***>vcpkg integrate install Applied user-wide integration for this vcpkg root. All MSBuild C++ projects can now #include any installed libraries. Linking will be handled automatically. ..

Read more