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")
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")
[email protected]
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials
Pragmas are machine- or operating-system-specific by definition, and are usually different for every compiler.
"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers
So to ensure, through the source code, that a certain library is linked, I should probably use LoadLibrary() on a DLL?
[email protected]
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials
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.
"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers