Unresolved external symbol in "cdt.lib" using VS2012

I am trying to get graphviz' dijkstra algorithm to work as a library. It's like trying to compile the dijkstra project "graphviz\cmd\tools\dijkstra.c" . I already have a functioning project where I use and I can draw graphs and everything works fine. Only if I add the dijkstra algorithm (and remove the int main(...) function) it doesn't compile due to following error:

error LNK2001: Unresolved external symbol ""__declspec(dllimport) struct _dtmethod_s * Dtoset" ([email protected]@[email protected]@A)".


error LNK2019: Unresolved external symbol ""struct _dt_s * __cdecl dtopen(struct _dtdisc_s *,struct _dtmethod_s *)" ([email protected]@[email protected]@[email protected]@[email protected]@@Z)" referenced in function ""void __cdecl dijkstra(struct Agraph_s *,struct Agnode_s *)" ([email protected]@[email protected]@[email protected]@@Z)".

I reference "graphviz\lib\release\lib\cdt.lib". VS dumpbin.exe shows that the symbol Dtoset and dtopen ARE IN IT.

Why is it unresolvable?

Do you use other functions

Do you use other functions from libcdt? If not, and you add one, is it also not found?

You might look at all of the other settings used in the project file for the dijkstra program, and add them to your project file.

No, I'm just stupid and

No, I'm just stupid and called the C-function (it's "dijkstra.c" after all) from C++ without adding extern "C" in front... Apparently this causes "unresolved external symbol" errors... It's really nasty. But thanks anyways, you still helped me a lot. Also thanks for always being around and keeping the forum alive!

Recent comments