Author Topic: Building New Media Player Device - Bizarre Compile Snafu  (Read 7584 times)

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Building New Media Player Device - Bizarre Compile Snafu
« on: November 25, 2007, 05:52:19 am »
After filling in the appropriate data in the web admin area, and running DCEGen to generate an appropriate set of files, I did a dependency make, and did a make bin, and got back the following spewage from GCC, I haven't injected any code into it yet... it should compile as is, right?

-Thom

Code: [Select]

dcerouter_41349:/home/src/lmce/src/MAME_Player# make bin
g++ -c -I.. -I../DCE -I/usr/include/mysql   -Wall -fPIC -ggdb3  Main.cpp -o Main.o
../Gen_Devices/MAME_PlayerBase.h: In constructor ‘DCE::MAME_Player_Event::MAME_Player_Event(int, std::string, bool)’:
../Gen_Devices/MAME_PlayerBase.h:35: error: ‘DEVICETEMPLATE_MAME_Player_CONST’ was not declared in this scope
../Gen_Devices/MAME_PlayerBase.h: In member function ‘virtual int DCE::MAME_Player_Data::GetPK_DeviceList()’:
../Gen_Devices/MAME_PlayerBase.h:72: error: ‘DEVICETEMPLATE_MAME_Player_CONST’ was not declared in this scope
../Gen_Devices/MAME_PlayerBase.h: In member function ‘virtual bool DCE::MAME_Player_Command::GetConfig()’:
../Gen_Devices/MAME_PlayerBase.h:167: error: ‘DEVICETEMPLATE_MAME_Player_CONST’ was not declared in this scope
../Gen_Devices/MAME_PlayerBase.h: In member function ‘virtual int DCE::MAME_Player_Command::PK_DeviceTemplate_get()’:
../Gen_Devices/MAME_PlayerBase.h:181: error: ‘DEVICETEMPLATE_MAME_Player_CONST’ was not declared in this scope
../Gen_Devices/MAME_PlayerBase.h: In static member function ‘static int DCE::MAME_Player_Command::PK_DeviceTemplate_get_static()’:
../Gen_Devices/MAME_PlayerBase.h:182: error: ‘DEVICETEMPLATE_MAME_Player_CONST’ was not declared in this scope
make: *** [Main.o] Error 1


Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Re: Building New Media Player Device - Bizarre Compile Snafu
« Reply #1 on: November 25, 2007, 08:16:17 am »
Could this be the same problem (and perhaps solution)? http://forum.linuxmce.org/index.php?topic=2304.msg11425#msg11425
"Change is inevitable. Progress is optional."
-- Anonymous


tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Building New Media Player Device - Bizarre Compile Snafu
« Reply #2 on: November 25, 2007, 08:19:28 am »
nope, it looks like a constant isn't being defined somewhere.. :-/

-Thom

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Re: Building New Media Player Device - Bizarre Compile Snafu
« Reply #3 on: November 25, 2007, 08:26:35 am »
If you could describe your steps so far (as in what to specify in the web-admin) then I can see if I get the same thing and maybe snoop around a bit.
"Change is inevitable. Progress is optional."
-- Anonymous


bulek

  • Administrator
  • wants to work for LinuxMCE
  • *****
  • Posts: 909
  • Living with LMCE
    • View Profile
Re: Building New Media Player Device - Bizarre Compile Snafu
« Reply #4 on: November 25, 2007, 11:39:33 am »
Hi,

maybe won't help much and do unrelated discussion, but some time ago when I compiled and contributed few things to Pluto ...

