[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

linking problem with MCSim mod program

From: Frédéric BOIS
Subject: linking problem with MCSim mod program
Date: Fri, 26 Jul 2002 13:01:30 +0200

"Gregg M. Recer" wrote:
> Hello:
> I am attempting to develop some pbpk models using MCSim (v4.2, downloaded
> from and data we are collecting on
> perchloroethylene exposures.  I'm sorry to bother you, but I am
> encountering a problem getting the source code compiled on my workstation.
> It is a PC running Win98.  I've got the gnu gcc compiler (v3.1) running
> under a cygwin red hat/gnu/linux shell (bash).  I also tried compiling
> using a DOS C compiler (MS Quick C v2.5).
> The problem I'm encountering is during the first step to get the mod source
> files compiled and linked (using make on linux or the command-line
> compiler/linker in QC25).  Both compilers flag the same error on linking
> (the source files all compile fine).  They reference an undefined external
> function "GetVarHandle" called in lexfn.c.
> gcc error message:
> Linking mod...
> lexfn.o(.text+0x1b0):lexfn.c: undefined reference to `GetVarHandle'
> collect2: ld returned 1 exit status
> make: *** [mod] Error 1
> QC25 error message:
> LEXFN.OBJ(lexfn.c) : error L2029: '_GetVarHandle' : unresolved external
> I see that function prototyped in modiface.h but don't see the complete
> function in any of the source files.
> I apologize for bothering you for what is probably a trivial problem.  I'm
> fairly comfortable with C programming, but I can't see any obvious solution
> in this case -- there appears to be a file missing or misplaced (a library
> file perhaps?).  Thank you.
> GR
> __________
> Gregg Recer                  New York State Department of Health
> Troy, NY                              address@hidden 
> ****************************************************************


The fact is that you do not need GetVarHandle when compiling for the
"mod" target. That line of code should not even be reached by the
compiler because make compiles "mod" with the MODGEN variable defined.
I can only imagine a few causes for the problem:  
- maybe you are not using the original Makefile provided in the mod
  directory and you did not define the MODGEN flag (pass -DMODGEN as 
  an option to the C compiler).
- your version of make does not pass the MODGEN flag properly to 
  the compiler. That's unlikely but could be fixed by defining MODGEN
  in each C file of the mod program that uses #ifdef MODGEN directives.
  Alternatively, you could delete the #ifdef MODGEN, #else, #endif lines
  and also the lines of code between else and endif.
- we sometimes indent the #ifdef, #else, and other precompiler directives.
  As far as I know recent gcc don't complain about that, but your version
  may not like it. You could try forcing your compiler to accept that, or
  just delete the white spaces between a carriage return and a #.

Tell me if one of these work. One way to check the proper interpretation
of the preprocessor directives is to take a look at the preprocessor output.
You should see just the code written for the MODGEN case.

Frederic Bois

Frederic Y. Bois,
Unite de Toxicologie Experimentale, responsable
60550 Verneuil en Halatte
tel: + 33 (0)3 44 55 65 96
fax: + 33 (0)3 44 55 66 05
email: address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]