473,663 Members | 2,903 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple Projects

I have a .Net solution that contains multiple projects of both Managed
C++ and C#.

There are references in one Managed C++ project's classes to classes in
another Managed C++ project.
i.e. Proj2::Class2 uses Proj1::Class1

Proj2 has a reference entry for Proj1

Each projects uses its own namespace, so Proj2::Class2.c pp has a #using
namespace line referring to the namespace declared in the Proj1 classes

I cannot get this scenario to compile. I get:
"error C2512: 'Proj1::Class1' : no appropriate default constructor
available"

If I add #include "Class1.h" to Class2.cpp, then I alse get this:
"error C2011: 'ManagedCppProj 1::Class1' : 'class' type
redefinition"

I have tried the same scenario in a dummy solution with 2 simple
Managed C++ projects and get the same results.

Both projects are mixed mode and reference common unmanaged static C++
libraries

Any ideas??

Jan 6 '06 #1
4 1234
I could reproduce this with a test application and a control class.

the problem is that your reference (the dll or exe) contains an
implementation of your imported class, and the header file you include
contains another.

removing the reference from your project, or removing the header file
include statement solves this, because then only 1 implementation is found.

kind regards,
Bruno.
"yossis" <yo**********@m yob.com> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.com...
I have a .Net solution that contains multiple projects of both Managed
C++ and C#.

There are references in one Managed C++ project's classes to classes in
another Managed C++ project.
i.e. Proj2::Class2 uses Proj1::Class1

Proj2 has a reference entry for Proj1

Each projects uses its own namespace, so Proj2::Class2.c pp has a #using
namespace line referring to the namespace declared in the Proj1 classes

I cannot get this scenario to compile. I get:
"error C2512: 'Proj1::Class1' : no appropriate default constructor
available"

If I add #include "Class1.h" to Class2.cpp, then I alse get this:
"error C2011: 'ManagedCppProj 1::Class1' : 'class' type
redefinition"

I have tried the same scenario in a dummy solution with 2 simple
Managed C++ projects and get the same results.

Both projects are mixed mode and reference common unmanaged static C++
libraries

Any ideas??

Jan 6 '06 #2
yossis wrote:
I have a .Net solution that contains multiple projects of both Managed
C++ and C#.

There are references in one Managed C++ project's classes to classes in
another Managed C++ project.
i.e. Proj2::Class2 uses Proj1::Class1

Proj2 has a reference entry for Proj1

Each projects uses its own namespace, so Proj2::Class2.c pp has a #using
namespace line referring to the namespace declared in the Proj1 classes

I cannot get this scenario to compile. I get:
"error C2512: 'Proj1::Class1' : no appropriate default constructor
available" [ I think this error message is pretty clear what you need to do, either
define a default constructor, or instantiate an instance with
properly defined constructor.]

If I add #include "Class1.h" to Class2.cpp, then I alse get this:
"error C2011: 'ManagedCppProj 1::Class1' : 'class' type
redefinition"
[ I don't think you need to change to this, if you get a class not
defined error, then you may try this. The previous error message is damn
clear what you need to do to fix this issue].
I have tried the same scenario in a dummy solution with 2 simple
Managed C++ projects and get the same results.

Both projects are mixed mode and reference common unmanaged static C++
libraries

Any ideas??

Jan 7 '06 #3
Thanks,

I only added the header file as an atttempt ot fix the problem. There
was only a reference entry originally which was producing the compiler
error (C2512) regarding default constructors. There is still a problem.

Jan 9 '06 #4
If only it was that simple. There is a default constructor - the
problem seems to lie with the metadata imported through the reference
entry - possibly the unmanaged aspects that are linked into both
projects

Jan 9 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2577
by: Harry Whitehouse | last post by:
I'm developing a small class which will be used in a number of distinct C# projects. This small class is undergoing constant change/refinement as I try to employ it in the different projects. I'm trying to maintain a *single* copy of the CS file that can be used in the multiple .NET projects. But I'm observing that when you add a CS file to a given .NET project, subsequent modifications to that file are only saved in the current...
2
5704
by: TaeHo Yoo | last post by:
Hi all, I have a solution which contains multiple projects. Those multiple projects should share the same session. For example, users login, create the session for users then these session information should be accessed by multiple projects. How do I archieve this? Any tutorial out there? Thanks
3
2132
by: Galore | last post by:
Hello! I'm trying to setup an ASP.NET multiple web projects application, following the article How To Create an ASP.NET Application from Multiple Projects for Team Development. I could do it without any trouble, but when I put this solution on Visual Source Safe, my nigthmare begins.... Always when I open this solution, VS.NET tries to open the web projects on different places (<original name> followed by "_1", "_2", ...). Has anyone got...
2
6654
by: Samuel L Matzen | last post by:
Hi, I am trying to develop with multiple projects in a single solution. The many of these projects create .dlls that are used by other projects. When I reference a .dll I reference it in the bin directory of the project creating it. The problem I am having is that Visual Studio keeps throwing a whole bunch of error messages indicateing it can't overrite other version of dlls and that one object can't be converted to another object...
1
2129
by: David Herbst | last post by:
I have a solution that contains one main web project, ten sub web projects and a controls library project all in a single web application. I followed the steps in the following MS KB: How To Create an ASP.NET Application from Multiple Projects for Team Development http://support.microsoft.com/default.aspx?scid=kb;en-us;307467 e.g. http://localhost/application1 (references project sharedcontrols, module1, module2)
10
3748
by: eswanson | last post by:
I have broken up my web site into smaller web site projects. When I look at the precompiled files, it always has the virtual directory in them ie: <preserve resultType="3" virtualPath="/Security/DefaultLogin.aspx" hash="fde4916e6" filehash="ffffe84d717a4765" flags="110000" assembly="App_Web_-xo1n4yg" type="ASP.defaultlogin_aspx"> <filedeps> <filedep name="/Security/DefaultLogin.aspx" /> </filedeps> </preserve>
13
3332
by: Paul Cheetham | last post by:
Hi, I have two projects where I want to use the same source file in each project. If I add the file to each project, then a local copy is made. I want to be able to have a single source file used by both projects so that I only have to change one file. I am using compiler directives within the file, and so I can't just build it into a DLL and do it that way, I really do need to make both
60
4903
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the 'target' programming community herein) to get some community input and verify (or not) the following two statements. Few programmers (3 to7%) UNDERSTAND 'Strategic Functional Migration
9
14269
by: TC | last post by:
I need to design a system which represents multiple "projects" in SQL Server. Each project has the same data model, but is independent of all others. My inclination is to use one database to store all projects. Looking at the numbers involved, however, I wonder if I would get better performance by storing each project in its own database. Suppose I have 50 projects, each with two users and 10,000 rows; it seems to me I'd rather have 50 x...
3
1332
by: Mike Hudson | last post by:
Performance/good practice wise which one is preffered. 1. Keep adding new classes/forms to an existing project. Or 2. Create a new project based on the requirement and add the reference. Which one is preferred way to use. Thanks for any help/comment/suggestion you can provide. Mike
0
8436
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8858
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8771
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8634
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5657
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.