Qt, Linker error: can not find IGL [duplicate] - c++

This question already has answers here:
Qt debian/ubuntu: Can't compile, error: cannot find -lGL
(2 answers)
Closed 7 years ago.
When I try to compile the HelloWorld widget application in Qt, I get the following error:
/usr/bin/ld: cannot find -lGL
I searched in the Internet but could not find what is the name of the package that contains this library.
I use ubuntu and have essential build tools installed on my PC.

basically you should look for libGL (libGL.so). But the package to install depends on your graphics card
For nvida it is nvidia-331-updates (newer or older ones will also work)

Related

Error when using VScode with g++-11 compiler for C++ code on macOS Monterey v12.6 Apple M1 chip [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 days ago.
Improve this question
I have installed VScode for a C++ course and the course insists on the gcc-c++ version 11 compiler. I have downloaded VScode, and used homebrew to download the compiler using the command
brew install gcc#11
and also xcode command line tools using the command
xcode-select --install.
I am slightly unsure exactly where the compiler has been installed as I was expecting it to be installed in the directory /usr/local/bin/g++-11, however, I believe that on the Apple M1 chip it is actually installed in the directory /opt/homebrew/bin/g++-11 (although I'm really not sure). I therefore set the default compiler path in VScode to be /opt/homebrew/bin/g++-11.
When I try to run build task I get an error:
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/lib/libSystem.tbd' for architecture arm64
collect2: error: ld returned 1 exit status
which I am totally baffled by and have no idea even where to start with debugging it.
I have tried a clean uninstall of VScode as well as the command line tools and compiler and then reinstalling all but I get the same error.
Has anyone else encountered similar problems?
Edit: I have solved the issue.
If you check which linker (ld) you are using with
which ld
I found that my environment was pointing towards one in a conda space as this had a higher priority in my $PATH and does not work (I'm not quite sure about why this is exactly). To solve this I made the linker in /usr/bin/ld highest priority by adding
export PATH=/usr/local/bin:$PATH
to the end of my .bash_profile hidden file in my home directory.
This file is hidden in the home directory so you should be able to view it with the command
ls -a
and then edit it using a text editor e.g I just used
vim .bash_profile
You will need to restart your bash shell for the changes to take effect.

CMake Error: No CMAKE_RC_COMPILER could be found

I have installed Windows on a virtual machine to debug a game i'm developing primarily on Linux (I haven't used Windows since i was 9 years old). I use CMake to build it, and i have installed LLVM+CLang for compiling. CMake complains about a missing "RC Compiler" which i cannot find to install anywhere on the web. The error thrown is "No CMAKE_RC_COMPILER could be found." What should I do?

ld warning in mac terminal using skm and c++ compiler

I’ve been getting this warning when using the Mac terminal and skm library to compile a simple hello world program in C++. I’m new to this so not really sure what to do.
ld: warning: dylib (/Users/chriscommon/.splashkit/lib/macos/libSplashKit.dylib) was built for newer macOS version (10.15.4) than being linked (10.15)
ld: warning: object file (/Users/chriscommon/.splashkit/clang++/lib/macos/libSplashKitCpp.a(splashkit.cpp.o)) was built for newer macOS version (10.15.4) than being linked (10.15)
ld: warning: object file (/Users/chriscommon/.splashkit/clang++/lib/macos/libSplashKitCpp.a(adapter_type_mapper.cpp.o)) was built for newer macOS version (10.15.4) than being linked (10.15)
Does anyone know if there is some way I can resolve this so it links to the correct version? I’m running macOS10.15.7 and have tried to update skm, reinstall Xcode command line tools etc and the program works ultimately but the warnings appear each time I compile.
Try to add this flag to Xcode when you build your program:
-mmacosx-version-min=11.0

Project ERROR: Unknown module(s) in QT: charts on Mac [duplicate]

This question already has answers here:
How to install a missing Qt module?
(3 answers)
Closed 4 years ago.
I am trying to deploy a local app, but the when I tried to do the qmake in terminal under the app folder directory, it has the error
Project ERROR: Unknown module(s) in QT: charts
I have the qt chart installed in when I ran the QT installer, and I also have included
QT += charts
in the .pro file, I checked Project ERROR: Unknown module(s) in QT: charts and Project ERROR: Unknown module(s) in QT: multimedia but I don't know how to apply that in osx.
Thanks
This post solved it for me. Basically, open MaintenanceTool.app in your Qt install folder, go to the version of Qt you have installed, expand it, and select charts (and anything else you want installed, but don't have installed).

Stanford Engineering Everywhere CS106B C++ Libraries in XCode 4.6.2

Like many others, I'm taking the CS106B class on iTunes and, although the class is old, I am attempting to use the Stanford C++ libraries that are current. They are found here: http://www.stanford.edu/class/cs106b/.
During the Build Phase of projects, I have inserted into "Link Binary with Libraries" the files "random.h" and "libStanfordCPPlib.a". When I do this, I get the following error messages:
Check dependencies
warning: skipping file '/Users/lewis/Documents/Think Like a Programmer/CS106/VotingSimulation/../../../Programming Abstractions/Assignment 1/Assignment1-xcode/0 - Warmup/StanfordCPPLib/random.h' (unexpected file type 'sourcecode.c.h' in Frameworks & Libraries build phase)
ld: warning: ignoring file /Users/lewis/Documents/Programming Abstractions/Assignment 1/Assignment1-xcode/0 - Warmup/StanfordCPPLib/libStanfordCPPLib.a, file was built for archive which is not the architecture being linked (x86_64): /Users/lewis/Documents/Programming Abstractions/Assignment 1/Assignment1-xcode/0 - Warmup/StanfordCPPLib/libStanfordCPPLib.a
Undefined symbols for architecture x86_64:
"randomChance(double)", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am using Mac OS X 10.7.5 and XCode 4.6.2. I have set the Build Settings Base SDK to OS X 10.7 for both the Project and the Target.
It appears to me that the "libStanfordCPPlib.a" file may be an archive file that I have to unarchive before I can link the implementation code for the header files. Is this what I need to do, and if so, how do I do it? Am I doing something else wrong in linking the files?
I'm a noob and I'd appreciate help from anyone who has been successful in getting the current Stanford CS106B C++ libraries to work in XCode 4.6.2.
I just ran into this problem myself after upgrading to the newest version of xcode (ver. 5.0, OSX ver. 10.8.5).
Try switching the architecture of the project to 32-bit Intel (i386). The default is "Standard Architectures 64-bit Intel (x86_64)".
I'm currently using xcode 6.4 and trying to work through the cs 106b course work, I had the same issue of not being able to run the sample files and assignment files (can be found here btw http://web.stanford.edu/class/archive/cs/cs106b/cs106b.1136/ ). After changing the Architectures for both the Project and Target to 32-bit-intel as listed above I still received errors. I had to take the additional step of changing the OSX deployment target from 10.10 to 10.8 under the Project info.
This allowed the program to build but I received a notification that i needed to install the Java Runtime Environment, and there was no consult output. Installing this did not resolve the issue. I was only able to fully execute the code after installing the Java Development Kit. I am now able to compile all files for the course.
I hope this update helps more recent attempts to access this info.
I hope you've found an answer to your problem by now, but as I was suffering from a similar problem, trying to get xcode 5.1 to compile Warmup.cpp, I thought I'd post my solution for those others trying to get xcode to work with the cs106b libraries.
After struggling with xcode 5.1.1 and 5.0.2, I downloaded xcode 4.6.3 off of the apple dev site, www.developer.apple.com, and trashed the later versions. After installing 4.6.3, I still got errors, but after switching the Architecures for the Project and for the Target, to "32-bit-Intel", as messysaurus suggests, the warmupp.cpp compiled fine. Trying this same technique with xcode 5.1.1 and 5.0.2 yielded no results.
Hope this helps anyone else running into problems.