0

I followed the documention, and copied sample code, but I got errors:

http://michaelrsweet.github.io/mxml/

Error   LNK2019 unresolved external symbol _mxmlDelete referenced in function _load_rate    
Error   LNK2019 unresolved external symbol _mxmlLoadFile referenced in function _load_rate  

#include <stdio.h>
#include <stdlib.h>
#include <mxml.h>
#include "Rate.h"

void load_rate(rate *currentrate) {

    FILE *fp;
    mxml_node_t *tree;
    fp = fopen("filename.xml", "r");
    tree = mxmlLoadFile(NULL, fp, MXML_TEXT_CALLBACK);
    fclose(fp);
    mxmlDelete(tree);
}

Any idea what am I doing wrong?

  • [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – 001 Apr 20 '17 at 11:52

1 Answers1

0

The linker cannot find the library file. Can you please share the compile options. You should include something like -lmxml

I confirm the name of the library is libmxml, so you you have just to specify the use of the library to the linker.

Maurizio Benedetti
  • 3,557
  • 19
  • 26
  • https://scr.hu/vWYA33 You mean this? This is the first time I'm using external library – TheRudno Apr 20 '17 at 12:01
  • I am not a superexpert of Visual Studio but this should help http://stackoverflow.com/questions/10847076/how-do-i-add-a-lib-file-to-link-in-visual-c-2010 – Maurizio Benedetti Apr 20 '17 at 13:42