Dlangui hello world program exit with non-zero code - d

I'm new to D and DlangUI, and I'm compiling a hello world app using DlangUI following the official wiki using vscode, I have edited the app.d file and run dub run, it shows Program exited with code -1073741701.
I have tried the following but have no luck:
dub upgrade --force-remove
dub build --force
remove dub.selections.json
Environment:
dmd: v2.100.2-dirty
dub: 1.29.2
os: Windows 10 Professional 21H1 (64bit)
Output of dub run:
bindbc-loader 1.0.1: target for configuration "noBC" is up to date.
bindbc-opengl 1.0.2: target for configuration "dynamic" is up to date.
derelict-util 3.0.0-beta.2: target for configuration "library" is up to date.
derelict-ft 2.0.0-beta.5: target for configuration "library" is up to date.
derelict-sdl2 3.0.0-beta.8: target for configuration "derelict-sdl2-dynamic" is up to date.
inilike 1.2.1: target for configuration "library" is up to date.
isfreedesktop 0.1.1: target for configuration "library" is up to date.
xdgpaths 0.2.5: target for configuration "library" is up to date.
icontheme 1.2.3: target for configuration "library" is up to date.
dlangui 0.9.187: target for configuration "default" is up to date.
helloworld ~master: building configuration "application"...
C:\Users\JinReal\AppData\Local\dub\packages\dlangui-0.9.187\dlangui\src\dlangui\graphics\resources.d(104,8): Deprecation: module `std.xml` is deprecated - Will be removed from Phobos in 2.101.0. If you still need it, go to https://github.com/DigitalMars/undeaD
C:\Users\JinReal\AppData\Local\dub\packages\dlangui-0.9.187\dlangui\src\dlangui\widgets\styles.d(28,16): Deprecation: module `std.xml` is deprecated - Will be removed from Phobos in 2.101.0. If you still need it, go to https://github.com/DigitalMars/undeaD
C:\Users\JinReal\AppData\Local\dub\packages\dlangui-0.9.187\dlangui\3rdparty\dimage\png.d(585,1): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
Linking...
To force a rebuild of up-to-date targets, run again with --force.
Copying files for dlangui...
Running helloworld.exe
Program exited with code -1073741701
Update #1:
Seems that it's a 64 bit build, and now I try a 32 bit build using dub build --arch=x86(as the comments suggest) it shows something different:
Performing "debug" build using D:\env\dmd2\windows\bin\dmd.exe for x86, x86_mscoff.
bindbc-loader 1.0.1: building configuration "noBC"...
derelict-ft 2.0.0-beta.5: building configuration "library"...
derelict-sdl2 3.0.0-beta.8: building configuration "derelict-sdl2-dynamic"...
inilike 1.2.1: building configuration "library"...
isfreedesktop 0.1.1: building configuration "library"...
xdgpaths 0.2.5: building configuration "library"...
icontheme 1.2.3: building configuration "library"...
dlangui 0.9.187: building configuration "default"...
C:\Users\JinReal\AppData\Local\dub\packages\dlangui-0.9.187\dlangui\3rdparty\dimage\png.d(585,1): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
C:\Users\JinReal\AppData\Local\dub\packages\dlangui-0.9.187\dlangui\src\dlangui\graphics\resources.d(104,8): Deprecation: module `std.xml` is deprecated - Will be removed from Phobos in 2.101.0. If you still need it, go to https://github.com/DigitalMars/undeaD
C:\Users\JinReal\AppData\Local\dub\packages\dlangui-0.9.187\dlangui\src\dlangui\widgets\styles.d(28,16): Deprecation: module `std.xml` is deprecated - Will be removed from Phobos in 2.101.0. If you still need it, go to https://github.com/DigitalMars/undeaD
helloworld ~master: building configuration "application"...
C:\Users\JinReal\AppData\Local\dub\packages\dlangui-0.9.187\dlangui\src\dlangui\graphics\resources.d(104,8): Deprecation: module `std.xml` is deprecated - Will be removed from Phobos in 2.101.0. If you still need it, go to https://github.com/DigitalMars/undeaD
C:\Users\JinReal\AppData\Local\dub\packages\dlangui-0.9.187\dlangui\src\dlangui\widgets\styles.d(28,16): Deprecation: module `std.xml` is deprecated - Will be removed from Phobos in 2.101.0. If you still need it, go to https://github.com/DigitalMars/undeaD
C:\Users\JinReal\AppData\Local\dub\packages\dlangui-0.9.187\dlangui\3rdparty\dimage\png.d(585,1): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
Linking...
lld-link: error: unknown directive: EXETYPE
Error: linker exited with status 1
I've read this post and found that there's no sourceFiles-windows entry in it so it doesn't seem to be the same issue.

