Blackberry 10 compilation error on the default "Hello World' Sample - c++

Hello I am new to Blackberry 10 development and after trying to compile my first "Hello World" application which comes as default with the package I get the following errors in the console. I am running windows 8 64 bit.
Please note I didn't make any changes to the default "Hello World" template which comes with the ndk.
Below are the contents of my main.cpp file:
// Default empty project template
#include <bb/cascades/Application>
#include <QLocale>
#include <QTranslator>
#include "applicationui.hpp"
// include JS Debugger / CS Profiler enabler
// this feature is enabled by default in the debug build only
#include <Qt/qdeclarativedebug.h>
using namespace bb::cascades;
Q_DECL_EXPORT int main(int argc, char **argv)
{
// this is where the server is started etc
Application app(argc, argv);
// localization support
QTranslator translator;
QString locale_string = QLocale().name();
QString filename = QString( "MyApp_%1" ).arg( locale_string );
if (translator.load(filename, "app/native/qm")) {
app.installTranslator( &translator );
}
new ApplicationUI(&app);
// we complete the transaction started in the app constructor and start the client event loop here
return Application::exec();
// when loop is exited the Application deletes the scene which deletes all its children (per qt rules for children)
}
This is the console output:
../precompiled.h:1:0: fatal error: can't open "C:\Users\Tich Kames\AppData\Local\Temp\2qccKaF3bb\precompiled.s" for writing: Invalid argument
make[2]: Leaving directory `C:/Users/Tich Kames/ndk-10.1.0-workspace/MyApp/arm'
compilation terminated.
cc: C:/bbndk/host_10_1_0_132/win32/x86/usr/lib/gcc/arm-unknown-nto-qnx8.0.0eabi/4.6.3/cc1plus caught signal 1
make[1]: Leaving directory `C:/Users/Tich Kames/ndk-10.1.0-workspace/MyApp/arm'
make[2]: *** [o.le-v7-g/.obj/MyApp.gch/c++] Error 1
make[1]: *** [debug] Error 2
make: *** [Device-Debug] Error 2

As aknowledged by tkames, the problem comes from the spaces in the workspace and temp path.

Related

I reinstalled qt creator to fix error but it created more errors

I am trying to use QT Creator to create a simple square but I get 14 errors when compiling. It seems like the compiler doesnt reconize the functions.
main.cpp:
#include <QApplication>
#include <QGraphicsScene>
#include <QGraphicsRectItem>
#include <QGraphicsView>
int main(int argc, char *argv[]){
QApplication a(argc, argv);
//Create Scene
QGraphicsScene * scene = new QGraphicsScene();
//Creat Item To Put Into Scene
QGraphicsRectItem * rect = new QGraphicsRectItem();
rect->setRect(100, 50, 100, 100);
//Add Item To Scene aka buffer
scene->addItem(rect);
//add a view
QGraphicsView * view = new QGraphicsView(scene);
view->show();
return a.exec();
}
Compile Output:
mingw32-make[1]: *** [debug\MYGAME.exe] Error 1
mingw32-make: *** [debug] Error 2
Makefile.Debug:61: recipe for target 'debug\MYGAME.exe' failed
mingw32-make[1]: Leaving directory 'C:/Users/lisa/Documents/build-MYGAME-QT_5_8-Debug'
Makefile:34: recipe for target 'debug' failed
19:18:13: The process "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project MYGAME (kit: QT 5.8)
The kit QT 5.8 has configuration issues which might be the root cause for this problem.
When executing step "Make"
19:18:13: Elapsed time: 00:02.
Issues:
Screenshoted Errors

GNU Radio make error : "reference to ‘uhd’ is ambiguous"

