I can't get VS Code to play nice with WxWidgets on Linux or MacOS. It seems like it's trying to default to MSW and gives an error (detailed below)
The specific question is about VSCode (autocomplete, don't give false errors) with WxWidgets. In command prompt, compiling any Wx project works perfect.
Steps:
VS Code is installed
-Create folder for project. Let's call it /src/hello
-Create a hello.cpp file with code from: https://docs.wxwidgets.org/3.0/overview_helloworld.html
-Download WxWidgets into /src/hello/deps
-Going through steps to compile and install Wx https://docs.wxwidgets.org/trunk/plat_osx_install.html
-Check my Intellisense includes to include ${workspaceFolder}/**
-Now, in the command prompt, if I run:
g++ hello.cpp 'wx-config --cxxflags --libs' -o hello
./hello runs perfect!
But in VSCode is unusable because it's giving me this error:
cannot open source file "../../../lib/vc_lib/msw/wx/setup.h" (dependency of "wx/wxprec.h")
I'm pretty sure msw is for windows?
I feel like I've tried everything:
-Downloaded and Git version of Wx (Yeah, I know it's the same. But people on the wx forums recommended trying...)
-Use the Homebrew WxWidgets install.
-Using the sample projects included with Wx.
-Using the Hello World
-Same issues in Linux and MacOS.
-Updating Intellisense's includes every way you can think of.
-Using the output of wxconfig and putting the cxxflags and lib include output into Intellisense.
Is anyone able to use VS Code on Linux or MacOS with the Hello World Wx example? If so what are your intellisense settings?
My properties:
I'd rather not use Cmake for this.
I tried to install the nix package manager on an Android device with termux.
When I try to execute the nix applicatives (for instance nix-store or nix-env) I get the following error
/nix/store/y9mfv3sx75mbfibf1zna1kq9v98fk2nb-nix-1.11.16/bin/nix-env:
error while loading shared libraries:
/nix/store/kfk65xrfzndyyz6if5fxk4wrwz76h2lh-glibc-2.25-49/lib/libc.so:
invalid ELF header
The file seems to be a script for the GNU linker, so I'm wondering what is the problem, could it be that termux's version of ld is unable to correctly interpret GNU Linker's scripts?
Thanks in advance for any help.
Edit: It seems that if unset the LD_PRELOADED and the LD_LIBRARY_PATH variables the nix-applications work fine. Problem is that in doing so termux cannot lunch any other non nix application, such as bash for instance.
I am building Swift compiler from source on CentOS 6, and am running into a library issue. After fighting with the build script for a while I have got where running ./utils/build-script eventually gives:
+ /home/src/cmake-3.4.1-Linux-x86_64/bin/cmake --build /home/src/swift/build/Ninja-DebugAssert/cmark-linux-x86_64 -- all
ninja: no work to do.
llvm: using standard linker
+ cd /home/src/swift/build/Ninja-DebugAssert/llvm-linux-x86_64
+ /home/src/cmake-3.4.1-Linux-x86_64/bin/cmake -G Ninja -DCMAKE_C_COMPILER:PATH=clang -DCMAKE_CXX_COMPILER:PATH=clang++ '-DCMAKE_C_FLAGS= ' '-DCMAKE_CXX_FLAGS= ' -DCMAKE_BUILD_TYPE:STRING=Debug -DLLVM_ENABLE_ASSERTIONS:BOOL=TRUE -DLLVM_TOOL_SWIFT_BUILD:BOOL=NO '-DLLVM_TARGETS_TO_BUILD=X86;ARM;AArch64' -DLLVM_INCLUDE_TESTS:BOOL=TRUE -LLVM_INCLUDE_DOCS:BOOL=TRUE -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINTERNAL_INSTALL_PREFIX=local /home/src/swift/llvm
CMake Error at cmake/modules/CheckAtomic.cmake:36 (message):
Host compiler appears to require libatomic, but cannot find it.
Call Stack (most recent call first):
cmake/config-ix.cmake:296 (include)
CMakeLists.txt:403 (include)
-- Configuring incomplete, errors occurred!
See also "/home/src/swift/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeOutput.log".
See also "/home/src/swift/build/Ninja-DebugAssert/llvm-linux-x86_64/CMakeFiles/CMakeError.log".
./utils/build-script: command terminated with a non-zero exit status 1, aborting
(gcc-4.8.2 was what I compiled llvm with)
libatomic is there:
$ locate libatomic
/opt/gcc-4.8.2/lib64/libatomic.a
/opt/gcc-4.8.2/lib64/libatomic.la
/opt/gcc-4.8.2/lib64/libatomic.so
/opt/gcc-4.8.2/lib64/libatomic.so.1
/opt/gcc-4.8.2/lib64/libatomic.so.1.0.0
I just don't know how to tell the build system where to look. I have tried the usual CMAKE_LIBRARY_PATH (exporting on the command line - I am not sure if cmake works like the way LD_LIBRARY_PATH, LIBRARY_PATH work) but it can't seem to find it.
I also don't have root on the machine.
I had not tried building from source on CentOS 6 until I saw this question, but I have been able to build Swift 2.2 on CentOS 7.1 and Ubuntu 14.04, with partial success. A few things to think about:
You will need numerous dependencies required to build Swift, and unless
they happen to be already on the system, you will need root access to
install them.
Use -R flag with the build-script to create a release build.
Building in DebugAssert (the default) will require a lot of memory. In my case even 14 GB was not sufficient. A release build
can be done with about 6 GB.
As for your specific problem, it is related to Clang's dependency on GCC-related packages for headers and libraries. See, for example, Fedora 21 with clang, without gcc.
Even if you installed GCC 4.8.2 and adjusted the path to use gcc and g++ from 4.8.2, Clang may still be looking in the old GCC directories for headers and libraries. CMake first tries to compile a C++ test file that includes the header atomic, which does not exist in the old GCC. So, it then tries to link a C test program that uses the library libatomic, which again doesn't exist in the old GCC. You can see this by looking at llvm/cmake/modules/CheckAtomic.cmake mentioned by usr1234567. CMakeError.log and CMakeOutput.log can also provide valuable insight. BTW, when I was building Swift on CentOS 7.1, I didn't run into this problem because GCC 4.8.2 was used by Clang for headers and libraries and the atomic header was found, so the C++ file got compiled. However, had the libatomic check been done, it would have failed, because libatomic.so in the repository-provided 4.8.2 has INPUT ( <name of some non-existent file> ), so trying to link with libatomic errors out.
I'm sure there are various ways of dealing with this issue, but what solved the problem for me was setting the following environment variables, please adjust to your specific setup:
export CPLUS_INCLUDE_PATH=/opt/gcc-4.8.2/include/c++/4.8.2:/opt/gcc-4.8.2/include/c++/4.8.2/x86_64-unknown-linux-gnu
export LIBRARY_PATH=/opt/gcc-4.8.2/lib64:/opt/gcc-4.8.2/lib/gcc/x86_64-unknown-linux-gnu/4.8.2
Also make sure that your 4.8.2 version of libstdc++.so is available to the dynamic linker at runtime. Since you don't have root, do
export LD_LIBRARY_PATH=/opt/gcc-4.8.2/lib64
If you had root, you could use ldconfig.
Before you start building Swift, you may want to try building, using Clang, a simple C program linking it with libatomic (the code doesn't actually have to use any symbols from the lib) and a simple C++ program that includes the <atomic> header. When compiling the C++ program, use the -std=c++11 compiler flag. If the C++ program compiles successfully, then it is not necessary for the libatomic linking test to be successful.
Interestingly, the CMakeOutput.log file still did not report finding GCC 4.8.2 as a candidate GCC installation, but the configuration/build worked well past the error.
Hopefully this helps. Please let us know if you run into something else.
CheckAtomic.cmake seems to be part of LLVM. I found a file at Github and it tries to find '__atomic_fetch_add_4' from libatomic
check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC)
This fails for you. Check CMakeFiles/CMakeError.log to get more details why this test failed. Or try this line in a new project.
I have a Synology DS212j NAS (cpu Feroceon 88FR131 rev 1 (v5l)) with the optware ipkg installed. I am trying to build mongo-nonx86 on it.
"scons all" gives me the following messages:
scons: Reading SConscript files ...
scons version: 2.0.1
python version: 2 5 6 'final' 0
Checking whether the C++ compiler worksyes
Checking for C library stdc++... no
can't find stdc++ library which is needed
I have the stdc++ library installed, I also have ssl installed. My underlying question is how can I get scons to tell me more about what is really missing, where it is looking, how it is looking etc. I have so far found no options which generate any more useful diagnostic output?
Obviously a ready-made solution for getting mongodb working on this great little box would be even more welcome :-)
Well even if you do have it installed, it doesn't seem to think so, here is what I would try to do, install libssl-dev, then try to install the dev package for libstdc++, which is: libstdc++-dev.
Then see if you can compile it.
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.