Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - RE: std::shared_future failed in C++: (7 Items)
   
RE: std::shared_future failed in C++  
Which C++ library are you linking against? You can check that with 

# readelf -d ./testPromise

Is the code you built identical to the example?
________________________________________
From: Ilyas Hamadouche [community-noreply@qnx.com]
Sent: October-25-18 6:01 AM
To: ostech-core_os
Subject: Re: RE: std::shared_future failed in C++

Thank you for response Elad. It actually builds, but when running it stuck at fut2.wait();

The output of  "pidin -p 1200146 -v" is:

     pid        tid name                  prio STATE          Blocked
 1200146   1 ./testPromise       10r CONDVAR     (0x806c17c)
 1200146   2 ./testPromise       10r CONDVAR     (0x806c0bc)
 1200146   3 ./testPromise       10r MUTEX          (0x1002b2790) self(1200146)-02 #1


My QNX version (using uname -a):
QNX localhost 7.0.1 2018/02/06-14:30:25EST x86pc x86_64

Ilyas,



_______________________________________________

OSTech
http://community.qnx.com/sf/go/post119236
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
Re: RE: std::shared_future failed in C++  
I don't have readelf, but running "ldd ./testPromise" gives the following:
	libsocket.so.3 => /lib/libsocket.so.3 (0x2b5000)
	libstdc++.so.6 => /lib/libstdc++.so.6.0.21 (0x4f7000)
	libm.so.3 => /proc/boot/libm.so.3 (0x893000)
	libc.so.4 => /usr/lib/ldqnx-64.so.2 (0x0)

I use the same code, just with some printing.

Ilyas,
RE: RE: std::shared_future failed in C++  
Try linking with libc++.so instead. That's what my executable is linked to and it works.
________________________________________
From: Ilyas Hamadouche [community-noreply@qnx.com]
Sent: October-25-18 7:04 AM
To: ostech-core_os
Subject: Re: RE: std::shared_future failed in C++

I don't have readelf, but running "ldd ./testPromise" gives the following:
        libsocket.so.3 => /lib/libsocket.so.3 (0x2b5000)
        libstdc++.so.6 => /lib/libstdc++.so.6.0.21 (0x4f7000)
        libm.so.3 => /proc/boot/libm.so.3 (0x893000)
        libc.so.4 => /usr/lib/ldqnx-64.so.2 (0x0)

I use the same code, just with some printing.

Ilyas,



_______________________________________________

OSTech
http://community.qnx.com/sf/go/post119238
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
Re: RE: RE: std::shared_future failed in C++  
I am using the command:
QCC -V5.4.0,gcc_ntox86_64_gpp test_promise.cpp -o testPromise -std=gnu++14

I am not sure how to link libc++.so instead
RE: std::shared_future failed in C++  
Try specifying -std=c++11 (or -std=c++14) instead of -std=gnu++14.

--Elad

(And why do email clients keep adding "RE:"s and "Re:"s to every
reply?)

On Thu, 2018-10-25 at 07:59 -0400, Ilyas Hamadouche wrote:
> I am using the command:
> QCC -V5.4.0,gcc_ntox86_64_gpp test_promise.cpp -o testPromise
> -std=gnu++14
> 
> I am not sure how to link libc++.so instead
> 
> 
> 
> _______________________________________________
> 
> OSTech
> http://community.qnx.com/sf/go/post119240
> To cancel your subscription to this discussion, please e-mail ostech-
> core_os-unsubscribe@community.qnx.com
Re: RE: RE: std::shared_future failed in C++  
> I am using the command:
> QCC -V5.4.0,gcc_ntox86_64_gpp test_promise.cpp -o testPromise -std=gnu++14
> 
> I am not sure how to link libc++.so instead

QCC -V5.4.0,gcc_ntox86_64 test_promise.cpp -o testPromise -std=gnu++14
Re: RE: RE: std::shared_future failed in C++  
Thank you Elad and Stephen for your valuable help.

Now it is working! I used: 
QCC -V5.4.0,gcc_ntox86_64 test_promise.cpp -o testPromise -std=gnu++14


Best wishes,
Ilyas