Go Back   CodeCall Programming Forum > Software Development > C# Programming
Register Blogs Search Today's Posts Mark Forums Read

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.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-29-2009, 01:12 PM
Guru
 
Join Date: Oct 2007
Age: 25
Posts: 537
G_Morgan is a jewel in the roughG_Morgan is a jewel in the roughG_Morgan is a jewel in the rough
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-29-2009, 07:06 PM
Termana's Avatar
Code Warrior
 
Join Date: Oct 2008
Posts: 4,055
Termana is a name known to allTermana is a name known to allTermana is a name known to allTermana is a name known to allTermana is a name known to allTermana is a name known to all
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-29-2009, 07:28 PM
Guru
 
Join Date: Oct 2007
Age: 25
Posts: 537
G_Morgan is a jewel in the roughG_Morgan is a jewel in the roughG_Morgan is a jewel in the rough
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++.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-29-2009, 07:50 PM
Termana's Avatar
Code Warrior
 
Join Date: Oct 2008
Posts: 4,055
Termana is a name known to allTermana is a name known to allTermana is a name known to allTermana is a name known to allTermana is a name known to allTermana is a name known to all
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-29-2009, 07:55 PM
Guru
 
Join Date: Oct 2007
Age: 25
Posts: 537
G_Morgan is a jewel in the roughG_Morgan is a jewel in the roughG_Morgan is a jewel in the rough
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 07-02-2009, 11:09 AM
Termana's Avatar
Code Warrior
 
Join Date: Oct 2008
Posts: 4,055
Termana is a name known to allTermana is a name known to allTermana is a name known to allTermana is a name known to allTermana is a name known to allTermana is a name known to all
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 07-02-2009, 02:26 PM
TcM's Avatar
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Posts: 11,461
TcM is a name known to allTcM is a name known to allTcM is a name known to allTcM is a name known to allTcM is a name known to allTcM is a name known to all
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 07-02-2009, 03:02 PM
Guru
 
Join Date: Oct 2007
Age: 25
Posts: 537
G_Morgan is a jewel in the roughG_Morgan is a jewel in the roughG_Morgan is a jewel in the rough
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 07-02-2009, 03:14 PM
TcM's Avatar
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Posts: 11,461
TcM is a name known to allTcM is a name known to allTcM is a name known to allTcM is a name known to allTcM is a name known to allTcM is a name known to all
Re: C# Compiler - Daft question.

When you say modules you mean? Classes?
__________________
Funny Media Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 07-02-2009, 03:24 PM
Guru
 
Join Date: Oct 2007
Age: 25
Posts: 537
G_Morgan is a jewel in the roughG_Morgan is a jewel in the roughG_Morgan is a jewel in the rough
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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.


vBulletin v3.8.0 ©2010, Jelsoft Enterprises Ltd.


no new posts

LinkBacks Enabled by vBSEO 3.1.0