Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Activate MSVC 8 Compiler on Linux

<< < (2/3) > >>

killerbot:
could you post a detailed step by step guide, I really want to try this  :P :P :P

PS : I looked at your patch, but there a  few little things :
- some things sems to be unchanged although the patch claims something has changed

--- Quote ----    // Read the VCToolkitInstallDir environment variable
-    wxGetEnv(_T("VS90COMNTOOLS"), &m_MasterPath);
-    if(m_MasterPath.IsEmpty())
-    {
-        wxGetEnv(_T("VS80COMNTOOLS"), &m_MasterPath);
-    }
+    // Read the VCToolkitInstallDir environment variable
+    wxGetEnv(_T("VS90COMNTOOLS"), &m_MasterPath);
+    if(m_MasterPath.IsEmpty())
+    {
+        wxGetEnv(_T("VS80COMNTOOLS"), &m_MasterPath);
+    }



-        m_MasterPath = Programs + _T("\\Microsoft Visual Studio 9.0\\VC");
-        idepath = Programs + _T("\\Microsoft Visual Studio 9.0\\Common7\\IDE");
-        if(!wxDirExists(m_MasterPath))
-        {
+        m_MasterPath = Programs + _T("\\Microsoft Visual Studio 9.0\\VC");
+        idepath = Programs + _T("\\Microsoft Visual Studio 9.0\\Common7\\IDE");
+        if(!wxDirExists(m_MasterPath))
+        {
             m_MasterPath = Programs + _T("\\Microsoft Visual Studio 8\\VC");
-            idepath = Programs + _T("\\Microsoft Visual Studio 8\\Common7\\IDE");
+            idepath = Programs + _T("\\Microsoft Visual Studio 8\\Common7\\IDE");
         }

--- End quote ---
- don't you need to specify that the executable is "wine  blablabla" ?? or does linux automatically run it with wine ?? (haven't tried it yet)

darthdespotism:
Hm yes I do have these strange things with svn diff utility from time to time (I notice it quite often on my own svn Project. seems to be something with trailing spaces or so)

OK I'll try it.

Installing the compiler

I had Visual C++ installed and the Win Partition is mounted in my Linux Filesystem.

Create the folder .wine/drive_c/vc8/ for the copied executeables.

After that copy the folders bin, lib and include from WinPartition/Program Files/Microsoft Visual Studio 8/vc/ to .wine/drive_c/vc8.
Copy from WinPartition/Program Files/Microsoft Visual Studio 8/Common7/IDE to VS8DIR/VC/Bin the following dlls:

> msobj80.dll
> mspdb80.dll
> mspdbcore.dll
> mspdbsrv.exe

calling wine C:/vc8/bin/cl.exe should already start the compiler complaining that there is no file to compile.

After that I created 2 Scripts in /usr/local/bin:

link.sh

--- Code: ---#!/bin/sh

wine "c:/vc8/bin/link.exe" /LIBPATH:"c:/vc8/lib" $@
--- End code ---

cl.sh

--- Code: ---#!/bin/sh

wine "c:/vc8/bin/cl.exe" /I"c:/vc8/include" $@
--- End code ---

and made both executeable (chmod +x)

one can now try to compile from comandline using cl.sh (and link.sh).

Integrating into Codeblocks.
You need to compile libcompiler because MSVC8 is normaly not included. There are at least the files compilerMSVC8.cpp compilerMSVC8.h and compilergcc.cpp.
Move the MSVC8 out of the #ifdef __WXMSW__ (on MSVC8 header and source Commenting the ifdef and endif out is the easyest I think). I think the patch should be fine as well.

Move the new libcompiler.so (and perhapes the .la too) in the plugins-folder (there should already be one to overwrite). After starting Codeblocks there should be an new compiler detected. I changed the toolchain executeables from cl.exe to cl.sh (one can of course name the script in /usr/local/bin cl.exe, might be an nice Idea).

Problems

* One can not use Debug mode (some errors, maybe there is a way around I'll investigate here ;)
* One must specify the .exe Suffix and disable the automated addition of suffixes for the produced executeable to be of use
* I did not try nmake, cdb or the resource-Compiler by now they may or may not work

Jenna:

--- Quote from: darthdespotism on January 02, 2008, 01:39:06 pm ---Hm yes I do have these strange things with svn diff utility from time to time (I notice it quite often on my own svn Project. seems to be something with trailing spaces or so)

--- End quote ---
This might be blanks instead of tabs or vice versa, or very often dos/windows line-endings in the original code and linux endings in the new one.

darthdespotism:
Normally it could be tabs as I configured codeblocks to convert them to spaces. But this must be Line Endings as kwrite should not convert space<->tab

killerbot:
gonna experiment with this, with a few changes. I will completely mimic the VC installation path --> C:/Program Files/...
Because that's when installing it with wine would be constructed.

Will adjust compiler detection so it works on linux and windows but direct in such a way it would fine the wine path ...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version