- Home /
DLL compilation
I'm trying to create a dll from my code as described in the Unity Documentation. So, for this I'm doing:
mcs -target:library FolderA/ClassA.cs
And I get this error:
The type or namespace name `ClassB' could not be found.
The type or namespace name `ClassC' could not be found.
The type or namespace name `ClassD' could not be found.
The type or namespace name `ClassE' could not be found.
...
If I manually include the sources ir works fine.
mcs -target:library FolderA/ClassA.cs FolderA/ClassB.cs FolderA/ClassC.cs ...
But not when I try to include the whole folder.
mcs -target:library -lib:FolderA FolderA/ClassA.cs
What am I doing wrong?
Answer by Landern · Nov 29, 2012 at 06:40 PM
You may want to use gmcs.exe instead, mcs.exe references 1.1 assemblies, gmcs.exe references 2.0 by default.
Other then that, you need to specify the files as you did manually and as you are aware, things will go great. As far as i know you CAN NOT use wild cards or just directory reads to include your classes.
On a side note, why not just manage all this through monodevelop/visual studio?
EDIT: try using gmcs.exe like: gmcs -target:library FolderA/*.cs
So, if I have 200 classes I have to list them one by one? This can't be right.
with csc.exe, or the microsoft compiler, masking is fine,
csc.exe -target:library *.cs
I suppose it could be a try to do: gmcs -target:library FolderA/*.cs
Your answer
Follow this Question
Related Questions
Use Mono in Unity 1 Answer
how to connect to mssql in unity for hololesn (Build Setting Error) 0 Answers
Distribute terrain in zones 3 Answers
The requested feature is not implemented 0 Answers