Author Topic: Yet another undefined reference.  (Read 2757 times)

Offline island_girl

  • Single posting newcomer
  • *
  • Posts: 2
Yet another undefined reference.
« 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: [Select]
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11899
    • Travis build status
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline island_girl

  • Single posting newcomer
  • *
  • Posts: 2

Offline Cinolt

  • Multiple posting newcomer
  • *
  • Posts: 22
Re: Yet another undefined reference.
« Reply #3 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).
« Last Edit: October 30, 2010, 10:24:35 am by Cinolt »