Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 29
Registered: ‎04-03-2013
My Device: BB10
My Carrier: Simulator

Launch failed no binaries for window capture screenshot?

[ Edited ]

Hi All,

 

I have this "Launch failed no binaries"  when my app were running on "Run As Blackberry C/C++ Application".

Why does it prompt out and the Build Configuration has built successful?

 

**** Build of configuration Device-Release for project FullCapture ****

make -j8 Device-Release
make -C .//translations -f Makefile update
make[1]: Entering directory `E:/MobileApps/ndk-10.1.0-workspace/FullCapture/translations'
C:/bbndk/host_10_1_0_212/win32/x86/usr/bin/lupdate FullCapture.pro
Updating 'FullCapture.ts'...
    Found 1 source text(s) (0 new and 1 already existing)
make[1]: Leaving directory `E:/MobileApps/ndk-10.1.0-workspace/FullCapture/translations'
make -C .//translations -f Makefile release
make[1]: Entering directory `E:/MobileApps/ndk-10.1.0-workspace/FullCapture/translations'
C:/bbndk/host_10_1_0_212/win32/x86/usr/bin/lrelease FullCapture.pro
Updating 'E:/MobileApps/ndk-10.1.0-workspace/FullCapture/translations/FullCapture.qm'...
    Generated 0 translation(s) (0 finished and 0 unfinished)
    Ignored 1 untranslated source text(s)
make[1]: Leaving directory `E:/MobileApps/ndk-10.1.0-workspace/FullCapture/translations'
make -C ./arm -f Makefile release
make[1]: Entering directory `E:/MobileApps/ndk-10.1.0-workspace/FullCapture/arm'
make -f Makefile.Release
make[2]: Entering directory `E:/MobileApps/ndk-10.1.0-workspace/FullCapture/arm'
C:/bbndk/host_10_1_0_212/win32/x86/usr/bin/moc.exe -DQT_NO_IMPORT_QT47_QML -DQ_OS_BLACKBERRY -D_FORTIFY_SOURCE=2 -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_CORE_LIB -DQT_SHARED -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/share/qt4/mkspecs/blackberry-armv7le-qcc -I../../FullCapture -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtCore -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtDeclarative -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4 -I../src -Io.le-v7/.moc -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/freetype2 -I. -D__QNXNTO__ ../src/applicationui.hpp -o o.le-v7/.moc/moc_applicationui.cpp
qcc -Vgcc_ntoarmv7le -Wno-psabi -lang-c++ -fstack-protector -fstack-protector-all -mcpu=cortex-a9 -O2 -Wno-psabi -fstack-protector-strong -fvisibility=hidden -mthumb -Os -Wall -W -D_REENTRANT -fPIC -shared -DQT_NO_IMPORT_QT47_QML -DQ_OS_BLACKBERRY -D_FORTIFY_SOURCE=2 -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_CORE_LIB -DQT_SHARED -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/share/qt4/mkspecs/blackberry-armv7le-qcc -I../../FullCapture -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtCore -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtDeclarative -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4 -I../src -Io.le-v7/.moc -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/freetype2 -I. -x c++-header -c ../precompiled.h -o o.le-v7/.obj/FullCapture.gch/c++
qcc -Vgcc_ntoarmv7le -c -Wc,-include -Wc,o.le-v7/.obj/FullCapture -Wno-psabi -lang-c++ -fstack-protector -fstack-protector-all -mcpu=cortex-a9 -O2 -Wno-psabi -fstack-protector-strong -fvisibility=hidden -mthumb -Os -Wall -W -D_REENTRANT -fPIC -shared -DQT_NO_IMPORT_QT47_QML -DQ_OS_BLACKBERRY -D_FORTIFY_SOURCE=2 -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_CORE_LIB -DQT_SHARED -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/share/qt4/mkspecs/blackberry-armv7le-qcc -I../../FullCapture -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtCore -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtDeclarative -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4 -I../src -Io.le-v7/.moc -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/freetype2 -I. -o o.le-v7/.obj/applicationui.o ../src/applicationui.cpp
qcc -Vgcc_ntoarmv7le -c -Wc,-include -Wc,o.le-v7/.obj/FullCapture -Wno-psabi -lang-c++ -fstack-protector -fstack-protector-all -mcpu=cortex-a9 -O2 -Wno-psabi -fstack-protector-strong -fvisibility=hidden -mthumb -Os -Wall -W -D_REENTRANT -fPIC -shared -DQT_NO_IMPORT_QT47_QML -DQ_OS_BLACKBERRY -D_FORTIFY_SOURCE=2 -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_CORE_LIB -DQT_SHARED -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/share/qt4/mkspecs/blackberry-armv7le-qcc -I../../FullCapture -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtCore -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtDeclarative -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4 -I../src -Io.le-v7/.moc -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/freetype2 -I. -o o.le-v7/.obj/capture.o ../src/capture.cpp
qcc -Vgcc_ntoarmv7le -c -Wc,-include -Wc,o.le-v7/.obj/FullCapture -Wno-psabi -lang-c++ -fstack-protector -fstack-protector-all -mcpu=cortex-a9 -O2 -Wno-psabi -fstack-protector-strong -fvisibility=hidden -mthumb -Os -Wall -W -D_REENTRANT -fPIC -shared -DQT_NO_IMPORT_QT47_QML -DQ_OS_BLACKBERRY -D_FORTIFY_SOURCE=2 -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_CORE_LIB -DQT_SHARED -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/share/qt4/mkspecs/blackberry-armv7le-qcc -I../../FullCapture -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtCore -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtDeclarative -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4 -I../src -Io.le-v7/.moc -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/freetype2 -I. -o o.le-v7/.obj/main.o ../src/main.cpp
qcc -Vgcc_ntoarmv7le -c -Wc,-include -Wc,o.le-v7/.obj/FullCapture -Wno-psabi -lang-c++ -fstack-protector -fstack-protector-all -mcpu=cortex-a9 -O2 -Wno-psabi -fstack-protector-strong -fvisibility=hidden -mthumb -Os -Wall -W -D_REENTRANT -fPIC -shared -DQT_NO_IMPORT_QT47_QML -DQ_OS_BLACKBERRY -D_FORTIFY_SOURCE=2 -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_CORE_LIB -DQT_SHARED -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/share/qt4/mkspecs/blackberry-armv7le-qcc -I../../FullCapture -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtCore -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtDeclarative -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4 -I../src -Io.le-v7/.moc -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/freetype2 -I. -o o.le-v7/.obj/moc_applicationui.o o.le-v7/.moc/moc_applicationui.cpp
rm -f libFullCapture.so.1.0.0 libFullCapture.so libFullCapture.so.1 libFullCapture.so.1.0
qcc -Vgcc_ntoarmv7le -lang-c++ -Wl,-rpath-link,C:/bbndk/target_10_1_0_1483/qnx6/armle-v7/lib -Wl,-rpath-link,C:/bbndk/target_10_1_0_1483/qnx6/armle-v7/usr/lib -Wl,-O1 -Wl,-rpath-link,C:/bbndk/target_10_1_0_1483/qnx6/armle-v7/usr/lib/qt4/lib -Wl,-z,relro -Wl,-soname,FullCapture.so -shared -Wl,-z,relro -Wl,-z,now -o libFullCapture.so.1.0.0 o.le-v7/.obj/applicationui.o o.le-v7/.obj/capture.o o.le-v7/.obj/main.o o.le-v7/.obj/moc_applicationui.o   -LC:/bbndk/target_10_1_0_1483/qnx6/armle-v7/lib -LC:/bbndk/target_10_1_0_1483/qnx6/armle-v7/usr/lib -LC:/bbndk/target_10_1_0_1483/qnx6/armle-v7/usr/lib/qt4/lib -LC:/bbndk/target_10_1_0_1483/qnx6//usr/lib/qt4/lib -lbbcascades -lQtDeclarative -lQtScript -lQtSvg -lQtSql -lsqlite3 -lz -lQtXmlPatterns -lQtGui -lQtNetwork -lsocket -lQtCore -lm -lbps  
ln -s libFullCapture.so.1.0.0 libFullCapture.so
ln -s libFullCapture.so.1.0.0 libFullCapture.so.1
ln -s libFullCapture.so.1.0.0 libFullCapture.so.1.0
rm -f o.le-v7/libFullCapture.so.1.0.0
rm -f o.le-v7/libFullCapture.so
rm -f o.le-v7/libFullCapture.so.1
rm -f o.le-v7/libFullCapture.so.1.0
mv -f libFullCapture.so.1.0.0 libFullCapture.so libFullCapture.so.1 libFullCapture.so.1.0 o.le-v7/
echo && ntoarm-objcopy --only-keep-debug o.le-v7/libFullCapture.so.1.0.0 o.le-v7/FullCapture.so.sym && ntoarm-objcopy --strip-all -R.ident --add-gnu-debuglink o.le-v7/FullCapture.so.sym o.le-v7/libFullCapture.so.1.0.0 o.le-v7/FullCapture.so

