Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot Build when including DvAvOpenhomeOrgVolume1Std
29-10-2015, 07:10 PM (This post was last modified: 30-10-2015 08:53 AM by Trolley01.)
Post: #1
Cannot Build when including DvAvOpenhomeOrgVolume1Std
I'm having trouble getting an implementation of the Volume provider to build. I have the following simple class defined, and get an error when building about an undefined reference. Do I need to include another header file somewhere?

The code that I am using and trying to build is:

Code:
#include <OpenHome/Net/Cpp/DvDevice.h>
#include <OpenHome/Net/Cpp/DvAvOpenhomeOrgVolume1.h>

namespace OpenHome{
    namespace Av {
        class OhVolumeProvider : public OpenHome::Net::DvProviderAvOpenhomeOrgVolume1Cpp {
            public:
                OhVolumeProvider(OpenHome::Net::DvDeviceStdStandard& aDevice);
                ~OhVolumeProvider();
            private:
        };
    }; //Av
}; //OpenHome



using namespace OpenHome;
using namespace OpenHome::Net;
using namespace OpenHome::Av;

OpenHome::Av::OhVolumeProvider::OhVolumeProvider(OpenHome::Net::DvDeviceStdStand​ard& aDevice): DvProviderAvOpenhomeOrgVolume1Cpp(aDevice) {
}

OhVolumeProvider::~OhVolumeProvider() {
    
}


The results that I get when I build are:

