Error Lnk2019 Initcommoncontrols
Contents |
question and get tips & solutions from a community of 418,513 IT Pros & Developers. It's quick & easy. InitCommonControls Link Error P: n/a fatal error rc1015: cannot open include file 'afxres.h' vs2015 Randy Hello All, I have a VC project I created a few years afxres.h visual studio 2015 back (Visual Studio 97). I'm now trying to recompile it under .NET 2003. I'm getting a linker error... LNK2019: afxres.h download unresolved external symbol __imp__InitCommoncontrolsEx@4 referenced in function _WinMainN@16 Does anyone know what I need to do to fix this? I can't find a library with this function in it. Thanks Cheers idc_static :) Nov 17 '05 #1 Post Reply Share this Question 3 Replies P: n/a Thobias Jones InitCommonControlsEx is located in comctl32.dll, so you'd need to link to comctl32.lib. However, your error says InitCommoncontrolsEx, which is a difference in capitalization. That could be a problem as well. Thobias Jones Randy wrote: Hello All, I have a VC project I created a few years back (Visual
Microsoft Foundation Classes For C++ Download
Studio 97). I'm now trying to recompile it under .NET 2003. I'm getting a linker error... LNK2019: unresolved external symbol __imp__InitCommoncontrolsEx@4 referenced in function _WinMainN@16 Does anyone know what I need to do to fix this? I can't find a library with this function in it. Thanks Cheers :) Nov 17 '05 #2 P: n/a Thobias Jones InitCommonControlsEx is located in comctl32.dll, so you'd need to link to comctl32.lib. However, your error says InitCommoncontrolsEx, which is a difference in capitalization. That could be a problem as well. Thobias Jones Randy wrote: Hello All, I have a VC project I created a few years back (Visual Studio 97). I'm now trying to recompile it under .NET 2003. I'm getting a linker error... LNK2019: unresolved external symbol __imp__InitCommoncontrolsEx@4 referenced in function _WinMainN@16 Does anyone know what I need to do to fix this? I can't find a library with this function in it. Thanks Cheers :) Nov 17 '05 #3 P: n/a Randy Got it...that works...thanks so much! "Thobias Jones"
the aforementioned API. Here is the code to initialize the common controls i want to use..(commctrl.h is already
Microsoft Foundation Classes For C++ Visual Studio 2015
included in my program) INITCOMMONCONTROLSEX icex; icex.dwSize=sizeof(INITCOMMONCONTROLSEX); icex.dwICC=ICC_BAR_CLASSES; InitCommonControlsEx(&icex); initcommoncontrolsex However, when I try to build , it gives me this error: 1>tkud.obj : error cannot open include file 'afxres.h' 2015 LNK2019: unresolved external symbol __imp__InitCommonControls@0 referenced in function _WinMain@16 1>C:\Users\kudayisi\Documents\Visual Studio 2008\Projects\comctrl\Debug\comctrl.exe : fatal error LNK1120: 1 unresolved externals I'm using Visual C++ 2008 https://bytes.com/topic/net/answers/281534-initcommoncontrols-link-error Express Edition. Any positive help on this matter would be highly appreciated. *"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former"- Einstein* tkud 238 posts since Sep 2009 Community Member 4Contributors 6Replies 8Views 6 YearsDiscussion Span 6 Years Ago Last Post https://www.daniweb.com/programming/software-development/threads/244516/initcommoncontrolsex by tkud 0 nezachem 616 6 Years Ago Is comctl32.lib added to your project? 0 William Hemsworth 1,339 6 Years Ago Yep, nezachem is correct, the prototypes in that header mean nothing if they aren't linked with the right library. Try linking to comctl32.lib. 0 Discussion Starter tkud 6 Years Ago I do not know how to link,please throw more light on that 0 William Hemsworth 1,339 6 Years Ago The easy way, at the very start of your code, add this line: #pragma comment(lib, "comctl32.lib") 0 cikara21 37 6 Years Ago the easiest..don't need InitCommonControlsEx(&icex); nor InitCommonControls(); #pragma comment(linker,"/manifestdependency:\"type='win32 name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") i'm sorry..:) 0 Discussion Starter tkud 6 Years Ago My project has compiled. Thanks to you all for your contributions,I really appreciate it!! c++ This question has already been answered. Start a new discussion instead. Message Insert Code Snip
Forum Visual C++ & C++ Programming Visual C++ Programming InitCommonControlsEx linker error If this is your first visit, be sure to check http://forums.codeguru.com/showthread.php?68954-InitCommonControlsEx-linker-error out the FAQ by clicking the link above. You may have to register or Login before you can post: click the register link above to proceed. To start viewing messages, select https://bobobobo.wordpress.com/2008/02/14/troubleshooting-trackbar/ the forum that you want to visit from the selection below. Results 1 to 2 of 2 Thread: InitCommonControlsEx linker error Tweet Thread Tools Show Printable Version Email this Page… Subscribe cannot open to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode November 1st, 1999,03:18 PM #1 Guest InitCommonControlsEx linker error I get a linker error when trying to use the InitCommonControlsEx function: directXenum.obj : error LNK2001: unresolved external symbol __imp__InitCommonControlsEx@4 Do I have to link to a library? Any help would be appreciated. Reply With Quote November 2nd, 1999,02:30 cannot open include AM #2 Feng Yuan View Profile View Forum Posts Visit Homepage Elite Member Join Date Oct 1999 Location WA Posts 2,393 Re: InitCommonControlsEx linker error Add comctl32.lib Reply With Quote Quick Navigation Visual C++ Programming Top Site Areas Settings Private Messages Subscriptions Who's Online Search Forums Forums Home Forums Visual C++ & C++ Programming Visual C++ Programming Visual C++ FAQs C++ (Non Visual C++ Issues) C++ and WinAPI Managed C++ and C++/CLI Visual C++ Bugs & Fixes Graphics Programming Multithreading Network Programming Driver Development C# Programming C-Sharp Programming Visual Basic Programming Visual Basic 6.0 Programming Visual Basic .NET VBForums Windows 8 and Later Store Development Modern Windows Apps (Metro) Other .NET Programming ASP.NET .NET Framework .NET Installation and Configuration Issues ADO.NET Windows Presentation Foundation (WPF) & XAML forum Java Programming Java Programming Other Programming AJAX Scripting - Client Side Database Crystal Reports XML Wireless/Mobile Development Assembly Scripting - Server Side (PHP, Perl, etc.) SharePoint Python General Discussion General Developer Topics Project Planning, Design, and Management Testers and Testing Algorithms & Data Structures IoT, IoE, and Maker Forum (on VBForums) General Discussion / Chit C
trying to get started with it. It doesn't help that the docs or the really poor example page don't say ANYTHING about what I'm about these small but annoying issues. MY TRACKBAR WON'T SHOW UP!! Try looking up the error code. If its a 1407, that's "Cannot find window class." That happens because you didn't call: InitCommonControls(); error C2065: ‘TRACKBAR_CLASS' : undeclared identifier! You have to #include