Author Topic: Using C::B with VXL Libraries  (Read 4251 times)

Offline mbu

  • Single posting newcomer
  • *
  • Posts: 4
Using C::B with VXL Libraries
« on: May 19, 2008, 05:51:47 pm »
Hi,

I've got a problem with the linking options in C::B. I try to use the VXL libraries within a project. In the build options I entered two informations:

a) Search directories/Linker: Here I put the path to the VXL libraries.
b) Linker settings: I added a library (e.g. vnl.lib)

When building the project the linker tells me: "cannot find -lvnl.lib". Where is the problem. Shouldn't he search for the library in the folder I entered unter Search directories?

Thanks in advance, mbu.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Using C::B with VXL Libraries
« Reply #1 on: May 20, 2008, 12:06:38 am »
Try removing the ".lib" of "-lvnl.lib"

Offline mbu

  • Single posting newcomer
  • *
  • Posts: 4
Re: Using C::B with VXL Libraries
« Reply #2 on: May 20, 2008, 10:44:06 am »
If I remove the .lib the linker doesn't complain about not finding the library. But now he tells me

Quote
Compiling: source\main.cpp
Linking console executable: bin\Debug\cvl.exe
obj\Debug\source\main.o: In function `main':
D:/dev/cvl/source/main.cpp:6: undefined reference to `vnl_matrix<double>::vnl_matrix(unsigned int, unsigned int, double const&)'
D:/dev/cvl/source/main.cpp:14: undefined reference to `vnl_matrix<double>::~vnl_matrix()'
D:/dev/cvl/source/main.cpp:14: undefined reference to `vnl_matrix<double>::~vnl_matrix()'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
3 errors, 0 warnings

That's strange because when I try to compile the code with VS9 it works. Any idea?

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Using C::B with VXL Libraries
« Reply #3 on: May 20, 2008, 04:07:03 pm »
This is not a general programming forum. The forum is for specific questions about CodeBlocks IDE.

However:
http://www.lems.brown.edu/vision/vxl_doc/html/core/vnl/html/classvnl__matrix.html

My guess is that the calls to those template routines must be incorrect and not supported by the library. From a cursory look at the docs, it seems to me that the third parameter (as you've used it) may have to be a reference to a matrix, not a reference to a double.
« Last Edit: May 20, 2008, 04:08:44 pm by Pecan »