I created a bpsk flowgraph in gnuradio companion (grc) and it is working fine. At the moment Im writing a C++ equivalent of the same program using gnuradio classes. First I read the I/Q data from a file and I was able to get all the bpsk-modulated AX.25 frames. Now im trying to replace the file source block with a UHD one in order to be able to read the I/Q data in real time. make reports an error "reference to ‘uhd’ is ambiguous". The full make output is shown below
$ make
[ 50%] Building CXX object CMakeFiles/bpsk.dir/bpsk.cc.o
/home/mbkitine/Dropbox/Lulea/GRC/SSC/PSK/bpsk/RX_C++/bpsk.cc: In function ‘int main(int, char**)’:
/home/mbkitine/Dropbox/Lulea/GRC/SSC/PSK/bpsk/RX_C++/bpsk.cc:85:78: error: reference to ‘uhd’ is ambiguous
gr::uhd::usrp_source::sptr uhd_source = gr::uhd::usrp_source::make(address,uhd::stream_args_t("fc32"));
^
In file included from /usr/local/include/uhd/types/metadata.hpp:22:0,
from /usr/local/include/uhd/stream.hpp:22,
from /usr/local/include/uhd/device.hpp:22,
from /usr/local/include/uhd/usrp/multi_usrp.hpp:37,
from /usr/local/include/gnuradio/uhd/usrp_block.h:28,
from /usr/local/include/gnuradio/uhd/usrp_source.h:26,
from /home/mbkitine/Dropbox/Lulea/GRC/SSC/PSK/bpsk/RX_C++/bpsk.cc:56:
/usr/local/include/uhd/types/time_spec.hpp:25:14: note: candidates are: namespace uhd { }
namespace uhd{
^
In file included from /usr/local/include/gnuradio/uhd/usrp_source.h:26:0,
from /home/mbkitine/Dropbox/Lulea/GRC/SSC/PSK/bpsk/RX_C++/bpsk.cc:56:
/usr/local/include/gnuradio/uhd/usrp_block.h:31:17: note: namespace gr::uhd { }
namespace uhd {
^
CMakeFiles/bpsk.dir/build.make:62: recipe for target 'CMakeFiles/bpsk.dir/bpsk.cc.o' failed
make[2]: *** [CMakeFiles/bpsk.dir/bpsk.cc.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/bpsk.dir/all' failed
make[1]: *** [CMakeFiles/bpsk.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Here is my bpsk.cc code
// Include header files for each block used in flowgraph
#include <gnuradio/top_block.h>
#include <gnuradio/analog/sig_source_f.h>
#include <gnuradio/analog/agc2_cc.h>
#include <gnuradio/digital/fll_band_edge_cc.h>
#include <gnuradio/digital/pfb_clock_sync_ccf.h>
#include <gnuradio/filter/firdes.h>
#include <gnuradio/digital/cma_equalizer_cc.h>
#include <gnuradio/digital/costas_loop_cc.h>
#include <gnuradio/blocks/api.h>
#include <gnuradio/sync_block.h>
#include <gnuradio/digital/binary_slicer_fb.h>
#include <gnuradio/digital/diff_decoder_bb.h>
#include <gnuradio/digital/hdlc_deframer_bp.h>
#include <gnuradio/blocks/message_debug.h>
#include <gnuradio/audio/sink.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/uhd/usrp_source.h>
#include <ais/invert.h>
#include <gnuradio/blocks/complex_to_real.h>
#include <iostream>
#include <string>
using namespace gr;
int main(int argc, char **argv)
{
//Extracting variables from the menu
char* filename = argv[1];
//UHD Default parameters
double samp_rate = 1000000;
double baud_rate = 250000;
double fc = 100e6;
int sps = int(samp_rate/baud_rate);
//Receiver parameters
int dec = 10;
float loop_bw = 2 * 3.14/100;
// Construct a top block that will contain flowgraph blocks. Alternatively,
// one may create a derived class from top_block and hold instantiated blocks
// as member data for later manipulation.
top_block_sptr tb = make_top_block("bpsk");
//UHD block
std::string address = "192.168.10.2";
gr::uhd::usrp_source::sptr uhd_source = gr::uhd::usrp_source::make(address,uhd::stream_args_t("fc32"));
uhd_source->set_samp_rate(samp_rate);
uhd_source->set_center_freq(fc);
//Reading bpsk signal from file
//blocks::file_source::sptr file = blocks::file_source::make(sizeof(gr_complex),filename,false);
//Automatic gain controller
analog::agc2_cc::sptr agc = analog::agc2_cc::make(1e-1, 1e-2, 1.0, 1.0);
//FLL band edge filter
digital::fll_band_edge_cc::sptr fll = digital::fll_band_edge_cc::make(sps, 0.5, 44, loop_bw);
//PFB symbol time recovery
const int nfilts = 32;
std::vector<float> rrc_taps = filter::firdes::root_raised_cosine(nfilts, nfilts, 1.0/float(sps), 0.35, 11*sps*nfilts);
digital::pfb_clock_sync_ccf::sptr pfb = digital::pfb_clock_sync_ccf::make(sps,loop_bw,rrc_taps,nfilts,0,1.5,2);
//CMA equalization
digital::cma_equalizer_cc::sptr cma = digital::cma_equalizer_cc::make(15,1,0.01,2);
//Costas loop
digital::costas_loop_cc::sptr costas = digital::costas_loop_cc::make(loop_bw,2);
//Taking the real part
gr::blocks::complex_to_real::sptr comp_to_real = blocks::complex_to_real::make(1);
//Binary slicer
digital::binary_slicer_fb::sptr slicer = digital::binary_slicer_fb::make();
//Differential decoder
digital::diff_decoder_bb::sptr differential_decoder = digital::diff_decoder_bb::make(2);
//Inverting bit values
//invert::sptr inverter = ais::invert::make();
//HDLC Deframer
digital::hdlc_deframer_bp::sptr deframer = digital::hdlc_deframer_bp::make(32,500);
//Output data
gr::blocks::message_debug::sptr msg = gr::blocks::message_debug::make();
std::cout << "Blocks declared successfully " << std::endl;
//Connections
tb->connect(uhd_source,0,agc,0);
tb->connect(agc,0,fll,0);
tb->connect(fll,0,pfb,0);
tb->connect(pfb,0,cma,0);
tb->connect(cma,0,costas,0);
tb->connect(costas,0,comp_to_real,0);
tb->connect(comp_to_real,0,slicer,0);
tb->connect(slicer,0,differential_decoder,0);
tb->connect(differential_decoder,0,deframer,0);
//tb->connect(inverter,0,deframer,0);
tb->msg_connect(deframer,"out",msg,"print_pdu");
tb->run();
std::cout << "The GNU Radio Thread is Running " << std::endl;
// Exit normally.
return 0;
}
And finally my CMakelists.txt file. I basically modified this file from the original dialtone C++ example which can be found in {YOUR_GNURADIO_DIRECTORY}/gr-audio/examples/c++
cmake_minimum_required(VERSION 2.6)
project(bpsk CXX)
find_package(Boost "1.35" COMPONENTS system)
set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG AUDIO BLOCKS FILTER DIGITAL UHD)
find_package(Gnuradio "3.7.2" REQUIRED)
include_directories(${GNURADIO_ALL_INCLUDE_DIRS})
add_executable(bpsk bpsk.cc)
target_link_libraries(bpsk ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES})
Any help will be highly appreciated.
Regards
Moses.
The error says what's wrong right there:
since you're doing
using namespace gr;
you compiler can't know whether you mean gr::uhd or just uhd.
I'd just recommend dropping the using namespace gr directive. Or, using ::uhd when you really mean the non-gr:: namespace.

Build Fail- Error Message Translatopn

I recently made the switch from a PC to a Mac, Visual Studio to Netbeans, and Java to C++. I tried to include a boost library into my program, and when I build my code, I receive a build error. Can someone please walk me through what this build error is saying? I followed this post to add the libraries. I also followed this Boost getting start tutorial, and the Boost folder is in the "Netbeans Projects" folder, this is the directory "/Users/Nate/NetBeansProjects/boost_1_60_0/boost". Should the boost files have been placed somewhere else?
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-MacOSX/stockapp
mkdir -p dist/Debug/GNU-MacOSX
g++ -o dist/Debug/GNU-MacOSX/stockapp build/Debug/GNU-MacOSX/main.o -L../boost_1_60_0/boost -l boost
ld: library not found for -lboost
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-MacOSX/stockapp] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 213ms)
I am trying to build an program that will download website HTML and parse the HTML to retrieve stock prices from fiance.yahoo.com, here is the unfinished code:
using namespace std;
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <boost/asio.hpp> //code worked before adding this include
static string Index; //initialize string hosting Index Name
static vector<string> Symbol;
int ReadIndexFile()
{
string FileRead;
string FileName;
//string Temp;
int count = 0;
FileName = Index + "Symbols.csv";
cout << FileName << "\n";
ifstream source(FileName.c_str());//establishes source file
while (!source.eof()) //reads source until end of file
{
while (getline(source, FileRead, ','))//retrieves source data to ',' and stores in temp
{
Symbol.push_back(FileRead); //writes to array line by line
cout << Symbol.at(count);
count++;
}
}
}
int DownloadHTML()
{
cout << "HTML Downloaded";
}
int main(int argc, char** argv) {
cout << "Name your Index: ";
cin >> Index;
ReadIndexFile();
DownloadHTML();
return 0;
}
As you can clearly see in the error message that "Boost" library not found.
ld: library not found for -lboost
So you need to install it using the following command;
sudo apt-get install libboost-all-dev
Hope this helps.
Edit:
As MAC does not support apt-get so you need to use http://brew.sh/.
Please have a look in this url http://stackoverflow.com/questions/19688424/why-is-apt-get-function-not-working-in-terminal-on-mac-osx-10-9 for more details about how Homebrew.

