Path: news.cs.au.dk!Morten.Grouleff.Mjolner.Informatics From: Morten Grouleff Newsgroups: comp.lang.beta Subject: Re: GUIENVSYSTEMENV and SYSTEMENV includes gives a LINKER ERROR Date: 07 Dec 1999 09:51:48 +0100 Organization: Mjolner Informatics. Lines: 105 Message-ID: References: <19991207081851.20027.qmail@noatun.mjolner.dk> NNTP-Posting-Host: garm.mjolner.dk Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: xinwen.cs.au.dk 944556708 9764539 255.255.255.255 (7 Dec 1999 08:51:48 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 7 Dec 1999 08:51:48 GMT X-Newsreader: Gnus v5.5/Emacs 19.34 Xref: news.cs.au.dk comp.lang.beta:12188 "Sascha Kimmel \(tricos Mediaservice\)" writes: > Hi, > > I got the following message: > > >--------------------------------------------------------------------------- > --< > Mjølner BETA Compiler version 5.4.5 (711) for WinNT/Win95 (i386) (MS) > Target machine type nti_ms > Building dependency graph for: 'test_changeres' ... > Parsing: 'test_changeres' > Translating fragments ... > Bind fragments in: 'test_changeres'!Checking > ================= > Compiler warnings: > ================= > > gui[]->theWindowEnv[] > ***** A run-time qualification check will be generated here > -------------------------------------------- > No. of warnings: 1 > > !Code generation > Linking > guienvntsystemenvbody.obj : error LNK2005: M1BASICSCHEDULER already defined > in systemenv_ntbody.obj [... link errors ...] > A Link Error Occurred > >--------------------------------------------------------------------------- > --< > > when trying to compile the following program: > > test_changeres.bet: > -------------------> > ORIGIN '~beta/guienv/guienvsystemenv'; > INCLUDE 'changeRes' > 'getScreenResolution'; > INCLUDE '~beta/process/processmanager'; > -- program: descriptor -- > > systemEnv > (# > > setWindowEnv::< (# do gui[]->theWindowEnv[] #); > gui:@guienv(# [...] #); > [...] > do > [...] > (480,640,24)->changeRes; > [...] > #) > <-------------------- > > > getScreenResolution.bet: > -----------------------> > ORIGIN '~beta/guienv/guienv'; > --- lib: attributes --- > > GetScreenResolution: > (# > [...] > #); > <------------------------ > > > changeres.bet: > --------------> > ORIGIN '~beta/basiclib/systemenv'; > INCLUDE '~beta/process/processmanager'; > -- systemlib: attributes -- > > changeRes: > (# > mp:@process; > [...] > #); > <-------------- > > > As you can see the main program has GUIENVSYSTEMENV as origin and > "changeres.bet" has SYSTEMENV - I've already put the changeres functions > into the SYSTEMLIB so that I can access themn from the main program, BUT it > seems that including SYSTEMENV if already GUIENVSYSTEMENV is used will lead > to the linker error - why doesn't the BETA compiler give a notice? > And how can I solve it? You should not use ORIGIN/INCLUDE of systemenv anywhere in a program using guienvsystemenv. Using basicsystemenv instead should solve the problem. Techical explanation: basicsystemenv defines all the functionality of systemenv, whereas systemenv and guienvsystemenv selects the correct implementation of it. These implementations conflict and should therefore never be used at the same time. Regards, -- ** Morten Grouleff: ** ** Earthworm Jim PC: ** ** Mjølner Informatics: **