Nope, I set them through the IDE. Here's a screen shot of the errors I get when I compile with the /MT switch set in the IDE like you described:
I mentioned them because I couldn't compile with /MT and I was wondering if that was possibly a cause of the problem >< And judging by what you're saying, it is.
Those errors are because you are linking to both the static multi-threaded CRT, and the dynamic multi-threaded debug DLL. You can only link to one runtime library.
every application links with the runtime by default. You don't have to explicitly link it. You have to explicitly remove the linkage, or in this case change it to the static library, rather than the DLL. Don't use command line switched explicitly unless you are very sure of exactly how they effect things and require them for some feature that cant be done through the IDE. In this case, as I stated, you can set the runtime linkage type in the project settings. You need to -
1. Remove your manual entry of /MT or /MD
2. right click on the project name in the solution browser (the window on the left by default), not the solution name, then select Properties
3. go to Configuration Properties
4. go to C++
5. Code Generation
6. on the Runtime Library attribute, click and select Multi-threaded or Debug Multithreaded depending on whether this is the release or debug build respectively
7. DO NOT select any of the settings that have the letters DLL in them.
now clean the project and rebuild.
Edit: Here's a screen shot...
from the screenshot i can tell that you are linking other libraries, that is why you are getting the errors that such and such symbol is already defined.
Go under Linker->Input and remove the offending libraries from the additional dependencies box.
Yeah I am, but if I remove those my program won't compile because I'm using them. I have:
shlwapi is required for some header and functions, ws2_32 for socket stuff and libssh2.lib for libssh2.
I have a compiled libssh2.dll, can I use that and dynamically link to it and place it in my programs folder?
No, you are still trying to link both the MT and the MT Debug libraries, as you will notice form the screenshot. Post a screenshot of the Linker->Command Line page. Time like this I realyl wish the moderator would enable us to attach zip and rar files (hint hint) ;).
Here you go mate: http://img11.imageshack.us/img11/9710/hehezn.jpg
I figured you'd want higher resolution otherwise I would have uploaded to board ;)
you are linking the debug version of ssh2, try linking the release version instead.