Related

Cake Addins install fail error during build

I am using net 4.8 framework. and cake version 0.38.2.
During build in Teamcity, it has to install addins cake.npm, cake.filehelpers. But following error happens
Could not find any assemblies compatible with .NETFramework,Version=v4.6.1.
Error: Failed to install addin 'Cake.Npm'.
When I use cake.npm version as 0.17.0 for cake 0.38.2, it generates two folders - cake.npm and cake.npm0.17.0. Only cake npm0.17.0 is required, because it has netstandard2.0 which can make build successful. But the other folder makes it fail
As discussed in https://github.com/cake-contrib/Cake.Npm/issues/140 Cake.Npm is not the culprit, here.
There is an additional (#load) reference in the project to Cake.Sitecore in version 1.0.3 which in contents/scripts/tasks.restore.cake contains the line
#addin "Cake.Npm"
This - without an explicit version being set - will always default to the newest version (currently 2.0.0, which is incompatible with Cake 0.38.2).
The current version of Cake.Sitecore (1.0.27) has that problem fixed.

Build and run a Qt application on macOS via Bazel

I tried to build and run a Qt5 (5.15.2) application on macOS (10.15.7) using Bazel 5.0.0.
Unfortunately, I run into some problems.
The building part seems to work, but not the run part.
I installed Qt5 on my machine using Homebrew:
brew install qt#5
brew link qt#5
I adapted https://github.com/justbuchanan/bazel_rules_qt/ to my needs. See this PR. When I try to run:
bazel run --cxxopt=-std=c++17 //tests/qt_resource:main
I receive the runtime error:
dyld: Symbol not found: __ZN10QByteArray6_emptyE
Steps to reproduce the issue:
# brew install bazel # Install Bazel
# brew install qt#5 # Install Qt5
git clone https://github.com/Vertexwahn/bazel_rules_qt.git
cd bazel_rules_qt
git checkout add-macos-support
bazel build --cxxopt=-std=c++17 //... # should work
bazel run --cxxopt=-std=c++17 //tests/qt_resource:main # should give you the error message
Nevertheless, building everything using bazel build --cxxopt=-std=c++17 //... seems to work.
I am not 100% sure if the link options -F/usr/local/opt/qt5/Frameworks and -framework QtCore, etc. are correct.
Maybe someone can confirm this.
Did I use the correct link options?
For me, it is a bit unclear what dependencies the main binary expects. I tried to copy QtCore.framework to the location of the main binary manually but this does not change the error message.
What files does the main binary expect?
If I try to run macdeployqt on my main binary I get also some errors. I do within my workspace root dir a cd bazel-bin/tests/qt_resource and run then /usr/local/opt/qt5/bin/macdeployqt main:
ERROR: Could not find bundle binary for "main"
ERROR: "error: /Library/Developer/CommandLineTools/usr/bin/otool-classic: can't open file: (No such file or directory)\n"
ERROR: "error: /Library/Developer/CommandLineTools/usr/bin/otool-classic: can't open file: (No such file or directory)\n"
ERROR: "error: /Library/Developer/CommandLineTools/usr/bin/otool-classic: can't open file: (No such file or directory)\n"
WARNING:
WARNING: Could not find any external Qt frameworks to deploy in "main"
WARNING: Perhaps macdeployqt was already used on "main" ?
WARNING: If so, you will need to rebuild "main" before trying again.
ERROR: Could not find bundle binary for "main"
ERROR: "error: /Library/Developer/CommandLineTools/usr/bin/strip: can't open file: (No such file or directory)\n"
ERROR: ""
My hope was that macdeployqt would collect all needed resources for me. Any idea why this is not working?
How can macdeployqt be used to collect all needed dependencies for the main binary?
If I convert my main to an app via lipo -create -output universall_app main and do then a /usr/local/opt/qt5/bin/macdeployqt universall_app I get the same error message.
The CMake approach
To make sure that there is no general problem with my system setup I tried to use CMake to build a Qt5 application:
git clone https://github.com/euler0/mini-cmake-qt.git
cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 .
make -j
This produces an example.app.
With a double click on this application bundle,
the application can be started.
This worked on my system.
Future directions
It seems that rules_apple can be used to create an application bundle.
I am not sure if I need to transform my Qt application binary to an app bundle to be able to execute it.
One could use --sandbox_debugto identify what Bazel is doing and dtruss for the CMake version to compare the differences.
I am currently not sure what trying to do next and hope for an easy solution. I am also fine with a Qt6 solution.
Update: Alternative Answer
It would also be helpful if someone can point out how to build a minimal Qt application using make only on macOS and a brew installed Qt5 or tell me what the linker and compiler options must look like.
I followed your steps with Mac OSX 10.15.7, Qt (installed by homebrew) 5.15.1 and both bazel 4.2.2-homebrew and 5.0.0-homebrew and initially I could not build the project from git:
* 3fe5f6c - (4 weeks ago) Add macOS support — Vertexwahn (HEAD -> add-macos-support, origin/add-macos-support)
This is the result that I get when building:
% bazel build --cxxopt=-std=c++17 //...
DEBUG: /private/var/tmp/_bazel_home/761aafaa2237a9607dd915f1f52bca3e/external/com_justbuchanan_rules_qt/qt_configure.bzl:43:14: Installation available on the default path: /usr/local/opt/qt5
INFO: Analyzed 14 targets (0 packages loaded, 0 targets configured).
INFO: Found 14 targets...
ERROR: /Users/home/Git/my_repo/bazel_rules_qt/tests/qt_qml/BUILD:4:10: Compiling tests/qt_qml/main.cc failed: (Aborted): wrapped_clang failed: error executing command external/local_config_cc/wrapped_clang '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -O0 -DDEBUG '-std=c++11' ... (remaining 38 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
tests/qt_qml/main.cc:1:10: fatal error: 'QtQml/QQmlApplicationEngine' file not found
#include <QtQml/QQmlApplicationEngine>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Error in child process '/usr/bin/xcrun'. 1
INFO: Elapsed time: 0,594s, Critical Path: 0,32s
INFO: 3 processes: 3 internal.
FAILED: Build did NOT complete successfully
After playing around with headers and include paths in qt.BUILD:
diff --git a/qt.BUILD b/qt.BUILD
index 517c8db..8f110b5 100644
--- a/qt.BUILD
+++ b/qt.BUILD
## -28,11 +28,12 ## QT_LIBRARIES = [
cc_library(
name = "qt_%s_osx" % name,
# When being on Windows this glob will be empty
- hdrs = glob(["%s/**" % include_folder], allow_empty = True),
+ hdrs = glob(["include/%s/**" % include_folder], allow_empty = True),
includes = ["."],
linkopts = ["-F/usr/local/opt/qt5/lib"] + [
"-framework %s" % library_name.replace("5", "") # macOS qt libs do not contain a 5 - e.g. instead of Qt5Core the lib is called QtCore
],
+ strip_include_prefix= "include"
# Available from Bazel 4.0.0
# target_compatible_with = ["#platforms//os:osx"],
)
I could build and run the project:
% bazel build --cxxopt=-std=c++17 //...
DEBUG: /private/var/tmp/_bazel_home/761aafaa2237a9607dd915f1f52bca3e/external/com_justbuchanan_rules_qt/qt_configure.bzl:43:14: Installation available on the default path: /usr/local/opt/qt5
INFO: Analyzed 14 targets (1 packages loaded, 7422 targets configured).
INFO: Found 14 targets...
INFO: Elapsed time: 11,761s, Critical Path: 7,23s
INFO: 3 processes: 1 internal, 2 darwin-sandbox.
INFO: Build completed successfully, 3 total actions
% bazel run --cxxopt=-std=c++17 //tests/qt_resource:main
DEBUG: /private/var/tmp/_bazel_home/761aafaa2237a9607dd915f1f52bca3e/external/com_justbuchanan_rules_qt/qt_configure.bzl:43:14: Installation available on the default path: /usr/local/opt/qt5
INFO: Analyzed target //tests/qt_resource:main (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //tests/qt_resource:main up-to-date:
bazel-bin/tests/qt_resource/main
INFO: Elapsed time: 3,657s, Critical Path: 0,00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
opened resource file
file1
Related to your question whether the linker options are correct
-F/usr/local/opt/qt5/Frameworks -framework QtCore
Yes they are correct, you could alternatively use -F/usr/local/opt/qt5/lib (as you are already using in qt.BUILD) as all the files under the Frameworks folder are links to the lib folder.
With macdeployqt and lipo I get the same results as in the OP even after the test is running successfully.

Trouble installing Boost on Windows 10

I'm stuck trying to install Boost (1.55) on Windows 10 (pro)
I have been following the instructions here link
And I'm not sure what is supposed to happen at/after this stage:
C:\Users\Sak09\Downloads\boost_1_55_0\boost_1_55_0\tools\build\v2>b2 --build-dir="C:\Boost\" toolset=msvc --build-type= complete stage
warning: the --build-dir option was specified
warning: but Jamroot at '.'
warning: specified no project id
warning: the --build-dir option will be ignored
warning: No toolsets are configured.
warning: Configuring default toolset "msvc".
warning: If the default is wrong, your build may not work correctly.
warning: Use the "toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html
...found 580 targets...
C:\Users\Sak09\Downloads\boost_1_55_0\boost_1_55_0\tools\build\v2>b2 toolset=msvc --build-type=complete stage
notice: could not find main target stage
notice: assuming it is a name of file to create.
don't know how to make <e>stage
...found 1 target...
...can't find 1 target...
C:\Users\Sak09\Downloads\boost_1_55_0\boost_1_55_0\tools\build\v2>b2 --build-type=complete msvc stage
warning: No toolsets are configured.
warning: Configuring default toolset "msvc".
warning: If the default is wrong, your build may not work correctly.
warning: Use the "toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html
notice: could not find main target stage
notice: assuming it is a name of file to create.
don't know how to make <e>stage
...found 1 target...
...can't find 1 target...
Any help is very much appreciated. I'm trying to setup dev stuff in Windows after a decade and I'm really struggling with this.
Tried the same instructions with Boost version 1.60 and it just worked. So yeah some compatibility issue with VS2017 and older versions of Boost. Thanks everyone for the suggestioons.

Alamofire- getting 'No such module' error after successful Pod install

Xcode 8, Swift3, cocoapods 1.1+, ios10
I'm getting error - No such module. Below is my pod file and steps I followed. I even looked at same issues from previous versions and solutions mentioned in other threads didn't work.
Setup
Fresh, brand new Xcode 8 project.
Added Alamofire to my Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target ‘weatherkaka’ do
pod 'Alamofire', '~> 4.0'
end
Ran the command $ pod install
Install worked fine, and project compiles via workspace file
Opened xcworkspace file
Import: import AlamoFire
I get the error: "No such module: Alamofire".
What am I missing?
Note: I've done clean, re-open Xcode, clean more, re-compile etc. I've added the Alamofire framework to Linked Frameworks and Build phases.
You might get this error for the first time but try to run that project once and it might go away. Also you can command+click the import Alamofire and check that it points to the Alamofire.
You must be using projectName.xcworkspace not the xcodeproj.

Can't build Boost 1.59 error: feature "deduced-address-model" : "32" "64" : "propagated" "optional" "composite" "hidden"

I unsuccessfully trying to build boost under osx
What I tried
git checkout boost-1.59.0
./bootstrap.sh
Building Boost.Build engine with toolset darwin... tools/build/src/engine/bin.macosxx86_64/b2
Detecting Python version... 2.7
Detecting Python root... /System/Library/Frameworks/Python.framework/Versions/2.7
Unicode/ICU support for Boost.Regex?... not found.
Generating Boost.Build configuration in project-config.jam...
Bootstrapping is done. To build, run:
./b2
To adjust configuration, edit 'project-config.jam'.
Further information:
- Command line help:
./b2 --help
- Getting started guide:
http://www.boost.org/more/getting_started/unix-variants.html
- Boost.Build documentation:
http://www.boost.org/build/doc/html/index.html
./b2
/Volumes/Data/Developers/Library/boost/tools/build/src/build/feature.jam:139: in feature.feature from module feature
error: unknown attributes: hidden
error: in feature declaration:
error: feature "deduced-address-model" : "32" "64" : "propagated" "optional" "composite" "hidden"
/Volumes/Data/Developers/Library/boost/boostcpp.jam:611: in load from module boostcpp
/Volumes/Data/Developers/Library/boost/tools/build/src/kernel/modules.jam:289: in modules.import from module modules
/Volumes/Data/Developers/Library/boost/tools/build/src/build/project.jam:1024: in import from module Jamfile</Volumes/Data/Developers/Library/boost>
Jamroot:124: in modules.load from module Jamfile</Volumes/Data/Developers/Library/boost>
/Volumes/Data/Developers/Library/boost/tools/build/src/build/project.jam:311: in load-jamfile from module project
/Volumes/Data/Developers/Library/boost/tools/build/src/build/project.jam:64: in load from module project
/Volumes/Data/Developers/Library/boost/tools/build/src/build/project.jam:145: in project.find from module project
/Volumes/Data/Developers/Library/boost/tools/build/src/build-system.jam:535: in load from module build-system
/Volumes/Data/Developers/Library/boost/tools/build/src/kernel/modules.jam:289: in import from module modules
/Volumes/Data/Developers/Library/boost/tools/build/src/kernel/bootstrap.jam:139: in boost-build from module
/Volumes/Data/Developers/Library/boost/boost-build.jam:17: in module scope from module
So can someone explain what this error means? How to fix it?
* Solution *
I forgot to update submodules, my fault
No that is really strange!
What commands are you passing to build? (or is that literally the default?)
I recommend trying out one of my build scripts here:
https://github.com/danoli3/ofxOSXBoost
If that doesn't work either it may be a system conflict.
Do you have Homebrew or Macports installed? See if they have a Boost version installed.