dllexport - C++ How to specify namespace in def file -


"testdll.h"

namespace atest {     void helloworld(); }  namespace btest {     void helloworld(); } 

i trying export dll function def file. there 2 functions same name, in different namespace. write def file this:

library "testdll" exports     helloworld @1 

the visual studio shows "error lnk2001: unresolved external symbol helloworld". can't find useful information how specify namespace in def file. want know how solve problem. appreciate help.

def files must contain decorated names. (i.e. function names compiler , linker sees them)

you can read details on microsoft's site, here's relevant section:

if exporting functions in c++ file, have either place decorated names in .def file or define exported functions standard c linkage using extern "c". if need place decorated names in .def file, can obtain them using dumpbin tool or using linker /map option

personally, prefer using /map. find lot more straightforward using swiss army knife dumpbin is.

for reference here link documentation of decorated names in general.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -