FaridAgl Posted January 14, 2013 Share Posted January 14, 2013 Regarding to thread's title, does "msvcrt.dll" exists on every version of Microsoft Windows? What about the "msvcr100.dll"? How much portable a C++ application or compiled dll can be? I noticed when I'm using Microsoft Visual C++ (2010), in every target machine the Microsoft Visual C++ 2010 Redistributable Package should be installed. Could I compile the project some how that it doesn't need this? Or is there any other compiler for this reason? Some information would be great, Thanks in advance. http://faridaghili.ir Link to comment Share on other sites More sharing options...
Mat Posted January 14, 2013 Share Posted January 14, 2013 There is a way to statically link the runtime: Project Settings -> Code Gen -> C++ -> Runtime -> Multithreaded (not multithreaded dll) AutoIt Project Listing Link to comment Share on other sites More sharing options...
FaridAgl Posted January 14, 2013 Author Share Posted January 14, 2013 Thanks, do you mean this one?If yes, I have tried this before, still says (On a fresh copy of Windows XP SP3):By some searchs around the web, I found some interesting information.I have used Dependency Walker to detect which Dlls are linked to my application.If I compile the app with MSVC++ it needs msvcr100.dll, if put this dll in the same folder as the app exe, then it will use it instead of searching the system32 for it.If I use Code::Blocks for compiling my application, it needs msvcrt.dll which I think it's available in Windows by default. http://faridaghili.ir Link to comment Share on other sites More sharing options...
water Posted January 14, 2013 Share Posted January 14, 2013 I read Mat's reply as if he means the first selection "Multi-threaded (/MT)" Mat 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Shaggi Posted January 15, 2013 Share Posted January 15, 2013 Yes, compile with /mt Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG Link to comment Share on other sites More sharing options...
Mat Posted January 15, 2013 Share Posted January 15, 2013 If I compile the app with MSVC++ it needs msvcr100.dll, if put this dll in the same folder as the app exe, then it will use it instead of searching the system32 for it.This page. First go to "Search Order for Desktop Applications", then find the list under "If SafeDllSearchMode is enabled ... ". The list is the search order for Dlls, like you said, application directory is searched first. That's pretty useful, and also quite dangerous. AutoIt Project Listing Link to comment Share on other sites More sharing options...
Chance Posted January 15, 2013 Share Posted January 15, 2013 lol, this happened to me to, I made a dll that would be used in an autoit script, and I'm getting a lot of feed back from people saying that msvcrt100.dll is missing etc. I think that was the name, apparantly it's needed for the string search functions I'm using. how can I make my dll indipendant from these things? I'm also compiling as multi-threaded. Link to comment Share on other sites More sharing options...
FaridAgl Posted January 15, 2013 Author Share Posted January 15, 2013 Mat, thank you friend, also water for making Mat's post clear.By compiling with Multi-threaded (/MT), it has no dependency.But, really, what's the different? I have noticed the file size increased about 30kb, why? Does it includes the required DLLs now? http://faridaghili.ir Link to comment Share on other sites More sharing options...
trancexx Posted January 15, 2013 Share Posted January 15, 2013 Something like that. Of course it doesn't include DLLs, but something like that. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
FaridAgl Posted January 15, 2013 Author Share Posted January 15, 2013 So, if it's that easy, why compiling on MT is not the default option? What's behind the scene? Does it makes any change in how the complied project will behave? I just got a little confused, want to know and understand. http://faridaghili.ir Link to comment Share on other sites More sharing options...
Shaggi Posted January 15, 2013 Share Posted January 15, 2013 So, if it's that easy, why compiling on MT is not the default option? What's behind the scene? Does it makes any change in how the complied project will behave?I just got a little confused, want to know and understand.The exe will be smaller with dynamic linking. There can be certain problems with static linking, such as multiple dlls has to include the same crt and leads to bigger code sizes.also, you can't delete memory inbetween modules since they use different heaps Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG Link to comment Share on other sites More sharing options...
FaridAgl Posted January 15, 2013 Author Share Posted January 15, 2013 So, in my situation (Creating a DLL with some exported functions that will be called from AutoIt) it shouldn't be a big deal, is that all or am I missing something else? Also the file size isn't so important in what I'm trying to do, as I said it's only 1 DLL, 20 ~ 30 KB extra file size wouldn't be annoying. http://faridaghili.ir Link to comment Share on other sites More sharing options...
Shaggi Posted January 15, 2013 Share Posted January 15, 2013 So, in my situation (Creating a DLL with some exported functions that will be called from AutoIt) it shouldn't be a big deal, is that all or am I missing something else?Also the file size isn't so important in what I'm trying to do, as I said it's only 1 DLL, 20 ~ 30 KB extra file size wouldn't be annoying.Yeah you'll probably be better off with static linking Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG Link to comment Share on other sites More sharing options...
FaridAgl Posted January 15, 2013 Author Share Posted January 15, 2013 OK, thank you all. http://faridaghili.ir Link to comment Share on other sites More sharing options...
JohnOne Posted January 16, 2013 Share Posted January 16, 2013 (edited) EDIT:(the following nervous rant has been solved)I changed a project to that setting and it's destroyed it, it wont even compile anymore.It says all sorts of includes are missing amongst other things.IntelliSense: identifier "DWORD" is undefinedIntelliSense: identifier "u_char" is undefinedIntelliSense: identifier "LPVOID" is undefinedetc...IntelliSense: declaration is incompatible with "long WINAPI" (declared at line 152 of "c:blahAutoIt3.h")IntelliSense: this declaration has no storage class or type specifiedThe list goes on, when I changed it back to "Multi-threaded Debug DLL (/MDd)" the problem remains.What a fking headache EDIT:And furthermore, I must have backed up my project incorrectly (copied project folder to another location before making the change) because it destroyed original too.Nightmare, weeks of work down the shit pan, seriously think thoroughly about what you are doing before making such a change to your project Edited January 16, 2013 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
JohnOne Posted January 16, 2013 Share Posted January 16, 2013 (edited) 1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library 1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW 1>project.obj : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >::operator[](unsigned int)const " (??A?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@I@Z) 1>libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW 1>libcpmtd.lib(cin.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW 1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW 1>libcpmtd.lib(xdebug.obj) : error LNK2001: unresolved external symbol __free_dbg 1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __free_dbg 1>project.obj : error LNK2019: unresolved external symbol __free_dbg referenced in function "private: void __thiscall std::_Yarn<char>::_Tidy(void)" (?_Tidy@?$_Yarn@D@std@@AAEXXZ) 1>libcpmtd.lib(cin.obj) : error LNK2001: unresolved external symbol __free_dbg 1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol __free_dbg 1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external symbol __free_dbg 1>libcpmtd.lib(locale0.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "public: class std::_Yarn<char> & __thiscall std::_Yarn<char>::operator=(char const *)" (??4?$_Yarn@D@std@@QAEAAV01@PBD@Z) 1>libcpmtd.lib(xdebug.obj) : error LNK2001: unresolved external symbol __malloc_dbg 1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __malloc_dbg 1>libcpmtd.lib(_tolower.obj) : error LNK2019: unresolved external symbol __calloc_dbg referenced in function __Getctype 1>C:\Documents and Settings\JOHN\Documents\CODE\project\project\Debug\project.exe : fatal error LNK1120: 4 unresolved externals Edited January 16, 2013 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
JohnOne Posted January 16, 2013 Share Posted January 16, 2013 (edited) Well panic is over and I'm happy to report that I somehow recovered it, but only by desperately farting about with the project settings with a 'nothing to lose' attitude. Makes me realize I need to find out a lot more about how visual studio IDE works. For example, some third party libraries I am using, the header files were in the project folder before disaster struck, but they are now missing. They show up in the solution but cannot be accessed because VS cannot find the file, except the project still compiles and runs, I just don't get it. Anyway I'm off to change my trousers EDIT: I seen a file I have not noticed before in debug folder, entitled "project.ilk", (incremental linker file) I think that sucked up the missing header files. So when my scare occurred, did I inadvertently statically link that library I wonder. Edited January 16, 2013 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now