Error 1 Error C2733 Second C Linkage Of Overloaded Function
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up error C2733 second C linkage of overloaded function 'function' not allowed up vote 10 down vote favorite 3 I am trying to compile old cpp MFC project in Visual Studio 2010 pro. It uses dll which is compiled using Labview, and I am adding this information because I don't know what is causing the error message.. The error messages show up on multiple functions, all same error type. error C2733: second C linkage of overloaded function 'function name' not allowed. the 'function name' includes: 'StrCatW', 'StrCmpNW', 'StrCmpW', 'StrCpyNW', and 'StrCpyW' I found a similar case on the web. Although the suggestion in the link didn't solve in my case and I still see the same error messages. Thanks in advance for anyone trying to help. c++ c visual-studio-2010 visual-c++ share|improve this question edited Jun 23 '13 at 10:42 danijar 8,4741668149 asked Oct 20 '11 at 18:08 JP_medevice 4842620 1 Looks like the functions StrCatW, 'StrCmpNW, etc. are either linked more than once or they are include in more than one file *without* being declared as inline`. –Thomas Matthews Oct 20 '11 at 18:26 1 @ThomasMatthews The error is not saying that there is more than one definition of the same function but rather that there are more than one overloads with the same name. The problem in this case is that because of the C linkage, name mangling is disabled, and you cannot have to symbols with the exact same name referring to different functions. –David Rodríguez - dribeas Oct 20
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why “second C linkage of overloaded function” http://stackoverflow.com/questions/7840203/error-c2733-second-c-linkage-of-overloaded-function-function-not-allowed is not allowed? up vote 2 down vote favorite 1 I converted my C++ dll to C dll: #ifdef __cplusplus extern "C" { #endif MY_EXPORT int my_func(); MY_EXPORT void my_func(int n); #ifdef __cplusplus } #endif Everything worked fine without extern C declaration. With this declaration I got error C2733: second C linkage of overloaded function 'my_func' not allowed Why is it not allowed to export overloaded functions http://stackoverflow.com/questions/23518371/why-second-c-linkage-of-overloaded-function-is-not-allowed from C-style dll ? c++ c dll extern share|improve this question asked May 7 '14 at 12:52 tommyk 1,1251642 stackoverflow.com/questions/479207/function-overloading-in-c –Johnny Mopp May 7 '14 at 12:53 C linkage implies no name-mangling. hence they would get the same name. –sp2danny May 7 '14 at 14:20 Possible duplicate of error C2733 second C linkage of overloaded function 'function' not allowed –rold2007 Feb 5 at 19:39 add a comment| 1 Answer 1 active oldest votes up vote 4 down vote accepted C does not allow to overload functions. That is C does not support overloading. It is a feature of C++. share|improve this answer answered May 7 '14 at 12:53 Vlad from Moscow 1 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged c++ c dll extern or ask your own question. asked 2 years ago viewed 25
LearningModern CodeNetworkingOpen SourceStorageToolsDeveloper TypeEmbedded SystemsGame DevMediaTechnical, Enterprise, HPCWebOSAll ToolsAndroid*HTML5Linux*OS X*Windows*ResourcesCode SamplesContact SupportDocumentationFree SoftwareIntel Registration CenterProduct ForumsSDKsResourcesPartner with IntelAcademic ProgramPartner SpotlightBlack Belt DeveloperDeveloper MeshInnovator ProgramSuccess StoriesLearnBlogBusiness TipsEventsVideosSupportContact SupportDeveloper EvangelistsFAQsForums Search form Search You are hereHome › Forums https://software.intel.com/en-us/forums/intel-threading-building-blocks/topic/286599 › IntelĀ® Software Development Products › IntelĀ® Threading Building Blocks FacebookLinkedInTwitterDiggDeliciousGoogle Plus error C2733: second C linkage of overloaded function '_InterlockedCompareExchange_np' not allowed error C2733: second C linkage of https://www.experts-exchange.com/questions/27245405/error-C2733-second-C-linkage-of-overloaded-function-'Imprime'-not-allowed.html overloaded function '_InterlockedCompareExchange_np' not allowed Stewart Hore Tue, 11/16/2010 - 17:17 Hi All,I am seeing the above error in our builds since introducing TBB. I managed to determine error 1 two sources but it comes back occasionally and is very hard to track down the culprit. Does anyone else get this? Actual error:C:/devtools/vs9/VC/INCLUDE\\memory(996) : error C2733: second C linkage of overloaded function '_InterlockedCompareExchange_np' not allowed [exec] C:/devtools/vs9/VC/INCLUDE\\memory(995) : see declaration of '_InterlockedCompareExchange_np'C:/devtools/vs9/VC/INCLUDE\\memory(996) : error C2733: second C linkage of overloaded function '_InterlockedCompareExchange_np' not allowed [exec] C:/devtools/vs9/VC/INCLUDE\\memory(995) : error 1 error see declaration of '_InterlockedCompareExchange_np'But we see it in "winnt.h" as well with several InterlockedXXXX. Thankfully on Mac, Linux and SOLARIS we don't have windows issues. I am assuming this is primarily with tbb/atomic so to reduce the errors problems I am not using atomics or including atomic.h in headers.1) This happened early on with BOOST. We didn't have BOOST_USE_WINDOWS_H defined as we have some old Inerviews code which is based on MFC (no we don't have time at the moment to upgrade all our old apps). BOOST then went to define some of the _InterlockedXXXX methods itself which broke TBB when the include order was after boost. Turning this on helped, we then just had to be careful with the header ordering for our MFC apps and BOOST. This was easier than TBB as it involved one header in fewer places.(MFC is pure pain so we have to order headers carefully later in our build with TBB and MFC)Does anyone have any ideas on a good fix for this? D
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > error C2733: second C linkage of overloaded function 'Imprime' not allowed Want to Advertise Here? Solved error C2733: second C linkage of overloaded function 'Imprime' not allowed Posted on 2011-08-08 MS Legacy OS C 1 Verified Solution 5 Comments 1,807 Views Last Modified: 2012-06-21 Hi, Im building a dll with MVC++ 6.0, however when I build the project I got the next message: --------------------Configuration: TcpDll - Win32 Debug-------------------- Compiling... TcpDll.cpp C:\Program Files\Microsoft Visual Studio\MyProjects\TcpDll\TcpDll.cpp(78) : error C2733: second C linkage of overloaded function 'Imprime' not allowed C:\Program Files\Microsoft Visual Studio\MyProjects\TcpDll\TcpDll.cpp(77) : see declaration of 'Imprime' Error executing cl.exe. TcpDll.dll - 1 error(s), 0 warning(s) ----------------------------------------------------------------------------------------- The code is the next: TcpDll.cpp: ----------------- // TcpDll.cpp : Defines the initialization routines for the DLL. #include "stdafx.h" #include "TcpDll.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif BEGIN_MESSAGE_MAP(CTcpDllApp, CWinApp) END_MESSAGE_MAP() CTcpDllApp::CTcpDllApp() { } CTcpDllApp theApp; extern "C" int WINAPI Imprime(char IP[14], char BUFFER[8]) { int RESULTADO; WSADATA data; SOCKET sock; struct linger Linger; struct sockaddr_in addr; /* Initialize windows sock