Advertising (This ad goes away for registered users. You can Login or Register)

help

Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
Locked
farm bot
Banned
Posts: 10
Joined: Thu Apr 25, 2013 7:24 am

help

Post by farm bot »

I had got a code changed main.c to main.cpp and I got errors.
I also included -lstdc++ and tried it again to get same errors
code-
http://www.mediafire.com/?dk85p1k5bmgn4cc

errors-

Code: Select all

main.cpp: In function 'int main()':
main.cpp:94: error: too many arguments to function
make: *** [main.o] Error 1
same code works fine as c
so I thought it could be a cross linker issue
so I
included the header file in subfolders as

Code: Select all

extern "c"
{
#include "players/player.h"
}
and tried again to get same errors
the 94 line was-

Code: Select all

	  (*getTimeStringFunct)(timeString);
any help?
Advertising
JJS
Big Beholder
Posts: 1416
Joined: Mon Sep 27, 2010 2:18 pm
Contact:

Re: help

Post by JJS »

I did take a quick look and there is a problem with the declaration of getTimeStringFunct. It is missing the parameter list (C doesn't care, C++ apparetly does probably because of function overloading). So the two instances of

Code: Select all

void (*getTimeStringFunct)();
in player.h and player.c should be changed to

Code: Select all

void (*getTimeStringFunct)(char *dest);
It is actually pretty clear from the error you get.
Advertising
farm bot
Banned
Posts: 10
Joined: Thu Apr 25, 2013 7:24 am

Re: help

Post by farm bot »

I already tried that, to get these errors:

Code: Select all

main.o: In function `main':
main.cpp:(.text+0x158): undefined reference to `setAudioFunctions(char*, int)'
collect2: ld returned 1 exit status
make: *** [softwareplayers.elf] Error 1
..so I reverted to old code

edit: and all the funtion prototypes to setAudioFunctions(char*, int) are same in player.h, player.cpp

=====================================

never mind, now I just had to use the extern "C" linkage.

thanks
Last edited by fate6 on Thu Apr 25, 2013 10:33 am, edited 1 time in total.
Reason: merged double post
pspfanMOHH
Posts: 661
Joined: Sat Jun 11, 2011 9:16 pm
Location: Grand Line, New World

Re: help

Post by pspfanMOHH »

Read the rules, a good(I feel young for using the term) name, change the name. Anyways good you solved your own issue, I wonder if this will be locked.
10 years young!
farm bot
Banned
Posts: 10
Joined: Thu Apr 25, 2013 7:24 am

Re: help

Post by farm bot »

I have a prob, when I stop one file and try to load another psp shuts down. So is there a way I could switch tracks?
farm bot
Banned
Posts: 10
Joined: Thu Apr 25, 2013 7:24 am

Re: help

Post by farm bot »

Basically is there any way I can destroy this library and build it again or reset it?
farm bot
Banned
Posts: 10
Joined: Thu Apr 25, 2013 7:24 am

Re: help

Post by farm bot »

never mind guys, I fixed this ;)
noname120
Developer
Posts: 777
Joined: Thu Oct 07, 2010 4:29 pm

Re: help

Post by noname120 »

Mind to tell your issue and how you fixed it, thus you can help in the future any guy having the same or a related issue.
Funny stuff
<yifanlu> I enjoy being loud and obnoxious
<yifanlu> rooting an android is like getting a hooker pregnant
<xerpi> I sometimes think I should leave all this stressing **** and be a farmer instead
farm bot
Banned
Posts: 10
Joined: Thu Apr 25, 2013 7:24 am

Re: help

Post by farm bot »

Well, you have to stop the mp3 before starting the next one. Simple, but you must make sure not to call it before starting it.


I have a problem.
I cant sign this, is there any good quality audio mp3 library like this one?

Thanks in advane :)
Locked

Return to “Programming and Security”