Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22295

Undefined references with static variables in qMin and GCC in WSL

$
0
0

This code:

test.h

#ifndef H__#define H__struct test{    static const int some_variable = 10;};#endif

main.cpp

#include <QtGlobal>#include "test.h"int main (void){    qMin(test::some_variable, 11);}

Compile without problem with MSVC2015 on Windows 10, but it fail with GCC 8.3 on WSL 1 and get undefined reference to test::some_variable. Qt version is 5.12.1 on WSL 1 and 5.13.1 on Windows 10. What is the problem ?


Viewing all articles
Browse latest Browse all 22295

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>