Unable to run D program on mac system when using dependency - d

I am pretty new to D language. I am working on existing code developed by others. Previous developers were using linux environment to build and run the D Application.
I am trying to do the same in MAC as it is my local environment.
Here is how my jub.json file looks like
{
"name" : "dsmasher",
"description" : "Hello World - A minimal DUB bundle.",
"dependencies" : {
"d2sqlite3": "~>0.9.7",
"botan": "~>1.12.9"
}
}
The program is very simple
import std.stdio;
int main () {
return 0;
}
But when I build it throws following errors.
/Library/D/dmd/src/druntime/import/object.d(3440,23): Error: template memutils.refcounted.RefCounted!(X509CertificateImpl, ThreadMem).RefCounted.opCast does not match any template declaration
/Library/D/dmd/src/druntime/import/object.d(3440,49): Error: template memutils.refcounted.RefCounted!(X509CertificateImpl, ThreadMem).RefCounted.opCast does not match any template declaration
/Library/D/dmd/src/druntime/import/object.d(3441,39): Error: template memutils.refcounted.RefCounted!(X509CertificateImpl, ThreadMem).RefCounted.opCast does not match any template declaration
../../../.dub/packages/memutils-0.4.9/memutils/source/memutils/vector.d(790,10): Error: template instance object.__equals!(const(RefCounted!(X509CertificateImpl, ThreadMem)), const(RefCounted!(X509CertificateImpl, ThreadMem))) error instantiating
../../../.dub/packages/memutils-0.4.9/memutils/source/memutils/helpers.d(71,27): instantiated from here: opEquals!()
../../../.dub/packages/botan-1.12.9/botan/source/botan/tls/server.d(689,38): instantiated from here: opEquals!(RefCounted!(Vector!(RefCounted!(X509CertificateImpl, ThreadMem), ThreadMem), ThreadMem))
/Library/D/dmd/bin/dmd failed with exit code 1.
^^^ Terminated, exit code: 2 ^^^
************ Build terminated. ************
I am using dmd compiler for this.
Please help if you have any idea.

This appears to be a bug in Botan. According to Travis CI, their build fails with the same message.

Related

Is it possible to use Kotlin Native on macOS 10.12?

I'm trying to port a simple Go macOS application over to Kotlin Native. After struggling with various errors I decided to take a step back, and have a look at the official examples provided with Kotlin Native.
I found a basic OpenGL example here:
https://github.com/JetBrains/kotlin-native/tree/master/samples/opengl
But so far I haven't been able to get this to compile.
I tried downloading the complete sources for Kotlin, but that wont build. I followed a few suggestions generated at build time, including the change to 'ignoreXcodeVersionCheck' and downloading prebuilt binaries for the compiler, but at this point I'm wondering if this just isn't supported by my environment? I do understand that this is all experimental.
I've attached a sample of errors below, but I'm not sure whats relevant.
Question: Does anyone else have this setup / environment working please? can I expect to get it working?
macos 10.12.4, kotlin 1.3.11, xcode 8.2.1
.konan/dependencies/clang-llvm-6.0.1-darwin-macos/include/c++/v1/cmath:551:28: error: expected a qualified name after 'typename'
_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
.konan/dependencies/clang-llvm-6.0.1-darwin-macos/include/c++/v1/cstddef:44:15: fatal error: 'stddef.h' file not found
#include_next <stddef.h>
A problem occurred evaluating root project 'kotlin-native-master'.
expected Xcode version 10.1, got 8.2.1, consider updating Xcode or use "ignoreXcodeVersionCheck" variable in konan.properties
kotlin-native-master/runtime/src/main/cpp/ObjCExportErrors.mm:73:23: error: no type or protocol named 'NSErrorUserInfoKey'
NSMutableDictionary<NSErrorUserInfoKey, id>* userInfo = [[NSMutableDictionary new] autorelease];
.konan/dependencies/clang-llvm-6.0.1-darwin-macos/include/c++/v1/cmath:313:9: error: no member named 'signbit' in the global namespace
using ::signbit;
I did manage to get a "hello world" working under the above environment, but I have given up with the OpenGL stuff. I cant update my environment currently, and I guess this issue doesn't affect many people. So I'm going to close it with this 'answer'.

Slick 3.0.0 and Scala 2.10.4

I was trying to create a scala program with slick 3.0 and I am getting the following error:
Error:scalac: bad symbolic reference. A signature in BasicDriver.class refers to term typesafe
in package com which is not available.
It may be completely missing from the current classpath, or the version on
the classpath might be incompatible with the version used when compiling BasicDriver.class.
I am using scala 2.10.4 and slick 2.10-3.0.0-RC1 and my IDE is IDEA 14.0.3 community edition
Any clue about this compilation error will be appreciated.
Thanks a lot!!!
This is how a BasicDriver.class defintion looks like
package scala.slick.profile
trait BasicDriver extends scala.AnyRef with scala.slick.profile.BasicProfile {
val profile : scala.slick.profile.BasicProfile = { /* compiled code */ }
override def toString() : java.lang.String = { /* compiled code */ }
final val driverConfig : com.typesafe.config.Config = { /* compiled code */ }
protected[this] def loadDriverConfig : com.typesafe.config.Config = { /* compiled code */ }
}
The error :
Error:scalac: bad symbolic reference. A signature in BasicDriver.class refers to term typesafe in package com which is not available. It may be completely missing from the current classpath, or the version on the classpath might be incompatible with the version used when compiling BasicDriver.class
is saying that com.typesafe for (com.typesafe.config.Config) is missing from the classpath .
I think the problem is with the dependencies added , try the master snapshot :
"com.typesafe.slick" % "slick_2.10" % "3.0.0-M1"

