|
||||||
| C# Programming C# (pronounced C-sharp) is a new object oriented language from Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
C# Compiler - Daft question.
Does anyone know how to compile C# classes independently and then statically link them together?
The documentation seems to skip this entirely or at least does the standard MS trick of burying the relevant details in obscure corners or under a metric tonne of irrelevancies. All the tutorials I see basically devolve into rebuilding the entire project every time 'csc my-very-long-list-of-files'. I can't honestly believe that this is considered a sane way to work. |
|
||||
|
Re: C# Compiler - Daft question.
I don't believe you can do static linking with Microsoft's C# compiler, and they probably didn't provide that functionality since the whole point of .NET is to have the libraries there separately. However, I think, but don't quote me on this, that Mono is able to do static linking with the whole runtime.
__________________
My Site | Questions and Answers | Ask Me: Termana | Last Tutorial: Ajax innerHTML If you can keep your head while all around you are losing theirs, you probably have a CD writer on your desktop |
|
|||
|
Re: C# Compiler - Daft question.
What I meant was compiling n classes separately and then linking them into a single assembly. As far as I have been told elsewhere this isn't possible. That you can get some sort of emulation but it actually turns out slower than compiling the whole thing each time. I suppose with so much done at run time the compilation step for C# would be simpler than that for C++.
|
|
||||
|
Re: C# Compiler - Daft question.
Are you asking whether you could, say, make an assembly that has, for instance, classes that you use the most, that you could compile but still use in your program? If I'm right about what your talking about, you would compile them into a DLL file, and reference that DLL file. I'm not sure, but I think to do that you add /references:dllfilename.dll or something similar to the command line.
__________________
My Site | Questions and Answers | Ask Me: Termana | Last Tutorial: Ajax innerHTML If you can keep your head while all around you are losing theirs, you probably have a CD writer on your desktop |
|
|||
|
Re: C# Compiler - Daft question.
Not I want to compile the classes separately but then dump them all into one file. I.E. I should be able to delete the files that contained the classes after linking since it will not be stored within the assembly.
|
|
||||
|
Re: C# Compiler - Daft question.
I'm still not sure what it is your trying to do. Maybe you could show an example of it being done with another language and compiler and I could see what it is you are attempting to do.
__________________
My Site | Questions and Answers | Ask Me: Termana | Last Tutorial: Ajax innerHTML If you can keep your head while all around you are losing theirs, you probably have a CD writer on your desktop |
|
||||
|
Re: C# Compiler - Daft question.
Do you want to integrate the classes into the application and each time you run the application they will be extracted?
I can't really understand
__________________
Funny Media Blog |
|
|||
|
Re: C# Compiler - Daft question.
In c++ or c you can do the following
g++ -c file1.cpp -o file1.o g++ -c file2.cpp -o file2.o Then you can combine them g++ file1.o file2.o -o main If you then delete the *.o files main will still work because the object files have been combined into main. In C# you can build modules but it doesn't seem possible to bundle them into a combined assembly, when you delete them any assembly that used them breaks. |
|
||||
|
Re: C# Compiler - Daft question.
When you say modules you mean? Classes?
__________________
Funny Media Blog |
|
|||
|
Re: C# Compiler - Daft question.
No the C# compiler allows you to build source files into modules via /target:module. You can then link to a module via /addmodule. However the modules are not merged into the final assembly, merely dynamically linked. They essentially work no differently to /target:library.
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| quickie question for anyone- using Dev-C++ compiler.. | proeliumfessus | C and C++ | 7 | 05-26-2009 06:23 PM |
| How to ask a question! | Donovan | C and C++ | 7 | 01-08-2009 06:51 AM |
| C/C++ FAQ: Read this before you post! | v0id | C and C++ | 7 | 08-05-2008 01:08 PM |
| Visual C++ 2008 compiler question - making contained exe file? | mholt | C and C++ | 6 | 05-23-2008 11:00 AM |
| C++ Compiler question | skilletsteve | C and C++ | 4 | 09-28-2006 08:39 AM |
All times are GMT -5. The time now is 09:28 AM.
Amrosama.cc
Arekbulski.cc
Debtboy.cc
Guest.cc
Jaan.cc
James.cc
Mathx.cc
Tsz.cc
Vswe.cc