Trouble Installing Arduino on Netbeans in Ubuntu 11 - netbeans

I am a complete noob to Arduino trying to make my first program. I have Netbeans installed and I wanted to do my first Arduino program using Netbeans. I found the following site that has some step-by-steps. http://java.dzone.com/news/arduino-development-using
I am using NetBeans 7 on a Fresh install of Ubuntu 11. I have been going step-by-step through the site.
My first hint that there is a problem is that the code Assist isn't working at all.
My next problem is that when I compile the default main.pde I get the following error:
fatal error: WProgram.h: No such file or directory in
cat main.pde >> applet/ArduinoTest1.cpp
/usr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -DF_CPU=16000000L -DARDUINO=18 -I/home/tmonteit/arduino-0018/hardware/arduino/cores/arduino -I/home/tmonteit/arduino-0018/libraries -mmcu=atmega328p applet/ArduinoTest1.cpp -o applet/ArduinoTest1.o
applet/ArduinoTest1.cpp:1:22: fatal error: WProgram.h: No such file or directory
compilation terminated.
make: *** [applet/ArduinoTest1.o] Error 1
When I troubleshoot similar problems online it seems that you have to make sure that you are using the correct library.
To install I used apt-get install librxtx-java arduino-core arduino
And then I downloaded arduino-1.0
How do I know if I have the correct libraries or setup?
Is there a proper way to get the right version of these libraries and arduino that will work with NetBeans?
Is there an easy fix?

Since the version used in the guide you are using (Arduino 0018) there have been several library changes (mostly in Arduino 1.0 and notably the renaming of WProgram.h to Arduino.h).
To accommodate these changes the main.pde file will need to change to:
#define __AVR_ATmega328P__
#include <binary.h>
#include <HardwareSerial.h>
#include <pins_arduino.h>
#include <Arduino.h>
#include <wiring_private.h>
#include <EEPROM/EEPROM.h>
void setup()
{
}
void loop()
{
}
Also, pins_arduino.h has moved from hardware/arduino/cores/arduino to hardware/arduino/variants/standard so you'll need to add this to your include path.

Related

how do i use PCL library after installing with vcpkg?

Its my first time using vcpkg to install PCL library. After successfully installing using
.\vcpkg install pcl
i tried using vcpkg integrate install to link it but to no avail. I am using VS code and a MinGW gcc compiler under C:/MingGW/bin/gcc.exe
#include <pcl/point_types.h>
returns an error #include errors detected. cannot open source file. I dont understand using cmake files to compile, can someone help me out thanks!
I had the same issue once, but it was totally my fault.
There are more than one options on vcpkg for downloading pcl.
You can get x64 or x86 for example. Your project should be compiled
with the corresponding settings.
If it is not the problem, then here is an example for including pcl in
CMakeList.
cmake_minimum_required(VERSION 3.0)
set(DEMO_NAME lidar_lvx_sample)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable(${DEMO_NAME} main.cpp lvx_file.cpp)
target_link_libraries(${DEMO_NAME}
PRIVATE
${PROJECT_NAME}_static PUBLIC ${PCL_LIBRARIES}
)
Based on this, you can make the changes in your CMakeList

swift-lldb compilation fails with c++11 error