make[2]: Leaving directory `E:/MobileApps/ndk-10.1.0-workspace/FullCapture/arm'
make[1]: Leaving directory `E:/MobileApps/ndk-10.1.0-workspace/FullCapture/arm'

**** Build Finished ****

 

 

Thanks

Developer
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30
My Carrier: T-Mobile

Re: Launch failed no binaries for window capture screenshot?

Are you sure you have set your build configuration to whatever you want to run the app on?

For example if you are trying to run on a simulator, the default build configuration is device-debug so if you just click build it won't have binaries for a simulator. You would need to change your build configuration to simulator, build again, then run.
---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan
Developer
Posts: 29
Registered: ‎04-03-2013
My Device: BB10
My Carrier: Simulator

Re: Launch failed no binaries for window capture screenshot?

Hi bcs925,

 

You are right, it was built with device-debug.

But when I changed it to simulator-debug, these error showed:-

 

make[2]: *** [o-g/FullCapture] Error 1
make[1]: *** [debug] Error 2
make: *** [Simulator-Debug] Error 2

 

Does it mean that I need the physical blackberry device then only can build and run it?

 

Here is my built result :-
**** Build of configuration Simulator-Debug for project FullCapture ****

make -j8 Simulator-Debug
make -C .//translations -f Makefile update
cd x86 && C:/bbndk/host_10_1_0_212/win32/x86/usr/bin/qmake -spec blackberry-x86-qcc ../FullCapture.pro  CONFIG+=debug_and_release CONFIG+=simulator
make[1]: Entering directory `E:/MobileApps/ndk-10.1.0-workspace/FullCapture/translations'
C:/bbndk/host_10_1_0_212/win32/x86/usr/bin/lupdate FullCapture.pro
Updating 'FullCapture.ts'...
    Found 1 source text(s) (0 new and 1 already existing)
make[1]: Leaving directory `E:/MobileApps/ndk-10.1.0-workspace/FullCapture/translations'
make -C .//translations -f Makefile release
make[1]: Entering directory `E:/MobileApps/ndk-10.1.0-workspace/FullCapture/translations'
C:/bbndk/host_10_1_0_212/win32/x86/usr/bin/lrelease FullCapture.pro
Updating 'E:/MobileApps/ndk-10.1.0-workspace/FullCapture/translations/FullCapture.qm'...
    Generated 0 translation(s) (0 finished and 0 unfinished)
    Ignored 1 untranslated source text(s)
make[1]: Leaving directory `E:/MobileApps/ndk-10.1.0-workspace/FullCapture/translations'
make -C ./x86 -f Makefile debug
make[1]: Entering directory `E:/MobileApps/ndk-10.1.0-workspace/FullCapture/x86'
make -f Makefile.Debug
make[2]: Entering directory `E:/MobileApps/ndk-10.1.0-workspace/FullCapture/x86'
C:/bbndk/host_10_1_0_212/win32/x86/usr/bin/moc.exe -DQT_NO_IMPORT_QT47_QML -DQ_OS_BLACKBERRY -DQT_DECLARATIVE_DEBUG -DQT_DECLARATIVE_LIB -DQT_CORE_LIB -DQT_SHARED -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/share/qt4/mkspecs/blackberry-x86-qcc -I../../FullCapture -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtCore -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtDeclarative -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4 -I../src -Io-g/.moc -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/freetype2 -I. -D__QNXNTO__ ../src/applicationui.hpp -o o-g/.moc/moc_applicationui.cpp
qcc -Vgcc_ntox86 -Wno-psabi -lang-c++ -fstack-protector -fstack-protector-all -g -Wno-psabi -Wall -W -D_REENTRANT -DQT_NO_IMPORT_QT47_QML -DQ_OS_BLACKBERRY -DQT_DECLARATIVE_DEBUG -DQT_DECLARATIVE_LIB -DQT_CORE_LIB -DQT_SHARED -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/share/qt4/mkspecs/blackberry-x86-qcc -I../../FullCapture -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtCore -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtDeclarative -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4 -I../src -Io-g/.moc -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/freetype2 -I. -x c++-header -c ../precompiled.h -o o-g/.obj/FullCapture.gch/c++
qcc -Vgcc_ntox86 -c -Wc,-include -Wc,o-g/.obj/FullCapture -Wno-psabi -lang-c++ -fstack-protector -fstack-protector-all -g -Wno-psabi -Wall -W -D_REENTRANT -DQT_NO_IMPORT_QT47_QML -DQ_OS_BLACKBERRY -DQT_DECLARATIVE_DEBUG -DQT_DECLARATIVE_LIB -DQT_CORE_LIB -DQT_SHARED -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/share/qt4/mkspecs/blackberry-x86-qcc -I../../FullCapture -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtCore -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtDeclarative -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4 -I../src -Io-g/.moc -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/freetype2 -I. -o o-g/.obj/applicationui.o ../src/applicationui.cpp
qcc -Vgcc_ntox86 -c -Wc,-include -Wc,o-g/.obj/FullCapture -Wno-psabi -lang-c++ -fstack-protector -fstack-protector-all -g -Wno-psabi -Wall -W -D_REENTRANT -DQT_NO_IMPORT_QT47_QML -DQ_OS_BLACKBERRY -DQT_DECLARATIVE_DEBUG -DQT_DECLARATIVE_LIB -DQT_CORE_LIB -DQT_SHARED -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/share/qt4/mkspecs/blackberry-x86-qcc -I../../FullCapture -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtCore -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtDeclarative -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4 -I../src -Io-g/.moc -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/freetype2 -I. -o o-g/.obj/capture.o ../src/capture.cpp
qcc -Vgcc_ntox86 -c -Wc,-include -Wc,o-g/.obj/FullCapture -Wno-psabi -lang-c++ -fstack-protector -fstack-protector-all -g -Wno-psabi -Wall -W -D_REENTRANT -DQT_NO_IMPORT_QT47_QML -DQ_OS_BLACKBERRY -DQT_DECLARATIVE_DEBUG -DQT_DECLARATIVE_LIB -DQT_CORE_LIB -DQT_SHARED -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/share/qt4/mkspecs/blackberry-x86-qcc -I../../FullCapture -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtCore -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtDeclarative -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4 -I../src -Io-g/.moc -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/freetype2 -I. -o o-g/.obj/main.o ../src/main.cpp
qcc -Vgcc_ntox86 -c -Wc,-include -Wc,o-g/.obj/FullCapture -Wno-psabi -lang-c++ -fstack-protector -fstack-protector-all -g -Wno-psabi -Wall -W -D_REENTRANT -DQT_NO_IMPORT_QT47_QML -DQ_OS_BLACKBERRY -DQT_DECLARATIVE_DEBUG -DQT_DECLARATIVE_LIB -DQT_CORE_LIB -DQT_SHARED -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/share/qt4/mkspecs/blackberry-x86-qcc -I../../FullCapture -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtCore -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4/QtDeclarative -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/qt4 -I../src -Io-g/.moc -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include -Ic:/bbndk/target_10_1_0_1483/qnx6/usr/include/freetype2 -I. -o o-g/.obj/moc_applicationui.o o-g/.moc/moc_applicationui.cpp
qcc -Vgcc_ntox86 -lang-c++ -Wl,-rpath-link,C:/bbndk/target_10_1_0_1483/qnx6/x86/lib -Wl,-rpath-link,C:/bbndk/target_10_1_0_1483/qnx6/x86/usr/lib -Wl,-rpath-link,C:/bbndk/target_10_1_0_1483/qnx6/x86/usr/lib/qt4/lib -o o-g/FullCapture o-g/.obj/applicationui.o o-g/.obj/capture.o o-g/.obj/main.o o-g/.obj/moc_applicationui.o    -LC:/bbndk/target_10_1_0_1483/qnx6/x86/lib -LC:/bbndk/target_10_1_0_1483/qnx6/x86/usr/lib -LC:/bbndk/target_10_1_0_1483/qnx6/x86/usr/lib/qt4/lib -LC:/bbndk/target_10_1_0_1483/qnx6//usr/lib/qt4/lib -lbbcascades -lQtDeclarative -lQtScript -lQtSvg -lQtSql -lsqlite3 -lz -lQtXmlPatterns -lQtGui -lQtNetwork -lsocket -lQtCore -lm -lbps
C:\bbndk\host_10_1_0_212\win32\x86\usr\bin\ntox86-ld: o-g/.obj/capture.o: undefined reference to symbol 'screen_read_window'
make[2]: Leaving directory `E:/MobileApps/ndk-10.1.0-workspace/FullCapture/x86'
make[1]: Leaving directory `E:/MobileApps/ndk-10.1.0-workspace/FullCapture/x86'
C:\bbndk\host_10_1_0_212\win32\x86\usr\bin\ntox86-ld: note: 'screen_read_window' is defined in DSO C:/bbndk/target_10_1_0_1483/qnx6/x86/usr/lib/libscreen.so.1 so try adding it to the linker command line
C:/bbndk/target_10_1_0_1483/qnx6/x86/usr/lib/libscreen.so.1: could not read symbols: Invalid operation
cc: C:/bbndk/host_10_1_0_212/win32/x86/usr/bin/ntox86-ld caught signal 1
make[2]: *** [o-g/FullCapture] Error 1
make[1]: *** [debug] Error 2
make: *** [Simulator-Debug] Error 2

