Skip to content
Advertisement

Tag: c++

How to cross-platform compile on windows for linux using gcc?

My aim is to create cross-platform C++ python modules. I’m usingCyther (cross-platform The Cross-Platform Cython/Python Compiler). Cyther uses GCC to compile modules and gives the user the ability to add GCC command-line args. So, I need run compiler on Windows, but compile for Linux. What args I must pass to GCC to compile a module for Linux (or other platform)?

Check architecture for Linux and Mac

I’m trying to get the architecture of the computer executing my software, and so far it is working nice on Windows, but it fails on Linux and OSX. Let me show my current code: Linux and Mac always return “Processor is 32-bit”, so I guess that those environment variables are unused outside Windows. I’ve been googling for a couple of

SIOCGIWFREQ ioctl returning error 22 EINVAL – Invalid argument, why?

I am struggling to read current frequency channel of Wifi card using Wireless Extension Tools for Linux library with following Qt/C++ method: Now, iw_get_ext always returns -1 and errno is set to value of 22. I’ve taken a look at the errno.h and search for error 22 and I’ve got following error declaration: #define EINVAL 22 /* Invalid argument */.

Diifferetn result in Linux and Visual Studio

Does anybody know why compiling program in Visual Studio 2015 gives different result (those are correct I want to keep them) vs Linux Ubuntu (those are wrong).? Answer Reading beyond the end of an array invokes undefined behavior in C. Once your program invokes undefined behavior anything can happen or nothing at all. It is simply undefined. As aneesh correctly

Mono executes program with wrong current directory

I have a strange problem. I have written a custom spamfilter in C# .NET 4.6 for personal use. And I put this program up to my Raspberry Pi. I have tested many times the program, and everything worked fine, but when I created a cronjob I have noticed that the program never writes log. As I started to test again

Linux synchronization without polling

In principle what I want is very simple. Two executables ./read and ./write respectively read and write from a resource (let’s say a file). Using flock(2) it is easy to prevent race conditions between arbitrary invocations of ./read and ./write at arbitrary times. The requirement is that each invocation of ./read contains a snapshot of the resource from a previous

Advertisement