Skip to content
Advertisement

Tag: c++11

CMake linking glfw3 lib error

i’m working with CLion, and I’m writing a program using the glfw3 lib.(http://www.glfw.org/docs/latest/) I installed and did everything correctly for the lib i have the .a and .h files in: I’m trying to use the library now, but i’m getting the linker error: undefined reference to ‘glViewport’ etc. etc. all the functions i’m using I added the lib path to

Unable to link openssl libraries to CLion C++ program

I have a CLion project. Here is my CMakeLists.txt: And here is error that I get: Answer Maybe you should try link_libraries(ssl) instead of link_libraries(openssl), if you’re sure of openssl installed on your local machine. See https://wiki.openssl.org/index.php/Libcrypto_API , it says that “OpenSSL provides two primary libraries: libssl and libcrypto.”. To fix your issue just add to your CMakeList.txt:

dynamic linker error with rand() function

I already asked a question about this before but with reference to the following code again Why does compiling this result in the following error Why would this happen? How does the linker know that this is just another rand() function I have declared myself but rather an existing version of rand()? Answer One of your header files (<iostream> in

An implicit try {} catch around main

In each of my main functions, I would like to catch certain classes of exceptions and convert them to exit codes. Is there a more elegant solution to this than starting and ending each main function with macros that will paste the implicit try {} catch I want? Can I somehow achieve this with the std::set_terminate functionality? Example: Answer A

Can’t compile C++ program on Ubuntu

I used OSX to program in C++, but I am new to C++ compiler on Linux. I have a program consisting two .cpp files and one .h file that are compiled and run successfully on my Mac, but get compiling errors on Ubuntu. I did install gcc and g++ compilers and build-essential, and also apt-get update and update, searched online,

Advertisement