I am trying to compile swift-lldb on Ubuntu 14.04 (following instructions from https://github.com/apple/swift-lldb). I have the following dependencies installed:
Clang-3.5
Cmake version 3.5.2
Python version 2.7.6
On running the build script step which is lldb/scripts/build-swift-cmake.py --test, I am seeing the following error:
CMake Warning at cmake/modules/HandleLLVMOptions.cmake:185 (message):
-fPIC is not supported.
Call Stack (most recent call first):
cmake/modules/HandleLLVMOptions.cmake:216 (add_flag_or_print_warning)
CMakeLists.txt:616 (include)
CMake Error at cmake/modules/HandleLLVMOptions.cmake:429 (message):
LLVM requires C++11 support but the '-std=c++11' flag isn't supported.
Call Stack (most recent call first):
CMakeLists.txt:616 (include)
I have defined environment variables CC and CXX to point to the clang C and C++ compilers.
root:/myswift# echo $CC
/usr/bin/clang
root:/myswift# echo $CXX
/usr/bin/clang++
I also found in the clang documentation that c++11 is supported by clang-3.5. Not sure what I am missing here. Can someone please help?
clang-4.0 mentioned as part of the installation should support the -std=c++11 flag (just tested clang-4.0.1). However, upgrading to clang-6.0 seems to solve this build process error.
Running cmake directly in the automatically created build directory (by the swift build scripts) could be used to investigate the build failure in more detail. To specify compilers here, rather than setting CC and CXX environment variables (which works well for GNU configure scripts), compilers can be set for cmake via
cmake -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ path_to_src_or_build_directory
An existing CMakeCache.txt might have to be removed, so that the above parameters are honored.
A problem with clang++ installations that I have observed is that clang++ cannot find C++ headers (i.e. if C++ headers are in non-standard locations other than /usr/include, unlikely in the case of Ubuntu though). In case /usr/bin/clang++ cannot compile a simple program like
#include <iostream>
using namespace std;
int main() {
cout << "hello" << endl;
return 0;
}
not being able to find the iostream include file, it might help to set --gcc-toolchain=/pathtoaworkinggcc, where pathtoaworkinggcc should include include, lib, bin, etc. of a working C++ compiler (possibly g++ in the case of a Ubuntu installation).

Wireshark dissector errors Ubuntu

I have a wireshark plugin code which compiles and generates .so files perfectly under Ubuntu 16. This dissector was written for wireshark 1.6 and the plugin runs perfectly under wireshark 1.6.
However when I try to use this plugin for wireshark 2(or any wireshark version higher than 1.6) following errors show -
Couldn't load module
/home/th89ct/.config/wireshark/plugins/plugin-1_0_0.so:
/home/th89ct/.config/wireshark/plugins/plugin-1_0_0.so: undefined
symbol: tvb_length
Couldn't load module
/home/th89ct/.config/wireshark/plugins/plugin--1_0_0.so:
/home/th89ct/.config/wireshark/plugins/plugin--1_0_0.so: undefined
symbol: check_col
so I wanted to edit the code by replacing the methods - as after googling I've found that these methods do not belong to the new wireshark API.
but the problem is every time I edit the code - even by only putting a space in a blank space - following error appears -
*gcc -c -DHAVE_CONFIG_H -I/usr/include/wireshark -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -DINET6 -D_U_=attribute((unused)) -Wall -Wpointer-arith -g -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -fPIC -DPIC packet-ife.c -o packet-ife.o packet-ife.c:105:23: fatal error: epan/emem.h: No such
file or directory #include
^ compilation terminated. Makefile.linux:28: recipe for target 'packet-ife.o' failed make: *** [packet-ife.o] Error
1*
what should I do? I have no idea!!!! Thanks in advance
Your problem here is that emem was replaced with wmem starting with Wireshark 2.0. You can read more about wmem in Wireshark's README.wmem file. Naturally, there are plenty of dissectors available in Wireshark's epan/dissectors/ and plugins/*/ directories to serve as excellent examples to help you with the transition.

How do I develop bare-metal i.mx6sx code using eclipse?

I was wondering if you could help me with some issues and questions I have for developing for the i.MX6 SoloX in bare-metal. I was looking at this link https://community.nxp.com/docs/DOC-106253 and downloaded the files there to use as an example of how to develop bare-metal c code for the i.MX6.
Then I setup my eclipse environment according to this tutorial https://community.nxp.com/docs/DOC-103736 but just the toolchain because I'm not interested in processor expert.
Since I'm working on Linux I didn't installed the Code Sourcery thing, instead I'm working with the gcc-arm-none-eabi which I installed using:
$ sudo apt-get install gcc-arm-none-eabi
And therefore I had to change the cs-rm and cs-make for rm and make respectively.
And I was able to create an eclipse project with the downloaded code and configure the project to make it work, nevertheless, I had the first error:
main.c:8:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
make: *** [cortex_A9/main.o] Error 1
cortex_A9/subdir.mk:24: recipe for target 'cortex_A9/main.o' failed
And I was able to solve it adding "/usr/include" in the include directories at project > properties. But I'm not sure if this is a correct way of solving this error.
After fixing this error I got a new one:
syscalls.c:168:1: error: unknown type name 'caddr_t'
caddr_t _sbrk(int incr)
And for solving that I had to include explicitly the file "/usr/include/x86_64-linux-gnu/sys/types.h" and also I don't know if that is the correct way to solve it.
Now having eliminated those two errors I have the following one:
Building target: imx6-A9.elf
Invoking: Cross ARM C Linker
arm-none-eabi-gcc -mcpu=cortex-a9 -march=armv7-a -marm -mlittle-endian -mfloat-abi=softfp -mfpu=neon -mno-unaligned-access -fno-zero-initialized-in-bss -O0 -g -T "/home/mmalagon/iMX6/MX6SX_hello_MFG/cortex_A9/mx6slx.ld" -nostartfiles -Wl,-Map,"imx6-A9.map" -o "imx6-A9.elf" ./cortex_A9/main.o ./cortex_A9/syscalls.o ./cortex_A9/uart.o
/usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/bin/ld: cannot find -lg
makefile:42: recipe for target 'imx6-A9.elf' failed
/usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
make: *** [imx6-A9.elf] Error 1
Which I haven't been able to resolve.
I don't know if this error is a consequence of the way I solved the two previous errors.
Does anybody know how to properly setup eclipse for i.MX6 bare-metal development?
Thank you very much for helping!!
If you want to develop bare-metal code for the i.MX6SoloX without using CodeSourcery then you need to execute this:
sudo apt-get install gcc-arm-none-eabi libnewlib-arm-none-eabi -y
And then choose "Custom (arm-none-eabi-gcc)" at Project>Settings>C/C++ Build in the 'Toolchains' tab.

fatal error: 'gtk/gtk.h' file not found

So I'm trying to install Gtk-Perl-0.7000 from http://search.cpan.org/dist/Gtk-Perl/ on a mac
I already successfully followed the steps to instal gtk+ at http://www.gtk.org/
when I run the Makefile.pl from Gtk-Perl-0.7000 it gives me:
gtkvertmp.c:3:10: fatal error: 'gtk/gtk.h' file not found
#include <gtk/gtk.h>
^
1 error generated.
Unable to find Gtk version...
Invoking gendefs.pl with [].
Please wait, this may take a moment...
gtktypexp.c:1:10: fatal error: 'gtk/gtktypeutils.h' file not found
#include <gtk/gtktypeutils.h>
^
1 error generated.
I have:
echo $PKG_CONFIG_PATH
:/Users/one/gtk/source/gtk+-2.24.16/gtk:/Users/one/gtk/inst/include/gtk-2.0/gtk:/Users/one/gtk/inst/lib/pkgconfig
I do have the gtk.h file in my system. I've searched online but haven't gotten Gtk-Perl to compile.
Your Mac OS need libgtk to be installed to run the script properly.