**** Build Finished ****

 

 

Thanks.

 

Developer
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30
My Carrier: T-Mobile

Re: Launch failed no binaries for window capture screenshot?

Try cleaning the project, setting build configuration to simulator, and build again.
---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan
Developer
Posts: 29
Registered: ‎04-03-2013
My Device: BB10
My Carrier: Simulator

Re: Launch failed no binaries for window capture screenshot?

Hi bcs925,

 

I tried the the method that suggested by you. it couldn't work.

Still the same error launch: -

 

make[2]: *** [o-g/FullCapture] Error 1
make[1]: *** [debug] Error 2
make: *** [Simulator-Debug] Error 2

 

I don't know whether am I declare it correctly on ApplicatonUI or the screen_read_window on capture.cpp.

 

I really have no clue on why the above error happens...=S..

 

Anyway, below here are my codes, I created this test project and named it as FullCapture for testing purposes.

This is the code that giving the above error.

 

applicationui.cpp

#include "capture.h"
#include <bb/cascades/Application>
#include <bb/cascades/QmlDocument>
#include <bb/cascades/AbstractPane>

using namespace bb::cascades;

ApplicationUI::ApplicationUI(bb::cascades::Application *app)
: QObject(app)
{
    // create scene document from main.qml asset
    // set parent to created document to ensure it exists for the whole application lifetime
    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    qmlRegisterType<capture>("capture.fullscreen", 1, 0, "FullScreenCapture");

    // create root object for the UI
    AbstractPane *root = qml->createRootObject<AbstractPane>();
    // set created root object as a scene
    app->setScene(root);
}

 

