Jump to content
  • Advertisement
Sign in to follow this  
stormrunner

linking with VS.Net 2003

This topic is 5015 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I recently aquired visual studio .net 2003, and can't figure out how to link to external libraries (either .lib or .dll). i've read the docs that .Net provides. They say to click the "link" tab on the Open dialog box, except that option is never there. Then i tried adding the library to the additional dependencies list, but it can't ever find the headers (and i'm assuming neither the libraries). I also tried adding it to the additional directories list, which searches for libraries to load, but that didn't work either. can someone explain how to solve this ?

Share this post


Link to post
Share on other sites
Advertisement
Go choose properties from the project menu, expand the Linker section on the treeview in the left side of the resulting dialog box, and then choose input. You can add additional libraries to the additional dependencies list.

If it can't find the header files it means you haven't put them in a directory the compiler can see.

Share this post


Link to post
Share on other sites
Go to Project->Add existing item... and then locate the .lib file on your hard drive and insert it into the project.

I have never needed to add .dll files to the project, I only have them in the same directory when I run the app.

[EDIT: saw the post by Monder, yes you can do it either way, and you VS.NET also supports the #pragma comment( 'lib', 'name_of_lib' )

Also, if it can't find the headers, you should go to Tools->Options->Projects->VC++ Directories and add the proper directories for header files

Share this post


Link to post
Share on other sites
i'll post this here instead of starting a new thread.
i ran into a problem when trying to link sdl to my project (as recommended above). i set the library include setttings to /NOLIBDEFAULT after the compiler told me to. everything seems to link correctly, except i get the following errors :

CEngine error LNK2001: unresolved external symbol __RTC_Shutdown
CEngine error LNK2001: unresolved external symbol __RTC_InitBase
CEngine error LNK2001: unresolved external symbol _mainCRTStartup

does anyone know how to shut this up ?

Share this post


Link to post
Share on other sites
All the SDL linker Errors I've received have been one of these three things:
1) is main declared as int main( int, char** ), not int main()
2) is the application a Multi-threaded DLL (Project->Properties->C/C++->Code Generation->Runtime Library?
3) Are the proper lib files included (sdl.lib, sld_main.lib,...)?

Does that help, or are you still getting the error?

Share this post


Link to post
Share on other sites
In Configuration Properties->C/C++->Code Generation did you set Runtime Library to multi-threaded dll(/MD)?

Share this post


Link to post
Share on other sites
it compiles, but it still refuses to build, citing the previous errors. what i've done :
the sdl.dll (and sdl_image.dll) is in the system32 folder (likea always)
set the search path for the include files to the sdl include folder
set the search path for the static libs to the sdl libs folder
set the dll settings to /MD
included the static libs in the dependencies list

am i doing something wrong ?

wyzy
1) yes
2) yes
3) i think so

Share this post


Link to post
Share on other sites
The /NODEFAULTLIB option will stop all default libraries from being linked which is not what you want. You may need to use it to get it to ignore a specific library but you should be able to get it working without doing this by following what wyrzy said.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!