Translating MSVC directives to ones supported by MinGW

Oct 23, 2011 at 1:27pm
Hello Everyone!

After I found it earlier that #pragma comment is for MSVC only, I came accross this code, and I was wondering if I could translate it to a MinGW equivelent, i.e. something I can compile with MinGW.

1
2
3
4
5
6
7
#ifdef TEST_EXPORTS
    #define TEST_API __declspec(dllexport)
#else
    #define TEST_API __declspec(dllimport)
    #pragma message("automatic link to Test.lib")   // <== add this line
    #pragma comment(lib, "Test.lib")                // <== add this line
#endif 


Thanks for the help!
Oct 23, 2011 at 3:46pm
http://www.mingw.org/wiki/CreateImportLibraries
http://www.mingw.org/wiki/sampleDLL
As you can see from the sample, the directive is the same.
Topic archived. No new replies allowed.