Is the following pre-processor code portable between different compilers, and/or does it comply with the C++ standard:
Code:#pragma comment(lib,"somelib.lib")
Printable View
Is the following pre-processor code portable between different compilers, and/or does it comply with the C++ standard:
Code:#pragma comment(lib,"somelib.lib")
Pragmas are machine- or operating-system-specific by definition, and are usually different for every compiler.
So to ensure, through the source code, that a certain library is linked, I should probably use LoadLibrary() on a DLL?
Yeah I guess you could do that. Although I usually just link ( in the project settings ) to the import library and then include the necessary DLL header and I'm all set.