IL & C++ & OBJ

D

Dmitry Shuklin

I am compiled my C file into IL source,
How i can compile this file back to OBJ file, not to EXE or DLL?

or, can i compile to OBJ file VB or C# code and link them with C++ managed
OBJ files?

Thanks
 
W

William DePalo [MVP VC++]

Dmitry Shuklin said:
I am compiled my C file into IL source,
How i can compile this file back to OBJ file, not to EXE or DLL?

There is no tool from MS to accomplish this.
or, can i compile to OBJ file VB or C# code and link them with C++ managed
OBJ files?

AFAIK, no tool for this, either.

<rant>
It is a shame that you can't currently do this especially since VAX/VMS
allowed modules written in disparate languages to be linked and used
together seamlessly more than two decades ago.
</rant>

It is not what you asked, but it is possible to link to "net modules" and
then to create an "assembly" from net nodules. I've not tried it, but I
_think_ that the C# and VB.Net compilers are capable of creating netmodules.

Regards,
Will
 
D

Dmitry Shuklin

Generally i wrote completly new project and want write it in one language,
but

- i need MC++ to interact with native code
- MC++ have few restrictions and stranges so i can't use only C++ ((

may be third party tools? C++ can generate managed OBJ files which link
links
it is very strange that asm can not be compiled into OBJ instead of C++
 
W

William DePalo [MVP VC++]

Dmitry Shuklin said:
- i need MC++ to interact with native code

This is what it does best.
- MC++ have few restrictions and stranges so i can't use only C++ ((

Hmm, what do you mean?
it is very strange that asm can not be compiled into OBJ instead of C++

Without going in to great detail, why don't you explain exactly what you
need to do?

Together, MC++'s "It just works" which allows mixing native and managed code
in the same MC++ module - and Platform/Invoke which permits invocation of
external functions in unmanaged DLLs provide a lot of capability.

Regards,
Will
 
I

Ioannis Vranos

William said:
There is no tool from MS to accomplish this.


I think that he probably meant compiled in mixed mode, and I think this
can be done by using extern "C" inside a C++ file and then compile the
whole thing with /clr.
 
W

William DePalo [MVP VC++]

Ioannis Vranos said:
I think that he probably meant compiled in mixed mode, and I think this
can be done by using extern "C" inside a C++ file and then compile the
whole thing with /clr.

Could be, which is why I mentioned IJW and asked for more details.

The only thing that is clear is that his "compile back" is at least a
problematic usage of the language if not a problematic request in its own
right. :)

Regards.
Will
 
D

Dmitry Shuklin

- MC++ have few restrictions and stranges so i can't use only C++ ((
Hmm, what do you mean?

- i already wrote this as separate message to this group
System.TypeLoadException: Method GetObjectData in type
MyProj.Runtime.NativeHandle from assembly MyProj.Runtime does not have an
implementation. without reasonable motive

- can't code private inheritance of interface class MyClass :private
IMyInterface, but when IMyIterface marked as private its defenition is
absent in assembly metadata, but inheritance still stays public - assembly
fails to load ((

not so huge

- cant implement interface with property name == class name

- can't directly override Finalize, when implementing ~__dtor compiler makes
reference to MSVCRT71, i don't want install to clients this dll only because
of dtors (C# and VB dont use __CxxUnwind ... )

- cant mark native class as public or private, strange, but native classes
becames public

- the same with all native data types or functions. - i understand why MS
need describe them in metadata, but why public ? (((

and many small issues, even dont want to recall
 
W

William DePalo [MVP VC++]

Dmitry Shuklin said:
- i already wrote this as separate message to this group
System.TypeLoadException: Method GetObjectData in type
MyProj.Runtime.NativeHandle from assembly MyProj.Runtime does not have an
implementation. without reasonable motive

- can't code private inheritance of interface class MyClass :private
IMyInterface, but when IMyIterface marked as private its defenition is
absent in assembly metadata, but inheritance still stays public - assembly
fails to load ((

not so huge

- cant implement interface with property name == class name

- can't directly override Finalize, when implementing ~__dtor compiler
makes reference to MSVCRT71, i don't want install to clients this dll only
because of dtors (C# and VB dont use __CxxUnwind ... )

- cant mark native class as public or private, strange, but native classes
becames public

- the same with all native data types or functions. - i understand why MS
need describe them in metadata, but why public ? (((

and many small issues, even dont want to recall

Probably my problem but I have no idea what the heck you are talking about.
I'll bow out of this thread now ...

Regards,
Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top