I created capture.cpp and capture.h.

 

capture.cpp

#include "capture.h"
#include <Qt/qimage.h>
#include <Qt/qfile.h>

	void capture::write_bitmap_header(int nbytes, QByteArray& ba, const int size[])
	{
		char header[54];

		/* Set standard bitmap header */
		header[0] = 'B';
		header[1] = 'M';
		header[2] = nbytes & 0xff;
		header[3] = (nbytes >> 8) & 0xff;
		header[4] = (nbytes >> 16) & 0xff;
		header[5] = (nbytes >> 24) & 0xff;
		header[6] = 0;
		header[7] = 0;
		header[8] = 0;
		header[9] = 0;
		header[10] = 54;
		header[11] = 0;
		header[12] = 0;
		header[13] = 0;
		header[14] = 40;
		header[15] = 0;
		header[16] = 0;
		header[17] = 0;
		header[18] = size[0] & 0xff;
		header[19] = (size[0] >> 8) & 0xff;
		header[20] = (size[0] >> 16) & 0xff;
		header[21] = (size[0] >> 24) & 0xff;
		header[22] = -size[1] & 0xff;
		header[23] = (-size[1] >> 8) & 0xff;
		header[24] = (-size[1] >> 16) & 0xff;
		header[25] = (-size[1] >> 24) & 0xff;
		header[26] = 1;
		header[27] = 0;
		header[28] = 32;
		header[29] = 0;
		header[30] = 0;
		header[31] = 0;
		header[32] = 0;
		header[33] = 0;
		header[34] = 0; /* image size*/
		header[35] = 0;
		header[36] = 0;
		header[37] = 0;
		header[38] = 0x9;
		header[39] = 0x88;
		header[40] = 0;
		header[41] = 0;
		header[42] = 0x9l;
		header[43] = 0x88;
		header[44] = 0;
		header[45] = 0;
		header[46] = 0;
		header[47] = 0;
		header[48] = 0;
		header[49] = 0;
		header[50] = 0;
		header[51] = 0;
		header[52] = 0;
		header[53] = 0;

		ba.append(header, sizeof(header));
	}


	//void capture(int width, int height, screen_context_t context)
	void capture::captureFullScreen(int width, int height)
	{
		screen_context_t context;
		screen_create_context(&context,0);
		screen_window_t screen_window;
		screen_create_window(&screen_window, context);

	    screen_pixmap_t screen_pix;
		screen_buffer_t screenshot_buf;
		char *screenshot_ptr = NULL;
		int screenshot_stride = 0;

		int usage, format;
		int size[2];

		screen_create_pixmap(&screen_pix, context);

		usage = SCREEN_USAGE_READ | SCREEN_USAGE_NATIVE;
		screen_set_pixmap_property_iv(screen_pix, SCREEN_PROPERTY_USAGE, &usage);

		format = SCREEN_FORMAT_RGBA8888;
		screen_set_pixmap_property_iv(screen_pix, SCREEN_PROPERTY_FORMAT, &format);

		size[0] = width;
		size[1] = height;
		screen_set_pixmap_property_iv(screen_pix, SCREEN_PROPERTY_BUFFER_SIZE, size);

		screen_create_pixmap_buffer(screen_pix);
		screen_get_pixmap_property_pv(screen_pix, SCREEN_PROPERTY_RENDER_BUFFERS,
		                              (void**)&screenshot_buf);
		screen_get_buffer_property_pv(screenshot_buf, SCREEN_PROPERTY_POINTER,
		                              (void**)&screenshot_ptr);
		screen_get_buffer_property_iv(screenshot_buf, SCREEN_PROPERTY_STRIDE,
		                              &screenshot_stride);

		//screen_read_window(GLOBALS_PTR()->app()->mainWindow()->handle(), screenshot_buf, 0, NULL ,0);

		screen_read_window(screen_window, screenshot_buf, 0, NULL ,0);


		QByteArray array;

		int nbytes = size[0] * size[1] * 4;
		write_bitmap_header(nbytes, array, size);

		for (int i = 0; i < size[1]; i++)
		{
			array.append(screenshot_ptr + i * screenshot_stride, size[0] * 4);
		}

		QImage image = QImage::fromData(array, "BMP");
		QFile outFile("shared/photos/temp1.jpeg");
		outFile.open(QIODevice::WriteOnly);
		image.save(&outFile, "JPEG");

		screen_destroy_pixmap(screen_pix);
	}

 capture.h

