User:Combuster/Frankenstein's MSVC: Difference between revisions
Content deleted Content added
m 'REAL' Final edit. Please correct any grammar mistakes you find. |
m Bot: Replace deprecated source tag with syntaxhighlight |
||
(11 intermediate revisions by 7 users not shown) | |||
Line 1:
{{
Salvaged black magic rituals nobody seems to have tried in three years. Needs some cleanup; use at your own risk.
= Introduction =
Have you ever dreamt of using Microsoft C/C++ Optimizing Compiler on Linux? Did you have trouble programming in an unfamiliar GCC environment? This article is the answer to configuring the build environment that you dreamt of; it will solve any problems that you had with GCC!
There are many ways that you can utilise Visual C++ (Microsoft C/C++ Optimizing Compiler) for
# Use GCC and Binutils on Cygwin (don't use VC++ at all).
# Use Binutils with COFF support to link COFF object files created by '''cl.exe''' (ditch VC++ linker).
It's the second solution that is interesting. You may ask "why not try it the other way around?", but that would remove the benefit of having linker scripts, although it would offer you GCC's 'style'. If you were aiming for the latter, then it may be best for you to just build a [[GCC_Cross-Compiler|GCC cross-compiler]].
== Prerequisites ==
* Windows system - In order to legally do this, you must have a valid Windows licence (this is due to the 'winetricks' procedure
** Visual Studio (C++) - You need to have Visual
* Linux system (or any other compatible
** Basic build environment - used to build [[Binutils]].
** Wine - used to run Microsoft C/C++ Optimizing Compiler on Linux.
Last but not least, having an X Window system on your Linux box is recommended to make your life easier while doing the 'winetricks' procedure, but not required. You may also want to check the [http://appdb.winehq.org/ Wine Database] to see what versions of Wine run which versions of the compiler.
== Running Microsoft C/C++ Optimizing Compiler on Linux ==
# Go to your Visual C++ binary directory (ex: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin).
# Copy all files into your Linux system (use FTP, SFTP, SMB or any equivalent file transfer methods). Tip: make sure to copy 1033 directory. 1033\clui.dll is used by cl.exe and must exist under (cl.exe Directory Path)\1033. If you are only willing to build i386 program, only copy the files in the binary directory and 1033 directory (you don't need to copy the files under x86_amd64, x86_ia64).
# Copy mspdb**.dll from your
# Try to run cl.exe and see if it works (ex: wine cl.exe). If it displays an error message (that is caused by a runtime DLL), do the following steps, otherwise skip to step 4.
## cd ~/.wine
Line 41 ⟶ 48:
----
Test.cpp
<syntaxhighlight lang="cpp">
const char *HelloWorldMessage
}▼
while (*HelloWorldMessage != '\0')
VideoMemory++ = HelloWorldMessage++;
</syntaxhighlight>
----
TestLS.ld
Line 75 ⟶ 87:
= FAQ =
It's mainly because of one's preference. GCC has its own style, and so does Microsoft C/C++ Optimizing Compiler. If you like MSCOC, you might want to use it on Linux as well as you do in Windows. In addition, if you have been using MSCOC for years, it is human nature that one prefers to use MSCOC than GCC.▼
=== Why use it on Linux when there is GCC to do the job? ===
▲
|