Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

G++/GCC very basic problem

Status
Not open for further replies.

Skirmish

Programmer
Nov 26, 2003
2
AU
Hey

I am very new to Linux and G++/GCC. I acquired a Linux for PS2 kit recently and have been compiling under G++ fine (though coming from VC++ I had to research Makefiles and a few other things).

I tried to include a sound library that had been posted to the Linux4PS2 comunity forums. It is a single C and H duo. Here is my problem: if I compile it under GCC it won't link with the rest of my app which is all CPP (it complains for unreferenced functions) which I guess is due to name mangling. But that file alone will compile under GCC.

When I try to compile it under G++ it yells at me the following warning:
soundlib.c:464: implicit declaration of function 'int memalign(....)'

I searched the net and a found a suggestion to put #define __EXTENSIONS__ ahead of the stdlib.h include. I tried it and still no joy. I also tried substituting posix_memalign for memalign, but that gave the same error.

Any advice greatly appreciated.
Cheers
-A-
 
No if I extern it at the top of the file then I get an error when g++ tries to link:
undefined reference to 'memalign(unsigned int, unsigned int)'

I am still at a loss. I tried swapping the memaligns over to vallocs. It compiled and linked but died a horrible horrible death. I guess it could be due to valloc using a different alignment boundary then that passed to memalign (16).

If you have any ideas or advice please post it here.
Thanks
-A-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top