Date: Mon, 13 Sep 2004 19:29:15 GMT From: kristina joner <weasal@hq.dyns.cx> To: freebsd-gnats-submit@FreeBSD.org Subject: i386/71709: c++ compiler forgets global varibles Message-ID: <200409131929.i8DJTFJ1088430@www.freebsd.org> Resent-Message-ID: <200409131930.i8DJUUe7010981@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 71709 >Category: i386 >Synopsis: c++ compiler forgets global varibles >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Sep 13 19:30:29 GMT 2004 >Closed-Date: >Last-Modified: >Originator: kristina joner >Release: FreeBSD 5.2.1 RELEASE 9 >Organization: private >Environment: c++ -o mplayer.o -c MPlayer.cpp -I/usr/local/include MPlayer.cpp: In member function `void MPlayer::makeloop()': MPlayer.cpp:31: error: `wrap' undeclared (first use this function) MPlayer.cpp:31: error: (Each undeclared identifier is reported only once for each function it appears in.) **THE SOURCE FOR MPlayer.cpp** #include <mikmod.h> #include "MPlayer.h" MODULE* currentmodule; void MPlayer::makeloop() { wrap=1; } void MPlayer::makeunloop() { wrap=0; } void MPlayer::update() { if(Player_Active()) { Update_MikMod(); } } void MPlayer::musicpause() { if(Player_Active()) {Player_Togglepause();} } void MPlayer::musicstop() { if(Player_Active()) { Player_Stop(); } } void MPlayer::musicgo() { if(Player_Active()) { if(Player_Paused()) { Player_Togglepause(); } } else { if(currentmodule){ Player_Start(currentmodule); } } void MPlayer::loadmusic(char* file) { if(currentmodule) { if(Player_Active()) { Player_Stop();} Player_Free(currentmodule); currentmodule=0; } currentmodule=Player_Load(file,128,0); } MPlayer::MPlayer() { RegisterAllDrivers(); RegisterAllLoaders(); MikMod_Init(""); currentmodule=0; } MPlayer::~MPlayer() { if(Player_Active()) { Player_Stop(); } if(currentmodule){Player_Free(currentmodule);currentmodule=0;} MikMod_Exit(); } >Description: it compiled the other code just fine it is running this from a Makefile it regonize's MODULE* objects but not the wrap varible or the functions defined inside mikmod.h it seems to me that when it checks for object varibles and methods that it forgets to check for anyother varibles and methods out side the object. >How-To-Repeat: make the source. compile like this c++ -o mplayer.o -c MPlayer.cpp -I/usr/local/include "-I/usr/local/include" is where the mikmod.h file resides. >Fix: i can only guess to check if its looking for global varibles along with the local varibles of the object and there methods >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200409131929.i8DJTFJ1088430>