SDL2 Install problems: makefile.win file not recognized: file format not recognized and collect2.exe [error] id return1 exit status

After I learned the very basics of cpp i decided to push myself ahead and try SDL2 and try to make a game. I found the lazy foo's SDL tutorials. I tried to follow it but i seemed to have problems with installation. After putting in a "test" code i tried compiling it, and these messages showed up on the log:
C:\File\Location\For\My\Project\Makefile.win file not recognized: File format not recognized
C:\File\Location\For\My\Project\collect2.exe [Error] ld returned 1 exit status
I think it might be a linking error and heres my linkers:-lmingw32-lSDL2main-lSDL2
I tried deleting this Makefile.win but the same message just showed up and there isn't even a collect2.exe
I'm using the Orwell Dev-C++ using the mingw gcc 4.8.1 32bit release compiler, and heres the code:
#include <iostream>
#include <SDL2/SDL.h>
int main(int argc, char **argv){
if (SDL_Init(SDL_INIT_EVERYTHING) != 0){
std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
return 1;
}
SDL_Quit();
return 0;
}

C++: Unrecognized or Unsupported array type - opencv ARMminipc

I want to create simple C++ program to show output from webcam.This is my pro file:
QT += core
QT -= gui
TARGET = camera
CONFIG += console
CONFIG -= app_bundle
PKGCONFIG += opencv
TEMPLATE = app
SOURCES += main.cpp
LIBS += -lopencv_core -lopencv_imgproc -lopencv_highgui
and this is my cpp file
#include <QCoreApplication>
#include <iostream>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
using namespace std;
using namespace cv;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
VideoCapture cap;
Mat cam;
namedWindow("camera",1);
for(;;)
{
cap.open(0);
cap>>cam;
imshow("camera",cam);
waitKey(10);
}
return a.exec();
}
and the result is:
VIDIOC_QUERYMENU: Invalid argument (8x)
libv4l2: error setting pixformat: Device or resource busy
HIGHGUI ERROR: libv4l unable to ioctl S_FMT
libv4l2: error setting pixformat: Device or resource busy
libv4l1: error setting pixformat: Device or resource busy
HIGHGUI ERROR: libv4l unable to ioctl VIDIOCSPICT
OpenCV Error: Bad Flag (parameter or structure field) (unrecognized or unsupported array type) in cvGetMat, file /build/buildd-opencv_2.3.1-11-armhf-d9JIli/opencv-2.3.1/modules/core/src/array.cpp, line 2482
terminate called after throwing and instance of 'cv::Exception'
what(): /build/buildd-opencv_2.3.1-11-armhf-d9JIli/opencv-2.3.1/modules/core/src/array.cpp:line 2482: error: (-206) Unrecognized or unsupported array type in function cvGetMat
When I delete the loop for(;;) in my cpp, the webcam will show image only. not a streaming from webcam.
This code works on Windows, but it didn't work on Linux, or the miniPC. How can I fix my code?
I'm using QtCreator 2.5.0 Qt4.8.2 OpenCV 2.3.1 Debian in ARM miniPC Cubieboard2