Error 2 Error C2512 No Appropriate Default Constructor Available
Contents |
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
C++ No Appropriate Default Constructor Available
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions c++ no appropriate default constructor available template Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers,
C++ No Appropriate Default Constructor Available Struct
just like you, helping each other. Join them; it only takes a minute: Sign up c++ newbie error C2512: no appropriate default constructor available up vote 1 down vote favorite im new to c++ and I no appropriate default constructor available struct wanted to call a class/function from a second .cpp page. error: error C2512: 'QueryAuthServer' : no appropriate default constructor available new.h class QueryAuthServer : public CNtlSession { public: void SendCharLogInRes(CNtlPacket * pPacket); } new.cpp void QueryAuthServer::SendCharLogInRes(CNtlPacket * pPacket) { .... } main.cpp QueryAuthServer C; C.SendCharLogInRes(pPacket); The error is at the main.cpp I already used google and viewed othr pages with the same error but I dont understand how to solve the bug. Ive read, caple c2512 that something about "C" should be missing but I dont know what.. c++ share|improve this question edited Jun 12 '14 at 11:02 David 1,2351610 asked Jun 12 '14 at 10:58 user3733748 1513 add a comment| 1 Answer 1 active oldest votes up vote 5 down vote accepted If your base class - CNtlSession does not have a default contructor, then the compiler will not be able to automatically generate a default contructor for your derived class - QueryAuthServer. If you need one, you have to write it yourself, indicating exactly how you want your base class subobject initialized. class QueryAuthServer : public CNtlSession { public: QueryAuthServer() :CntlSession(/*PROVIDE ARGUMENTS HERE!*/) { } }; share|improve this answer answered Jun 12 '14 at 11:02 Armen Tsirunyan 76.4k32215343 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++ or ask your own question. asked 2 years ago viewed 3357 times active 2 years ago Related 11error C2512: no appropriate default constructor available3c2512 error: no appropriate default construct
resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine Forums Blogs Channel 9
No Appropriate Default Constructor Available Qt
Documentation APIs and reference Dev centers Retired content Samples We’re sorry. 'uuserwidget' : no appropriate default constructor available The content you requested has been removed. You’ll be auto redirected in 1 second. C/C++ Building Reference C/C++
No Appropriate Default Constructor Available Template
Build Errors Compiler Errors C2500 Through C2599 Compiler Errors C2500 Through C2599 Compiler Error C2512 Compiler Error C2512 Compiler Error C2512 Compiler Error C2500 Compiler Error C2502 Compiler Error http://stackoverflow.com/questions/24182687/c-newbie-error-c2512-no-appropriate-default-constructor-available C2503 Compiler Error C2504 Compiler Error C2505 Compiler Error C2506 Compiler Error C2507 Compiler Error C2509 Compiler Error C2510 Compiler Error C2511 Compiler Error C2512 Compiler Error C2513 Compiler Error C2514 Compiler Error C2516 Compiler Error C2517 Compiler Error C2518 Compiler Error C2521 Compiler Error C2523 Compiler Error C2524 Compiler Error C2526 Compiler Error C2528 Compiler Error C2529 https://msdn.microsoft.com/en-us/library/9zkz8dx6.aspx Compiler Error C2530 Compiler Error C2531 Compiler Error C2532 Compiler Error C2533 Compiler Error C2534 Compiler Error C2535 Compiler Error C2537 Compiler Error C2540 Compiler Error C2541 Compiler Error C2542 Compiler Error C2543 Compiler Error C2544 Compiler Error C2545 Compiler Error C2548 Compiler Error C2549 Compiler Error C2550 Compiler Error C2551 Compiler Error C2552 Compiler Error C2553 Compiler Error C2555 Compiler Error C2556 Compiler Error C2557 Compiler Error C2558 Compiler Error C2561 Compiler Error C2562 Compiler Error C2563 Compiler Error C2566 Compiler Error C2567 Compiler Error C2568 Compiler Error C2569 Compiler Error C2570 Compiler Error C2571 Compiler Error C2572 Compiler Error C2573 Compiler Error C2574 Compiler Error C2575 Compiler Error C2577 Compiler Error C2579 Compiler Error C2581 Compiler Error C2582 Compiler Error C2583 Compiler Error C2584 Compiler Error C2585 Compiler Error C2586 Compiler Error C2587 Compiler Error C2588 Compiler Error C2589 Compiler Error C2592 Compiler Error C2593 Compiler Error C2594 Compiler Error C2597 Compiler Error C2598 Compiler Error C2599 TOC Collapse the table of content Expand the table of content This documenta
i compile my small piece of code it gives me the error C2512 : No appropriate default constructor available this is my definition of class person: // Person.h // A class defining a person #pragma once #include