Code:
/bin/sh -c '/usr/bin/make -j2 -e -f  Makefile'
----------Building project:[ testincludes - Debug ]----------
make[1]: Entering directory `/home/craig/Documents/sc-devices/testincludes'
make[1]: Leaving directory `/home/craig/Documents/sc-devices/testincludes'
make[1]: Entering directory `/home/craig/Documents/sc-devices/testincludes'
/usr/bin/g++  -c  "/home/craig/Documents/sc-devices/testincludes/sc-OhVolume.cpp" -g -O0 -Wall  -o ./Debug/sc-OhVolume.cpp.o -I. -I. -I/home/craig/Documents/openhome_source/ohNetGenerated/Build/Include -I/home/craig/Documents/openhome_source/openhome_source/Build/Include
/usr/bin/g++ -o ./Debug/testincludes @"testincludes.txt" -L. -L/home/craig/Documents/openhome_source/ohNetGenerated/Build/Obj/Posix/Release -L/home/craig/Documents/openhome_source/openhome_source/Build/Obj/Posix/Release  -lohNetGeneratedDevices -lohNetGeneratedProxies -lohNetCore -lpthread -lTestFramework
/home/craig/Documents/openhome_source/ohNetGenerated/Build/Obj/Posix/Release/libohNetGeneratedDevices.a(DvAvOpenhomeOrgVolume1Std.o): In function `OpenHome::Net::DvProviderAvOpenhomeOrgVolume1Cpp::EnablePropertyVolume()':
/home/craig/Documents/openhome_source/ohNetGenerated/OpenHome/Net/Bindings/Cpp/Device/Providers/DvAvOpenhomeOrgVolume1Std.cpp:162: undefined reference to `OpenHome::Net::PropertyUint::PropertyUint(OpenHome::Net::Parameter*)'
/home/craig/Documents/openhome_source/ohNetGenerated/Build/Obj/Posix/Release/libohNetGeneratedDevices.a(DvAvOpenhomeOrgVolume1Std.o): In function `OpenHome::Net::DvProviderAvOpenhomeOrgVolume1Cpp::EnablePropertyMute()':
/home/craig/Documents/openhome_source/ohNetGenerated/OpenHome/Net/Bindings/Cpp/Device/Providers/DvAvOpenhomeOrgVolume1Std.cpp:168: undefined reference to `OpenHome::Net::PropertyBool::PropertyBool(OpenHome::Net::Parameter*)'
/home/craig/Documents/openhome_source/ohNetGenerated/Build/Obj/Posix/Release/libohNetGeneratedDevices.a(DvAvOpenhomeOrgVolume1Std.o): In function `OpenHome::Net::DvProviderAvOpenhomeOrgVolume1Cpp::EnablePropertyBalance()':
/home/craig/Documents/openhome_source/ohNetGenerated/OpenHome/Net/Bindings/Cpp/Device/Providers/DvAvOpenhomeOrgVolume1Std.cpp:174: undefined reference to `OpenHome::Net::PropertyInt::PropertyInt(OpenHome::Net::Parameter*)'
/home/craig/Documents/openhome_source/ohNetGenerated/Build/Obj/Posix/Release/libohNetGeneratedDevices.a(DvAvOpenhomeOrgVolume1Std.o): In function `OpenHome::Net::DvProviderAvOpenhomeOrgVolume1Cpp::EnablePropertyFade()':
/home/craig/Documents/openhome_source/ohNetGenerated/OpenHome/Net/Bindings/Cpp/Device/Providers/DvAvOpenhomeOrgVolume1Std.cpp:180: undefined reference to `OpenHome::Net::PropertyInt::PropertyInt(OpenHome::Net::Parameter*)'
/home/craig/Documents/openhome_source/ohNetGenerated/Build/Obj/Posix/Release/libohNetGeneratedDevices.a(DvAvOpenhomeOrgVolume1Std.o): In function `OpenHome::Net::DvProviderAvOpenhomeOrgVolume1Cpp::EnablePropertyVolumeLimit()':​
/home/craig/Documents/openhome_source/ohNetGenerated/OpenHome/Net/Bindings/Cpp/Device/Providers/DvAvOpenhomeOrgVolume1Std.cpp:186: undefined reference to `OpenHome::Net::PropertyUint::PropertyUint(OpenHome::Net::Parameter*)'
/home/craig/Documents/openhome_source/ohNetGenerated/Build/Obj/Posix/Release/libohNetGeneratedDevices.a(DvAvOpenhomeOrgVolume1Std.o): In function `OpenHome::Net::DvProviderAvOpenhomeOrgVolume1Cpp::EnablePropertyVolumeMax()':
/home/craig/Documents/openhome_source/ohNetGenerated/OpenHome/Net/Bindings/Cpp/Device/Providers/DvAvOpenhomeOrgVolume1Std.cpp:192: undefined reference to `OpenHome::Net::PropertyUint::PropertyUint(OpenHome::Net::Parameter*)'
/home/craig/Documents/openhome_source/ohNetGenerated/Build/Obj/Posix/Release/libohNetGeneratedDevices.a(DvAvOpenhomeOrgVolume1Std.o): In function `OpenHome::Net::DvProviderAvOpenhomeOrgVolume1Cpp::EnablePropertyVolumeUnity()':​
/home/craig/Documents/openhome_source/ohNetGenerated/OpenHome/Net/Bindings/Cpp/Device/Providers/DvAvOpenhomeOrgVolume1Std.cpp:198: undefined reference to `OpenHome::Net::PropertyUint::PropertyUint(OpenHome::Net::Parameter*)'
/home/craig/Documents/openhome_source/ohNetGenerated/Build/Obj/Posix/Release/libohNetGeneratedDevices.a(DvAvOpenhomeOrgVolume1Std.o): In function `OpenHome::Net::DvProviderAvOpenhomeOrgVolume1Cpp::EnablePropertyVolumeSteps()':​
/home/craig/Documents/openhome_source/ohNetGenerated/OpenHome/Net/Bindings/Cpp/Device/Providers/DvAvOpenhomeOrgVolume1Std.cpp:204: undefined reference to `OpenHome::Net::PropertyUint::PropertyUint(OpenHome::Net::Parameter*)'
/home/craig/Documents/openhome_source/ohNetGenerated/Build/Obj/Posix/Release/libohNetGeneratedDevices.a(DvAvOpenhomeOrgVolume1Std.o): In function `OpenHome::Net::DvProviderAvOpenhomeOrgVolume1Cpp::EnablePropertyVolumeMilliDbPe​rStep()':
/home/craig/Documents/openhome_source/ohNetGenerated/OpenHome/Net/Bindings/Cpp/Device/Providers/DvAvOpenhomeOrgVolume1Std.cpp:210: undefined reference to `OpenHome::Net::PropertyUint::PropertyUint(OpenHome::Net::Parameter*)'
/home/craig/Documents/openhome_source/ohNetGenerated/Build/Obj/Posix/Release/libohNetGeneratedDevices.a(DvAvOpenhomeOrgVolume1Std.o):/home/craig/Documents/openhome_source/ohNetGenerated/OpenHome/Net/Bindings/Cpp/Device/Providers/DvAvOpenhomeOrgVolume1Std.cpp:216: more undefined references to `OpenHome::Net::PropertyUint::PropertyUint(OpenHome::Net::Parameter*)' follow
collect2: error: ld returned 1 exit status
make[1]: *** [Debug/testincludes] Error 1
make[1]: Leaving directory `/home/craig/Documents/sc-devices/testincludes'
make: *** [All] Error 2
====10 errors, 0 warnings====
Find all posts by this user
30-10-2015, 05:11 PM
Post: #2
RE: Cannot Build when including DvAvOpenhomeOrgVolume1Std
(29-10-2015 07:10 PM)Trolley01 Wrote:  I'm having trouble getting an implementation of the Volume provider to build. I have the following simple class defined, and get an error when building about an undefined reference. Do I need to include another header file somewhere?

The errors are at link rather than compile time so are related to the libraries you're linking to, or their contents. Your code and headers included look fine.

I'm not immediately sure what's causing your errors. Are you using the latest code from both the ohNet and ohNetGenerated repos? Can you post the makefile you're using to build?
Find all posts by this user
30-10-2015, 05:22 PM
Post: #3
RE: Cannot Build when including DvAvOpenhomeOrgVolume1Std
There isn't a makefile per se as it is being built using CodeLite using the options specified.

This was done using a clone of the repository from a couple of days ago.

Is there a built set of OhNetGenerated libraries that I can download from somewhere to test with? Would rule out the build process on my machine then.

I might try starting from scratch, re-cloning the repo and seeing what happens.
Find all posts by this user
02-11-2015, 12:02 PM
Post: #4
RE: Cannot Build when including DvAvOpenhomeOrgVolume1Std
(30-10-2015 05:22 PM)Trolley01 Wrote:  Is there a built set of OhNetGenerated libraries that I can download from somewhere to test with? Would rule out the build process on my machine then.

You can fetch generated binaries from the ohNet and ohNetGenerated directories under http://www.openhome.org/releases/artifacts/ . The easiest way to guarantee a compatible set of libraries would be to choose the latest code for ohNetGenerated and build it yourself using the ohNet binaries it declares a dependency on. (i.e. see ohNetGenerated's README for details on running 'go fetch')
Find all posts by this user
11-11-2015, 06:14 PM
Post: #5
RE: Cannot Build when including DvAvOpenhomeOrgVolume1Std
I've just given it a try using the pre-built libraries that I downloaded. The files that I used were:

ohNet-1.4.1808-Linux-x64-Release.tar.gz
ohNetGenerated-1.0.81-Linux-x64-Release.tar.gz

I got exactly the same errors as what I got when I used the libraries that I compiled myself.

Any further ideas what I am missing?

Thanks,
Find all posts by this user
25-11-2015, 01:23 PM
Post: #6
RE: Cannot Build when including DvAvOpenhomeOrgVolume1Std
Hi,

Just wondering if anyone else is able to replicate this issue? I have downloaded the files again, rebuilt, and still getting the same problems.

The next thing that I am going to have to try is setting up a new vm as my dev environment in case I have something wrong in there.
Find all posts by this user
25-11-2015, 01:53 PM
Post: #7
RE: Cannot Build when including DvAvOpenhomeOrgVolume1Std
(25-11-2015 01:23 PM)Trolley01 Wrote:  Hi,

Just wondering if anyone else is able to replicate this issue? I have downloaded the files again, rebuilt, and still getting the same problems.

The next thing that I am going to have to try is setting up a new vm as my dev environment in case I have something wrong in there.

Sorry, I still can't reproduce your problems. Rather than re-installing your VM, could you try creating a simple makefile that demonstrates the problem please? If you can provide a reproducible test case, it should be easy for us to diagnose the problem.
Find all posts by this user
26-11-2015, 09:27 PM (This post was last modified: 26-11-2015 09:30 PM by Trolley01.)
Post: #8
RE: Cannot Build when including DvAvOpenhomeOrgVolume1Std
(25-11-2015 01:53 PM)simonc Wrote:  Sorry, I still can't reproduce your problems. Rather than re-installing your VM, could you try creating a simple makefile that demonstrates the problem please? If you can provide a reproducible test case, it should be easy for us to diagnose the problem.

Here we go. I have attached a package containing a makefile and some simple code to demonstrate.

I have just tried this with the latest prebuilt packages and am getting the same issue.


Attached File(s)
.gz  testincludes.tar.gz (Size: 1.12 KB / Downloads: 3)
Find all posts by this user
23-12-2015, 04:53 PM
Post: #9
RE: Cannot Build when including DvAvOpenhomeOrgVolume1Std
(26-11-2015 09:27 PM)Trolley01 Wrote:  
(25-11-2015 01:53 PM)simonc Wrote:  Sorry, I still can't reproduce your problems. Rather than re-installing your VM, could you try creating a simple makefile that demonstrates the problem please? If you can provide a reproducible test case, it should be easy for us to diagnose the problem.

Here we go. I have attached a package containing a makefile and some simple code to demonstrate.

I have just tried this with the latest prebuilt packages and am getting the same issue.

Very late reply but just in case the issue is still relevant, you can fix it by changing the order and number of libraries you link to:
Code:
-lpthread -lohNetGeneratedDevices -lohNetGeneratedProxies -lTestFramework -lohNetCore
Find all posts by this user
23-12-2015, 06:06 PM
Post: #10
RE: Cannot Build when including DvAvOpenhomeOrgVolume1Std
Thanks Simon, I hadn't realised that the order was so important.

The actual order that I had to use in the makefile that I sent as a sample was

-lohNetGeneratedDevices -lohNetGeneratedProxies -lTestFramework -lohNetCore -lpthread

Thanks again,
Find all posts by this user


Forum Jump: