[SOLVED] compiling amuc 1.7 error (help me understand and debug) error: taking address of temporary array
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
compiling amuc 1.7 error (help me understand and debug) error: taking address of temporary array
Hello all hackers
I'm running gcc version 4.7.2 20130108 [gcc-4_7-branch revision 195012] (SUSE Linux) and trying to build The Amsterdam Music Composer.
See link if you like:http://members.chello.nl/w.boeke/amuc/index.html
The code sample of the structure I think contains the problem is here:
Code:
struct MeterView {
HSlider *meter;
static const int meter_dim=6;
Array<int,meter_dim> m;
MeterView(Rect rect) {
m=(int[meter_dim]){ 6,8,12,16,24,32 }; // here is a problem
meter=new HSlider(top_win,rect,MR,0,meter_dim-1,"meter",0,0,meter_cmd,cBackground);
draw(app->act_meter);
}
void draw(int val) {
int i=m.get_index(val);
if (i>=0) {
set_text(meter->text,"%d",val);
meter->set_hsval(i,0);
return;
}
alert("warning: non-standard meter value %d",val);
set_text(meter->text,"%d",val);
meter->set_hsval(-1,0);
}
static void meter_cmd(Id,int val,int,char*&,bool);
};
And the error:
Code:
make -C src-abcm2ps
make[1]: Entering directory `/home/marbangens/projects/amuc-1.7/src-abcm2ps'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/marbangens/projects/amuc-1.7/src-abcm2ps'
make -C src
make[1]: Entering directory `/home/marbangens/projects/amuc-1.7/src'
compiling amuc.cpp (g++)
amuc.cpp: In constructor ‘MeterView::MeterView(Rect)’:
amuc.cpp:616:41: error: taking address of temporary array
make[1]: *** [amuc.o] Error 1
make[1]: Leaving directory `/home/marbangens/projects/amuc-1.7/src'
make: *** [amuc] Error 2
Can someone explain to me what the problem might be? I would like to fix it myself if I can. I tried reading about arrays and googled about the error: taking address of temporary array; but I don't understand still.
Source code: http://members.chello.nl/w.boeke/amuc/amuc-1.7.tar.gz
Last edited by marbangens; 04-22-2013 at 05:41 PM.
linking amuc (g++)
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: amuc.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: note: 'pthread_create@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line
/lib64/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[1]: *** [amuc] Error 1
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
# 6, # 7.
I get no errors or warnings like that at starting 'amuc' in Suse 12.3 - 64bit.
( It says jackd not started, but the GUI opens OK.)
But then again I made no changes in any files to compile amuc.
'amuc-1.7' is an old application, year 2009, can be compiled with g++-4.4 .
( E.g. gcc44-c++-4.4.2 from "SLE 10 devel:gcc.repo".)
The 'amuc-1.7/src/Makefile' line 5 was edited from g++ to g++-4.4 .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.