Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Dumbledore on September 15, 2008, 11:06:06 pm

Title: extern variables "undefined reference"
Post by: Dumbledore on September 15, 2008, 11:06:06 pm
Hi, I am brand new to codeblocks and after I installed it today I attempted to port my project hiearchy into the CB IDE.  All went better than I expected until I hit a link error that as far as I can tell is caused by a CB misconfig. 

This project compiles fine with my makefile.

Not sure what info I need to give to shed light on the problem....  The code itself is solid and both the .cpp files are in the project in the same directory...

In main.cpp  I have someVar = someVal  and in other.cpp I have "extern someVar;" 

In the "other.cpp" file the linker is saying "undefined reference to someVar"   

Title: Re: extern variables "undefined reference"
Post by: MortenMacFly on September 16, 2008, 10:26:24 am
In the "other.cpp" file the linker is saying "undefined reference to someVar"   
Please post the full build log. See my sig how to enable full compiler logging.