473,508 Members | 2,289 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.cpp 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: 'ManagedCppProj1::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 1224
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**********@myob.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.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.cpp 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: 'ManagedCppProj1::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.cpp 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: 'ManagedCppProj1::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
2571
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. ...
2
5669
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...
3
2123
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...
2
6651
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...
1
2111
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...
10
3730
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"...
13
3322
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...
60
4867
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...
9
14242
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...
3
1324
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...
0
7224
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,...
0
7120
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...
0
7323
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,...
0
7380
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...
1
7039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7494
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...
0
4706
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...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.