#ifndef CAPTURE_H_
#define CAPTURE_H_

#include <QByteArray>
#include <screen/screen.h>
#include <QtCore/QObject>


class capture : public QObject {
public:
	capture();
	virtual ~capture();

	void captureFullScreen(int width, int height);
	void write_bitmap_header(int nbytes, QByteArray& ba, const int size[]);
	//void capture(int width, int height, screen_context_t context);
};

#endif /* CAPTURE_H_ */

 

 

main.qml

 

// Default empty project template
import bb.cascades 1.0
import capture.fullscreen 1.0

// creates one page with a label
Page {
    Container {
        layout: DockLayout {}
        Label {
            text: qsTr("Hello World")
            textStyle.base: SystemDefaults.TextStyles.BigText
            verticalAlignment: VerticalAlignment.Center
            horizontalAlignment: HorizontalAlignment.Center
        }
        Button {
            onClicked: {
                captureFullscreen.captureFullScreen("760","1280");
            }
        }
    }
}

 

Thanks

Highlighted
Developer
Posts: 29
Registered: ‎04-03-2013
My Device: BB10
My Carrier: Simulator

Re: Launch failed no binaries for window capture screenshot?

Hi bcs925,

 

I think i know why it still give the same error.

I created it as cascades project, however,to capture window screenshot need to build in OpenGL.

 

Anyway, thanks for your advice.