tamediadigital / librdkafka-d

11 stars 2 forks source link

dmd 2.071.2-1 linking fails #3

Closed yannick closed 7 years ago

yannick commented 7 years ago
consumer [master] dub build --config=application --arch=x86_64 --build=debug --compiler=dmd
Performing "debug" build using dmd for x86_64.
librdkafka 0.3.0: target for configuration "library" is up to date.
rdkafka-d ~master: target for configuration "library" is up to date.
consumer ~master: building configuration "application"...
Linking...
../../.dub/build/library-debug-linux.posix-x86_64-dmd_2071-B651453BF5E73E8303C5A8AA9DF3716A/librdkafka-d.a(topic_2ba_5b9.o): In function `_D8rdkafkad5topic14TopicPartition6__ctorMFNbNcNiPxaiZS8rdkafkad5
topic14TopicPartition':
/home/yannick/code/d/librdkafka-d/examples/consumer/../../source/rdkafkad/topic.d:44: multiple definition of `_D8rdkafkad5topic14TopicPartition6__ctorMFNbNcNiPxaiZS8rdkafkad5topic14TopicPartition'
../../.dub/build/library-debug-linux.posix-x86_64-dmd_2071-B651453BF5E73E8303C5A8AA9DF3716A/librdkafka-d.a(topic_2ba_5b9.o):../../source/rdkafkad/topic.d:(.text._D8rdkafkad5topic14TopicPartition6__ctorM
FNbNcNiPxaiZS8rdkafkad5topic14TopicPartition+0x0): first defined here
collect2: error: ld returned 1 exit status
--- errorlevel 1
dmd failed with exit code 1.
9il commented 7 years ago

OK, will see

yannick commented 7 years ago
consumer [master] ⚡ dub build --config=application --arch=x86_64 --build=debug --compiler=dmd --combined
Performing "debug" build using dmd for x86_64.
consumer ~master: building configuration "application"...
Linking...
.dub/build/application-debug-linux.posix-x86_64-dmd_2072-30CF61A8C7B6C23195BB4B079F43D84A/consumer.o: In function `_D8rdkafkad5topic14TopicPartition6__ctorMFNbNcNiPxaiZS8rdkafkad5topic14TopicPartition':
/home/yannick/code/d/librdkafka-d/examples/consumer/../../source/rdkafkad/topic.d:44: multiple definition of `_D8rdkafkad5topic14TopicPartition6__ctorMFNbNcNiPxaiZS8rdkafkad5topic14TopicPartition'
.dub/build/application-debug-linux.posix-x86_64-dmd_2072-30CF61A8C7B6C23195BB4B079F43D84A/consumer.o:../../../librdkafka/source/deimos/rdkafka.d:(.text._D8rdkafkad5topic14TopicPartition6__ctorMFNbNcNiPx
aiZS8rdkafkad5topic14TopicPartition+0x0): first defined here
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
dmd failed with exit code 1.

same for 2.072.0

yannick commented 7 years ago

problem are these constructors

    nothrow this(const(char)* topic, int partition)
    {
        topic_ = topic;
        partition_ = partition;
        offset_ = Offset.invalid;
        err_ = ErrorCode.no_error;
    }

    /// ditto
    this(const(char)* topic, int partition)
    {
        topic_ = topic;
        partition_ = partition;
        offset_ = Offset.invalid;
        err_ = ErrorCode.no_error;
    }

why is the no-throw even needed, the whole section is @nothrow?