ibireme/yyjson

vc6.0 mfc dll build error

Closed this issue · 1 comments

vc6.0 mfc project
The dll module introduces yyjson and creates a method of write string
.exe module uses methods in the dll module
Dlls compile alone without problems, .exe compilation prompts
JsonTest.obj : error LNK2001: unresolved external symbol _yyjson_mut_doc_free
JsonTest.obj : error LNK2001: unresolved external symbol _yyjson_mut_doc_new
JsonTest.obj : error LNK2001: unresolved external symbol _yyjson_mut_write_opts
JsonTest.obj : error LNK2001: unresolved external symbol _unsafe_yyjson_val_pool_grow
Debug/JsonTest.exe : fatal error LNK1120: 4 unresolved externals

What should I do?

I'm not familiar with the VC6.0 MFC, maybe you can try these two macro:

yyjson/src/yyjson.h

Lines 79 to 85 in 41069b2

/* Define as 1 to export symbols when build library as Windows DLL. */
#ifndef YYJSON_EXPORTS
#endif
/* Define as 1 to import symbols when use library as Windows DLL. */
#ifndef YYJSON_IMPORTS
#endif