if you for instance try to add support for new event, someone from main developers has to add your new event to codebase and your event needed to be present in source code headers file in form of constant definition (quite similar to the constant definition you're missing). So under older system, you couldn't contribute if someone didn't help you in main source codebase (or you could do it if you had local copy of whole build system and did all your changes by yourself)...

Your problem seems quite similar to me. You probably added new template, but that template is not present in main database, so headers are still not properly generated...

Maybe you can try to search source code base for DEVICETEMPLATE_ keywords and you'll better see which do exists and where your should appear....

HTH,

regards,

Bulek.
« Last Edit: November 25, 2007, 11:41:25 am by bulek »
Thanks in advance,

regards,

Bulek.

PeteK

  • Guru
  • ****
  • Posts: 408
    • View Profile
Re: Building New Media Player Device - Bizarre Compile Snafu
« Reply #5 on: November 25, 2007, 07:45:43 pm »
Have you run sql2cpp?  It looks like you created a new template.  sql2cpp re-generates the header files to include any new declarations required based on your changes to templates, commands, etc.

You can also modify the header files manually in /src/pluto_main.  I would grep for DEVICETEMPLATE_ in that directory.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Building New Media Player Device - Bizarre Compile Snafu
« Reply #6 on: November 25, 2007, 07:56:21 pm »
PeteK: How should I run sql2cpp?

-Thom

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Building New Media Player Device - Bizarre Compile Snafu
« Reply #7 on: November 25, 2007, 08:01:09 pm »
n/m i got it...

however, i seem to be noticing a pattern here,

anything i am building with this checkout from svn is resulting in segfaults.... I built DCEGen from this checkout, and I get a segfault after the copyright/help messages

and when I run the ./MAME_Player device, I get...

Code: [Select]

dcerouter_41349:/home/src/lmce/src/MAME_Player# ./MAME_Player
MAME_Player, v.<=version=>
Visit www.plutohome.com for source code and license information

Segmentation fault (core dumped)
dcerouter_41349:/home/src/lmce/src/MAME_Player#


tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Building New Media Player Device - Bizarre Compile Snafu
« Reply #8 on: November 25, 2007, 08:07:52 pm »
and now... i added my device to the orbiter as child, and i get this from the log.. it looks like it's segfaulting out of the gate....

Code: [Select]
========== NEW LOG SECTION ==========
1       11/25/07 13:46:03       81 (spawning-device)    Starting... 7
1       11/25/07 13:46:03       81 (spawning-device)    Found ./MAME_Player
Return code: 139
3       11/25/07 13:46:03       81 (spawning-device)    Device died... count=7/50 dev=81
Sun Nov 25 13:46:03 EST 2007 died


 ??? ??? ??? :'(

-Thom

PeteK

  • Guru
  • ****
  • Posts: 408
    • View Profile
Re: Building New Media Player Device - Bizarre Compile Snafu
« Reply #9 on: November 25, 2007, 11:22:53 pm »
I'm actually trying to track down a similar problem right now.

When I execute my Insteon executable myself and pass it the -d [devicenumber] parameter, everything is hunky dory.  However, when I reload the router, it does not run the device correctly, and I'm not sure what the problem is.  Here is my log entry:


Code: [Select]
========== NEW LOG SECTION ==========
1 11/25/07 12:41:47 63 (spawning-device) Starting... 2
1 11/25/07 12:41:47 63 (spawning-device) Found ./Insteon
Return code: 126
3 11/25/07 12:41:47 63 (spawning-device) Device died... count=2/50 dev=63
Sun Nov 25 12:41:47 PST 2007 died
========== NEW LOG SECTION ==========


I realize that it's a different code than yours, but I wanted to let you know I'm seeing something similar, though I don't think it's Segfaulting, at least it seems to work fine when I run it by hand.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Building New Media Player Device - Bizarre Compile Snafu
« Reply #10 on: November 25, 2007, 11:25:37 pm »
an exit code of 126 indicates that the program can't be executed. It probably means it needs to be copied to /usr/pluto/bin and its permissions checked.

My exit code of 139, however...indicates segfault... AIIIIGGGHHHHHHHH!!!!!!

-Thom

PeteK

  • Guru
  • ****
  • Posts: 408
    • View Profile
Re: Building New Media Player Device - Bizarre Compile Snafu
« Reply #11 on: November 25, 2007, 11:28:03 pm »
Nice to know.  So where is the exit code list?

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Building New Media Player Device - Bizarre Compile Snafu
« Reply #12 on: November 26, 2007, 09:53:50 am »
anything i am building with this checkout from svn is resulting in segfaults....
had the same thing with sqlCVS..

hari
rock your home - http://www.agocontrol.com home automation

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Building New Media Player Device - Bizarre Compile Snafu
« Reply #13 on: November 26, 2007, 01:50:02 pm »
nice to know, what did you do to fix it?

-Thom

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Building New Media Player Device - Bizarre Compile Snafu
« Reply #14 on: November 28, 2007, 02:29:36 pm »
don't mix libraries and you should get no segfaults. Tested with sqlCVS.

regards,
Hari
rock your home - http://www.agocontrol.com home automation