Not able to include pthread.h in Windows [duplicate] - c

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Can I get C’s pthread.h to compile in Windows?
I am using eclipse on Windows 7.I am trying multi threaded programming in C.But I am not able to include pthread.h.It says No such file or directory.It worked on another Windows 7 machine but does not seem to work on this one.Please help me out.

pthreads, also known as POSIX threads, are a facility of POSIX-conformant operating systems (usually Unix-like systems, such as Linux and Mac OS X.) Windows does not have it. You will need to install a Windows port of pthreads. You can get it here: http://sources.redhat.com/pthreads-win32

Related

Compile a C program developed in Linux 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 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.

kernel module problem in commercial software [duplicate]

This question already has answers here:
How to build a Linux kernel module so that it is compatible with all kernel releases?
(3 answers)
Closed 3 years ago.
The security software I'm building contains a kernel module.
because the kernel must process the packet.
Do not use DKMS because it is commercial software.
If the kernel version goes up, insmod doesn't work.
What should I do? Do you have a good idea?
If you can't load the modules dynamically then another option to load the modules is making it as part of the kernel. Refer the following link :
http://newbiedoc.sourceforge.net/system/kernel-pkg.html

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).

Running a java 1.5 compiled program in java 7 environment [duplicate]

This question already has answers here:
Can newer JRE versions run Java programs compiled with older JDK versions?
(2 answers)
Closed 9 years ago.
I have code that is already compiled using Java 1.5. Is it possibly to run this code using Java 7 without any problems?
Yes, it should usually run with no problems. Certainly the theory is that it should be fine - there's a small chance that you'll run into some area where the behaviour has changed in a backwardly-incompatible way, but if you're only relying on behaviour specified in the documentation, you'll normally be okay.
There's definitely no problem in terms of the JVM understanding the bytecode itself.

How to get call stack in c in windows? [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How can one grab a stack trace in C?
In PHP it's debug_backtrace,is there such a function in c?
On Windows you can call the StackWalk64 function that is exported by DBGHELP.DLL. It is shipped with Debugging Tools for Windows (WinDbg) but according to this link, "The redistribution policies for these included DLLs were specifically designed to make it as easy as possible for people to include these files in their own packages and releases."

Resources