UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » C
  • » help with undefined reference

#1 2009-03-12 03:24 PM

Ronin
Member
From: San Antonio, TX
Registered: 2009-03-09
Posts: 21

Re: help with undefined reference

I have this statement

OrbitSpeed = pow(V_ORBIT, ORBIT_ndx);

but I do have it referenced prior to this call in:

extern double 	OrbitSpeed,       /* orbital speed of ice drop         */
		dr_dt,
		Q_dsr,            /* Direct Solar Radiation            */
		Q_ebb,            /* Earth Blackbody Radioation        */
		Q_ea;             /* Earth Albedo                      */

I get an "...undefined reference to _OrbitSpeed" when trying to compile.

what is it that i'm doing wrong?


"Science without religion is lame. Religion without science is blind."
-Albert Einstein

Offline

#2 2009-03-12 04:18 PM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,239

Re: help with undefined reference

You probably get a linker error.

If I had to guess, you either want to remove the "extern", to declare it there
(if it's in a C file), or you forgot to actually add it somewhere else (if it's in
a header file).

Offline

  • Index
  • » C
  • » help with undefined reference

Board footer

Powered by FluxBB