From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Link error with multiple DLLs...

I have two DLLs I want to link to a main program. I thought each dll has to have DllMain(), but I get a link error "Multiply defined symbol '_DllMain@12' in modules... What am I doing wrong??

TIA
0 Kudos
Message 1 of 3
(2,678 Views)
Hello

Do you have calls to DllMain in your main application? Because you don't really need to. DllMain is a system-defined entry point and its not something a user calls.

And which modules does it list? Are those the names of the import libraries you have included in the project?


Also make sure that the dll's you have created have the correct prototype for dll main

int __stdcall DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)

no DLLEXPORT ( __declspec(dllexport) ) qualifier is required for DllMain.

You can also try regenerating the import libraries for the two dlls ( you will require their headers) and see if this fixes the issue.

Hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
Message 2 of 3
(2,678 Views)
>> You can also try regenerating the import libraries for the two dlls ( you will require their headers) and see if this fixes the issue.

This did the trick... thanks-
0 Kudos
Message 3 of 3
(2,678 Views)