Haxe/C++ Compiiling "Fatal error: exception Failure("File not found compile.hxml")"

I am writing my first program on Haxe. I followed the instructions on the site for writing C++ code for Haxe but when I try to compile my program it says "Fatal error: exception Failure("File not found compile.hxml".
I typed "haxe compile.hxml" on the command prompt to compile my program.
I am using Sublime Editor to write the programs.
In my test.hx I have
class Test
{
static function main()
{
trace("Hello there");
}
}
In compile.hxml I have
-cpp cpp
-debug
-main Test
-D HXCPP_M64
I am using Windows 8, 64 bit.
Can you help me?

Adding XCTest unit tests to existing app doesn't work

I've added tests (XCTests) to an existing C++ command line app in Xcode 5
via Test Navigator > (+),
changed the extension of the test class to .mm,
added the XCTest framework to the project.
All compiles fine. Now running the tests just gives me a 'Test failed' message, nothing in the console and neither green nor red lights in the Navigator (i.e. no tests executed).
Starting with a fresh Xcode 5 project and changing the extension of the test class to .mm just works fine so I'd assume it's not just about lacking support for Objective-C++ in XCTest.
Even with a plain, vanilla test target added to the existing C++ project the tests fail before ever running.
Any more gotchas to watch out for when adding XCTests to existing (Objective-)C++ targets?
Update #1
With Xcode 5.0.2 (on 10.8.5) xctest now crashes in the same scenario with an
*** NSTask: Task create for path '/Users/XXX/Library/Developer/Xcode/DerivedData/RM_Next_Gen-gpihzjouhxvifqcslmywktktizer/Build/Products/Debug/YYY Tests.xctest/Contents/MacOS/YYY Tests' failed: 22, "Invalid argument". Terminating temporary process.
objc[3478]: GC: forcing GC OFF because OBJC_DISABLE_GC is set
*** multi-threaded process forked ***
Turns out it was a command line C++ project which apparently isn't currently supported by XCTest. Testing the C++ code from an Objective-C(++) project works just fine..
Just hoping for better documentation of XCTest at some point in the (near) future.
I couldn't find any documentation on using XCTest to test code that is not Objective C (C / C++). I am wanting to test a command line C project, and I was concerned that your answer suggested that doing this is unsupported by Xcode. I'm a novice to XCTest and TDD, but I thought others might appreciate what I discovered.
I created a New Project > Command Line Tool, based on C. Project is called foo; Xcode will call the target foo by default too.
-Files created: main.c
Add test target by going to Test Navigator > (+) > New Test Target. Call the target fooTests. Xcode will create this target and an example test within it (all within the file called fooTests.m). The example test will be called testExample and it will contain the test function below:
- (void)testExample
{
XCTFail(#"No implementation for \"%s\"", __PRETTY_FUNCTION__);
}
If you run the tests now (either from the Product>Test menu item or ⌘U) then the test will fail (it's supposed to). For the sake of brevity, I won't go through the TDD cycle, but simply list the files and contents that need to be added to test functions that are not within Objective-C classes.
Let's say that we have a function that we want to test, called bar(), and called from main.c. Go to the project file explorer and add a new header file called bar.h. Add the function prototype:
int bar();
If you want to use XCTest to test a function, it can't be in main.c, so add it to a new C Source file called bar.c. Important: when you add the file, you must add it to the target foo and to fooTests. if you don't add it to fooTests then when compiling the tests the linker won't find the function.
int bar() {
return 0;
}
Within fooTests.m, add the include:
#include "bar.h"
You can now refer to any function contained in bar.h within your tests. Now create 2 unit tests, one that will fail, the other that will pass.
Delete the method testExample and replace with the following code:
- (void)testBarWillFail
{
int rc = bar();
XCTAssertTrue(rc == -1, #"Expected rc==-1, rc==%d", rc);
}
- (void)testBarWillPass
{
int rc = bar();
XCTAssertTrue(rc == 0, #"Expected rc==0, rc==%d", rc);
}
Running the tests will produce the following in the debug window:
Test Suite 'All tests' finished at 2014-01-12 13:38:45 +0000.
Executed 2 tests, with 1 failure (0 unexpected) in 0.000
Within the Issue Navigator pane you'll see:
file: /foo/fooTests/fooTests.m: test failure: -[fooTests testBarWillFail] failed: ((rc == -1) is true) failed - Expected rc==-1, rc==0
This is all as expected! Repeat the process with all other C code you wish to test.
If anyone knows a better way of doing this then I'd be delighted to hear it!

Can't compile mongodb c++ driver Linux Centos 5.6

After installing the MongoDB, on the server-side, I attempted to configure my client which, resides on a CentOS 5.6 OS using the C++ driver code, from the link below:
http://dl.mongodb.org/dl/cxx-driver/
The install went well ! I worked through the tutorials with no problems but, at this point, I need to build this in with my group's build process. When I attempt to compile, I receive the following error:
/usr/local/include/mongo/base/error_codes.h:36: error: expected identifier before numeric constant
/usr/local/include/mongo/base/error_codes.h:36: error: expected '}' before numeric constant
....
At this point, I said to myself there must be another #define that is colliding with this code. So, I ran the g++ ... -E command and found that, in /usr/include/X11/X.h, there is a #define BadValue.
This seems weird to me because I would not expect this to happen if the code was enclosed in some namespace which error_codes.h is enclosed in the mongo namespace. So, I searched my entire filesystem looking for something like using namespace mongo thinking that the global namespace was polluted but, this is not the case. I do not see any instances of this occurring and I am wondering - because both of these are third-party - how to resolve.
Thoughts?