Compile a C program developed in Linux for Windows [closed] - c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I developed a program in Linux because of the libcurl library and a few other libraries that I needed for the project.
I have now finished the project but I need to send it to my client that uses a Windows 10 system. What is the best method of getting the program to them without sending the code over to be recompiled?

What is the best method of getting the program to them without sending the code over to be recompiled?
I see two solutions for this:
Download Windows trial/preview and compile it here
Download mingw and cross-compile with it for Windows.
Probably you're not a fan of first solution, me neither. I found another answer [1] where is stated how to do it (with link to tutorial on Code::Blocks forum [2])
[1] How to compile for Windows on Linux with gcc/g++?
[2] http://forums.codeblocks.org/index.php?topic=3343.0
Please follow answer at [1].

If your client has Windows 10, I strongly suggest you to look at WSL: Windows Services for Linux. You can install a Linux distro from the Windows Store, for example Ubuntu.
The Linux running with WSL is not inside a virtual machine, but it is tightly coupled with Windows.
Examples:
from Windows task manager, I can see the Linux running processes
inside Ubuntu, I can work with my personal files under %appdata% without network (don't need Samba)
from the Windows shell you can execute any Linux command, just prepend them with wsl
There are many features, you can play and discover them in half a day.
You can discover your program, without recompiling, will work in windows with WSL.
Actually the official windows 10 has wsl 1.
The next windows 10 upgrade will deploy wsl 2, that can run - parallel to windows - a full Linux kernel.
Microsoft sees the uprising of Linux and Android, and the loss of market share. They came up with a ingenious idea: buy Windows and you have both Windows and Linux, cooperating together as easy as possible.

Related

Is there any C compiler that does NOT come with an IDE? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I am new in C programming, and I was searching the internet for a compiler (for Windows 10). The compilers I found all had a full IDE included, but I don't need the IDE (I have a code editor). Is there any C compiler that does not come with an IDE, or at least a way to download one without the IDE?
This is going to get closed, but anyway, you can use any linux based compiler such as gcc or clang.
Also, Visual c++ has a compiler that can be used at the command line. In fact, nearly all C compilers can be used at the command line.
I think Microsoft makes their compiler available for download free. Only the IDE costs money. The compiler itself runs by command and when you use the IDE it just runs the command in the background.
How to install gcc in Windows 10? (the easier way)
How to Install the Latest GCC on Windows
Installing GCC: Binaries
You should be able to install GCC without an editor. https://gcc.gnu.org/install/binaries.html
To install it, follow the tutorial here to use MinGW, or use this tutorial to use Cygwin.
On the other hand, you could just use an editor that includes support for GCC. It may already be built into your IDE.

Port C Project from Windows to Linux [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am tasked with porting a massive c project from windows to linux. I have never ported anything over to linux before and am pretty new to linux. The project uses quite a bit of win32 calls. I have looked through some of it and understand what those parts do, however there are many moving parts and i feel it would take too much time to look through it all. What would be the best way to port it over? Is it foolish of me to think I can move the project over to the linux machine and work through the errors one by one?
Thank you in advanced!
Wine is a Windows Emulator for Linux, more exactly a re-implementation of the Windows API and binary interface, mainly for Unix-like OSes. It has also a builtin library named libwine, which is essentially a compatibility layer between the relevant Linux APIs (mainly: libc and X11) and the Win32.
Compiling the project with libwine, you will compile a Linux executable (binary), using the libwine as a shared lib (shared lib == dll). On this way, you can use the Windows API calls in a Linux project.
Your knowledge of the Win32 API helps a lot, most likely the compatibility isn't 100%. Probably you will have to modify the code a little bit (but not too much).

How to run my executable file on VNC tight viewer? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am using an embedded PC which contains VNC server. I am able to access the contents of the embedded PC on my laptop using VNC tight viewer via ethernet cable. I want to run the executable file generated by the Linux operating system on this embedded PC or on VNC tight viewer. Could anyone suggest me some ideas?
your pc runnig windows, and you run Linux on virtual machine, and you want to run the binary build from virtual machine on your target board, the one you called embedded PC. Is my understanding right?
If in that case, you should try to use nfs. Run nfs server in your virtual machine, mount the shared folder from you embedded PC. So you can immediately see all changed in the shared folder from you embedded PC, as well as run any generated binary file.
A reference here: http://www.rt-embedded.com/blog/archives/how-to-setup-an-nfs-client-on-the-target/
You can use sftp/scp for copiying your binary to your embedded PC and then you can run that binary using vnc viewer,execute below command from your linux machine
scp binary username#embeddedPC:/home/username/

How to make executables work on OSX Mavericks [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I've been working on a school project, in C, and I plan to distribute it to students and anyone interested...
The problem here is the executable file won't run on OS X Mavericks...
is there any way they can do this without getting a simulator, or an application like wine.
( Like how you have to install Visual C/C++ & DirectX for games? )
Since C compiled code is not platform agnostic like Java, you need to compile the code for the target platform(s) you are interested in.
If you have access to OSX Mavericks, you can compile on that OS to get the executable and test. (Copy your C source code to the mac OS, or better use a source control system like git)
If you do not have access to OSX, you can look up how to build/use cross compiler. (Links to related SO questions below that address this)
The effort needed for cross-compile and test would likely be non-trivial, so if you can get access to OSX that will be your best bet.
In either case, you will have to make sure the code written is platform-agnostic.
Several similar questions on stack overflow that talk about the various cross compiling options:
Way Cross Compile C/C++ code to run on Windows, Linux, and Mac OS?
How to Compile for OS X in Linux or Windows?
Porting C++ code from Windows to the Mac

Is there an open source C visual debugger for windows? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Is there an open source C visual debugger for windows?
I have heard about the visual C++ express free edition, but does it have a visual debugger?
Thanks.
It's not open source (but then does it really need to be?) Visual C++ 2008 Express Edition is an IDE with an integrated debugger.
You can create a C++ project, delete the .cpp files and create/include your .c files.
Eclipse CDT is a good alternative. It also has some nifty features such as refactoring and a preprocessor macro explorer.
I found a claim that the DDD debugger will run on Windows under Cygwin. I've used DDD quite a bit and like it.
Look at CodeLite IDE. I could attach to gdb debbager and provide GUI for it.
Visual Studio is the standard for windows development. I have never seen a better IDE for this platform (or any other for that matter).
If has a debugger integrated in the IDE. Try it - you'll probably like it.
I'm using Insight that is a graphical frontend to GDB in conjunction with mingw (gcc).
You can also use Code::Blocks that has an integrated debugger interface (I only tried it with gcc/gdb but it should work with other compilers/debuggers).
If you don't mind them not being Open Source (but just free to use) you can have a look at "Pelles C" (for Windows and Windows Mobile) and "lcc-win32" both based on the lcc compiler.
Of course, the already suggested Visual C++ Express from Microsoft will work perfectly on Windows.

Resources