Difference between constexpr and static constexpr global variable

In your current example there is no difference: On variable declarations, constexpr implies const, and a const variable at namespace scope has internal linkage by default (so adding static does not change anything). In C++14, you cannot declare a variable as constexpr and have it have external linkage unless you only ever do this in … Read more

What does mean for a name or type to have a certain language linkage?

Language linkage is the term used for linkage between C++ and non-C++ code fragments. Typically, in a C++ program, all function names, function types and even variable names have the default C++ language linkage. A C++ object code can be linked to another object code which is produced using some other source language (like C) … Read more

Static functions declared in “C” header files

First I’d like to clarify my understanding of the situation you describe: The header contains (only) a static function declaration while the C file contains the definition, i.e. the function’s source code. For example some.h: static void f(); // potentially more declarations some.c: #include “some.h” static void f() { printf(“Hello world\n”); } // more code, … Read more

What are ld-linux.so.2 and linux-gate.so.1?

I hope that you’re not asking about the main entries, which are stating that for the requested library libm.so.6 it was found in the file /lib/libm.so.6, for example, but are asking about the two outliers. Why are they displayed differently? for linux-gate.so.1 it’s because it’s not actually a file on-disk – it’s exposed by the … Read more

About inconsistent dll linkage

The purpose of the preprocessor statements: #ifdef _GUICTRLS #define GUI_CTRLS_EXPORT __declspec(dllexport) #else #define GUI_CTRLS_EXPORT __declspec(dllimport) #endif is to make sure that the header file declares the class or function as __declspec(dllexport) in the .dll where it is defined, and as __declspec(dllimport) for any other .dll that might want to use it. For this to work, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)