Archived

This topic is now archived and is closed to further replies.

Jell

how to link a library at load time??

Recommended Posts

i have to link a library to my vc++.net project at load time. where in Project Properties should i specify the path for the library or the library name ?? right now i am specifying it under Configuration Properties->Linker->General->Additional Library Directories but this is not linking the library ???

Share this post


Link to post
Share on other sites
hmm my config is broken, i think i need to reinstall my ide, but you can always use this in one of your cpp files(AFAIK):

#pragma comment(lib, "opengl32.lib")


T2l

Share this post


Link to post
Share on other sites
Under VC++ .NET you need to go Project Settings->Linker->Input->Additional Dependencies

Or use T2k''s method.

Share this post


Link to post
Share on other sites
There is more to the problem tough, so i have also posted t separately on the forum...but if u can reply...it wud be great help--

I am linking an unmanaged library at Load time in my vc++.net project.

#pragma comment(lib,"xyz.lib")
This library exports a simple method which returns "42".
exported method code is:

CPPCLASSEXPORT_API int Test(void)
{
return 42;
}


The code is Building properly.


BUT---- when i run the application (actually a vc++.net web service) i get an error page.
saying
"Configuration Error :

Parser Error Message: File or assembly name TestClassExport, or one of its dependencies, was not found.
"

same library if i test using an MFC exe application, is working fine.i.e. the method returns 42 to the MFC client.

so if u can help me out to understand what is happening..!!!!!


Share this post


Link to post
Share on other sites