LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-11-2009, 07:55 PM   #1
tux_dude
Member
 
Registered: Dec 2008
Distribution: Slackware64 Current
Posts: 277

Rep: Reputation: 41
Cannot build apcups on slack64-current


Using the current slackbuild for 3.14.7 and unable to compile apcups with snmp enabled. Getting the error
Code:
In file included from drv_powernet.c:27:
snmp.h:82: error: expected unqualified-id before numeric constant
snmp.h:82: error: expected ';' before numeric constant
drv_powernet.c: In function 'int powernet_check_comm_lost(UPSINFO*)':
drv_powernet.c:37: error: expected primary-expression before '*' token
drv_powernet.c:37: error: expected primary-expression before ')' token
drv_powernet.c:37: error: expected ',' or ';' before 'Sid'
drv_powernet.c: In function 'int powernet_snmp_ups_read_static_data(UPSINFO*)':
drv_powernet.c:164: error: expected primary-expression before '*' token
drv_powernet.c:164: error: expected primary-expression before ')' token
drv_powernet.c:164: error: expected ',' or ';' before 'Sid'
drv_powernet.c: In function 'int powernet_snmp_ups_read_volatile_data(UPSINFO*)':
drv_powernet.c:303: error: expected primary-expression before '*' token
drv_powernet.c:303: error: expected primary-expression before ')' token
drv_powernet.c:303: error: expected ',' or ';' before 'Sid'
make[4]: *** [.obj/drv_powernet.o] Error 1
make[3]: *** [all] Error 2
make[2]: *** [snmp_DIR] Error 2
make[1]: *** [drivers_DIR] Error 2
make: *** [src_DIR] Error 2
It compiles fine without snmp. I have net-snmp installed on slack64. The build also works fine on slack32-current with snmp. Anyone have luck with apcups on slack64?
 
Old 12-11-2009, 09:22 PM   #2
GooseYArd
Member
 
Registered: Jul 2009
Location: Reston, VA
Distribution: Slackware, Ubuntu, RHEL
Posts: 183

Rep: Reputation: 46
Quote:
Originally Posted by tux_dude View Post
Using the current slackbuild for 3.14.7 and unable to compile apcups with snmp enabled. Getting the error
Code:
In file included from drv_powernet.c:27:
snmp.h:82: error: expected unqualified-id before numeric constant
snmp.h:82: error: expected ';' before numeric constant
drv_powernet.c: In function 'int powernet_check_comm_lost(UPSINFO*)':
drv_powernet.c:37: error: expected primary-expression before '*' token
drv_powernet.c:37: error: expected primary-expression before ')' token
drv_powernet.c:37: error: expected ',' or ';' before 'Sid'
drv_powernet.c: In function 'int powernet_snmp_ups_read_static_data(UPSINFO*)':
drv_powernet.c:164: error: expected primary-expression before '*' token
drv_powernet.c:164: error: expected primary-expression before ')' token
drv_powernet.c:164: error: expected ',' or ';' before 'Sid'
drv_powernet.c: In function 'int powernet_snmp_ups_read_volatile_data(UPSINFO*)':
drv_powernet.c:303: error: expected primary-expression before '*' token
drv_powernet.c:303: error: expected primary-expression before ')' token
drv_powernet.c:303: error: expected ',' or ';' before 'Sid'
make[4]: *** [.obj/drv_powernet.o] Error 1
make[3]: *** [all] Error 2
make[2]: *** [snmp_DIR] Error 2
make[1]: *** [drivers_DIR] Error 2
make: *** [src_DIR] Error 2
It compiles fine without snmp. I have net-snmp installed on slack64. The build also works fine on slack32-current with snmp. Anyone have luck with apcups on slack64?
in apcupsd.SlackBuild, change:

elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
fi

to

elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC -DNETSNMP_NO_LEGACY_DEFINITIONS=1"
LIBDIRSUFFIX="64"
fi


for some reason,

/usr/include/net-snmp/library/mib.h:#define MIB NETSNMP_MIB2_OID

which causes the string MIB to get treated as a macro. Adding the -D definition is probably not the right way to fix this, but it'll work.

.andy
 
Old 12-12-2009, 06:58 PM   #3
tux_dude
Member
 
Registered: Dec 2008
Distribution: Slackware64 Current
Posts: 277

Original Poster
Rep: Reputation: 41
Thanks for the help. Any reason why MIB is defined differently in Slack64. Or is this a question for Pat himself?
 
Old 12-13-2009, 08:19 AM   #4
GooseYArd
Member
 
Registered: Jul 2009
Location: Reston, VA
Distribution: Slackware, Ubuntu, RHEL
Posts: 183

Rep: Reputation: 46
Quote:
Originally Posted by tux_dude View Post
Thanks for the help. Any reason why MIB is defined differently in Slack64. Or is this a question for Pat himself?
We'd need to poke through the net-snmp headers a little deeper to know for sure, but I noticed a couple of other 64 bit platforms make the same definition (-DNETSNMP_NO_LEGACY_DEFINITIONS=1). I would shoot the package maintainer a message, he'll probably spot the problem right away.

.andy
 
Old 12-14-2009, 01:55 PM   #5
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
I'll try to get this worked around in the script soonish. Based on what I see in the current cvs code for apcupsd, it looks like the author is planning to use an internal "minisnmp" library for future releases, so I don't see much reason to even bother with trying to find a "better" fix.
 
Old 12-15-2009, 06:42 AM   #6
GooseYArd
Member
 
Registered: Jul 2009
Location: Reston, VA
Distribution: Slackware, Ubuntu, RHEL
Posts: 183

Rep: Reputation: 46
Quote:
Originally Posted by rworkman View Post
I'll try to get this worked around in the script soonish. Based on what I see in the current cvs code for apcupsd, it looks like the author is planning to use an internal "minisnmp" library for future releases, so I don't see much reason to even bother with trying to find a "better" fix.
hah see, this is why slackware is so cool
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Audacity Build Error on Slack64... fedoralinuxjunkie Slackware 3 10-24-2009 01:40 PM
Slack64-current - CTRL-ALT-BACKSPACE doesn't kill X GrapefruiTgirl Slackware 8 08-29-2009 09:32 AM
slack64 -current won't upgrade wingevil Slackware 6 08-17-2009 11:01 PM
Slack64-current: X questions, Ext4 question GrapefruiTgirl Slackware 8 07-21-2009 09:05 AM
Slack64-Current / NVIDIA Driver / possible bug? slackass Slackware 2 05-21-2009 12:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration