Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: island_girl on October 27, 2010, 10:45:08 pm

Title: Yet another undefined reference.
Post by: island_girl on October 27, 2010, 10:45:08 pm
Hello, I am getting an error "undefined reference" when trying to build my project.  I understand that this is a compiler error, not a code::blocks error, but I can successfuly link and compile using another IDE (visual studio).  My problem is setting up my project in code::blocks.  I have read several entries on this forum with the same error, but I am still consistantly getting these errors (warnings deleted):

Code
obj\Debug\usAcquire.o||In function `_ZN9usAcquireC2Ev':|
D:\Ultrasonix\usAcquire\usAcquire\usAcquire.cpp|24|undefined reference to `ulterius::ulterius()'|
obj\Debug\usAcquire.o||In function `_ZN9usAcquireC1Ev':|
D:\Ultrasonix\usAcquire\usAcquire\usAcquire.cpp|24|undefined reference to `ulterius::ulterius()'|
obj\Debug\usAcquire.o||In function `_ZN9usAcquireD2Ev':|
D:\Ultrasonix\usAcquire\usAcquire\usAcquire.cpp|31|undefined reference to `ulterius::~ulterius()'|
obj\Debug\usAcquire.o||In function `_ZN9usAcquireD1Ev':|
D:\Ultrasonix\usAcquire\usAcquire\usAcquire.cpp|31|undefined reference to `ulterius::~ulterius()'|
obj\Debug\usAcquire.o||In function `_ZN9usAcquire9connectUSEPc':|
D:\Ultrasonix\usAcquire\usAcquire\usAcquire.cpp|36|undefined reference to `ulterius::connect(char*)'|
obj\Debug\usAcquire.o||In function `_ZN9usAcquire12disconnectUSEv':|
D:\Ultrasonix\usAcquire\usAcquire\usAcquire.cpp|51|undefined reference to `ulterius::disconnect()'|
obj\Debug\usAcquire.o||In function `_ZN9usAcquire15changeParameterEPcd':|
D:\Ultrasonix\usAcquire\usAcquire\usAcquire.cpp|58|undefined reference to `ulterius::setParamValue(char const*, int)'|
obj\Debug\usAcquire.o||In function `_ZN9usAcquire11getParamterEPc':|
D:\Ultrasonix\usAcquire\usAcquire\usAcquire.cpp|68|undefined reference to `ulterius::getParamValue(char const*, int&)'|
obj\Debug\main.o||In function `main':|
D:\Ultrasonix\usAcquire\usAcquire\main.cpp|12|undefined reference to `ulterius::ulterius()'|
D:\Ultrasonix\usAcquire\usAcquire\main.cpp|64|undefined reference to `ulterius::~ulterius()'|
D:\Ultrasonix\usAcquire\usAcquire\main.cpp|64|undefined reference to `ulterius::~ulterius()'|
||=== Build finished: 11 errors, 5 warnings ===|

I am using code::blocks 8.02 and GNU GC compiler.
 

I have added the libraries *.lib to the list of Link Libraries (build options->Linker settings) and the *.h header files to the Search Directories (I am not sure this was the correct place to add the include files).

The *.dlls are in the executable directory.

I am fairly certain I have everything I need because (1) I could build and run using another IDE and (2) I have included everything in the SDK's instructions.  Therefore, I think my problem is my setup in code::blocks, either the linked libraries or the included headers.

I hope this makes sense.  Thanks in advanced for your advice.

Note: I would like to use code::blocks as it is recommended by a(nother) SDK that I am using.
Title: Re: Yet another undefined reference.
Post by: oBFusCATed on October 28, 2010, 12:05:46 am
Read here: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
Title: Re: Yet another undefined reference.
Post by: island_girl on October 28, 2010, 01:29:46 am
Read here: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Thanks for the reply, but I had already looked at this.
Title: Re: Yet another undefined reference.
Post by: Cinolt on October 30, 2010, 10:13:12 am
If you verified that you are indeed linking the right libraries in the command line then it's a problem with your linker and not Code::Blocks. A possible reason that Visual C++ might work linking against the same libraries is because it uses its own compiler/linker (unless you set it up to work with GCC).