C :: Best Process For Cross Compiling Application

Oct 26, 2013

I'm creating a small command line game in C. I have never done anything cross platforms, but this is small enough (so far) that it might not be too bad.

When I am done, I'm not sure how it will be distributed: Either I will just send people the C files and say "compile on your system with these options", or I will just have executables for various systems. Probably Windows 7/8, Ubuntu, CentOS, and whatever I can find to test on.

I right now I'm testing/developing on Windows 7 using MinGW. So my questions are: while I'm developing, how should I be compiling/testing it?

View 4 Replies


ADVERTISEMENT

Visual C++ :: Application That Process Multiple Files Through Command Prompt Call

Dec 22, 2012

I am making an application that processes multiple files (typically > 500) through a command prompt call. The way I start the command prompt app is by looping using a call to CreateProcess for each file that is to be processed. It works fine, except that I somehow loose 'connection' to my app so that

1: Windows says that the app. is 'Not Responding'
2: The Cprogress bar in my app is not updated before all files have been processed, even though there is a CreateProcess call and a Cprogress.StepIt() from the app for each file that needs processing.

I somehow suspect that the CPU gets swamped... I do not want that Windows starts to say that my app is 'not responding' and I want my Cprogress dialog bar to update according to the number of files that are progressed through.

I wonder if multithreading is the OK way to go instead of just kicking of series of CreateProcess calls? Maybe my CreateProcess is not ending correctly? It seems as if my app is 'not regaining control' before very late. The app never crashes though.

My CreateProcess code is listed below, maybe there can be a problem with it, or maybe I should do things in a different way? My app basicaly works as it never crashes, but with above mentioned problems it is NOT a pro solution...

void CMultiFilerDlg::ProcessFile(CString pdfFile) {
int i=0;
DWORD ProcID;
// Open file in text mode:
STARTUPINFO si;
PROCESS_INFORMATION pi;
char cmdArgs[2052];

[Code] .....

View 6 Replies View Related

C++ :: Reads Process And Return Values From It - Application Crashes Because Of Buffer Size

Nov 11, 2014

I have an application that reads a process and return values from it. The problem it works fine with small processes but i have some processes that are about 1GB or even 2GB and when i try to read such big processes the application crashes. I'm trying to find a way to read the process memory in chunks of maximum 10 MB. The read code looks like:

Code:
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, entry.th32ProcessID);
unsigned char *p = NULL;
MEMORY_BASIC_INFORMATION info;
for (p = NULL; VirtualQueryEx(hProcess, p, &info, sizeof(info)) == sizeof(info); p += info.RegionSize)

[Code] ....

This reads the info.regionsize which can be as large as 100 MB. Is there any way to read it in chunks ?

View 12 Replies View Related

C++ :: How To Get The Cross Product

Oct 10, 2014

I am trying to compute the cross product of an 1x6 column vector "D" with a 6xN matrix "S".

vector< vector<float> > D(1, vector<float>(6));
vector< vector<float> > S(6, vector<float>(10)); // Example where N = 10
float cProduct = D*S; // ?

The last line fails, so I'm wondering how you would get the cross product?

View 2 Replies View Related

C++ :: Write Cross-platform File IO

Aug 21, 2013

I discussed a topic about how to write cross-platform file IO code with a member named Disch for about a year ago. Since I am a beginner I am not sure if the "rules" for doing this has changed or not within C++.

He taught me that differenct CPU:s use different endianness when reading and writing to files. However, why can't the C++ standard file IO functions detect what endianness should be used on the current machine that is running the program? Why didn't the developers who created the standard library develop file IO functions that are cross-platform from the beginning? Have the rules changed since last year?

What I learn is that if you need to store data in files that will be read and written to on different machines, you have to define in the program what endianness should be used. For example, if I needed to store 4 bytes, I had to do this manually with my own functions and define in those which endianness is used.

View 3 Replies View Related

C++ :: Cross Platform Way To Execute A Program?

Apr 18, 2014

System();is bad, I get that. Is there another way, that works across platforms I can use to execute an external program. If not, is there a windows specific way.

View 2 Replies View Related

C# :: API That Convert 2D Cross Sections Into 3D Shape

Mar 1, 2014

I have cross sections in the form of rectangles in the XY plane formed from two point (top left, bottom right) as well as their Z position. I'd like finding some sort of API that can extrude a basic linear-average-approximated 3D shape (preferably eventually into STL format) from these points. I've tried googling but to no avail. The aim is to build a 3D shape from 2D wireframes.

View 2 Replies View Related

Visual C++ :: Cross Platform GUI Development

Aug 28, 2013

I am planning to develop a GUI that will run on Windows, Linux, Android & iOS. If am right, VC++ apps don't work on Linux, Android & iOS. Is that correct?

Is there an alternative to that? Which other tool works for GUI development on above mentioned 4 platforms?

View 2 Replies View Related

C# :: Server Application Using Tcp Protocol And Then Establish Connection With A Client Application

Nov 29, 2014

What happens if I make a server application using tcp protocol and then establish connection with a client application but the server crash and then the client send data. Will the data be lost or the system will continue trying to send it?

View 2 Replies View Related

C :: Boolean Value Cross-functional In Game TicTacToe

Dec 11, 2014

Why something doesn't work without setting global variables. I want to know how to deliver values for example my boolean value "ende" (means end) from the function in line 99

Code:
bool pruefeGewinn() or in line 116 Code: bool spielfeldVoll() to the main function for using it there for Code: } while (ende != true); in line 164.

How to return it correctly?

Here is the Code of the game TicTacToe.

Code:
#include <stdio.h> // In- and Output
#include <stdlib.h> // Implementation of many functions
#include <stdbool.h> // Allows in C99 True and False as Boolean
#include <time.h> // Allows using Random by time

/*----------------------- Constants -------------------------*/

#define KANTENLAENGE 3
#define STRING 100

[Code] .....

View 6 Replies View Related

C++ :: Compute Area Of A Triangle Using Cross Product

Jan 8, 2015

I have to write some cpp program which computes area of a triangle using cross product,we give 3 vertices as R2 and 3 edges as double.

I am beginning like this;

#include <iostream>
#include "R2.h"
#include <cmath>
using namespace std;
double area ( R2 *A,double *z)

[Code] .....

View 5 Replies View Related

C++ :: Cross Platform Library For Simple Dialogues

Oct 17, 2013

In my game, I want to display dialogues for exceptions, and I don't really want to use something heavy like Qt, but then I also don't want to write and maintain my own platform-specific code to do it. Is there any library that can display simple message dialogues, just a few lines of text and an OK button, without being complete overkill like a full-blown GUI library?

View 13 Replies View Related

C++ :: Checking Dynamic Memory Cross-platform?

Feb 10, 2014

Suppose:

cin >> number;
pointer = new type[number + (rand()%number);

So, I wont know the memory allocated for pointer. How can I check it in all OS?

View 4 Replies View Related

C/C++ :: How To Cross Compile A GTKmm (Hello World) Program

Jun 20, 2014

I'm using ubuntu 14.04 and I want to cross compile this simple GTKmm program for Windows:

#include <gtkmm.h>
int main(int argc, char *argv[])
{
Glib::RefPtr<Gtk::Application> app =
Gtk::Application::create(argc, argv,
"org.gtkmm.examples.base");
Gtk::ApplicationWindow window;
return app->run(window);
}

I don't know how to do this...When I use this command:

x86_64-w64-mingw32-g++ main.cpp -o hello.exe `x86_64-w64-mingw32-pkg-config gtkmm-3.0 --cflags --libs`

I get this error:

In file included from /usr/include/cairomm-1.0/cairomm/fontoptions.h:26:0,
from /usr/include/cairomm-1.0/cairomm/surface.h:37,
from /usr/include/gdkmm-3.0/gdkmm/pixbuf.h:40,
from /usr/include/gdkmm-3.0/gdkmm/dragcontext.h:31,
from /usr/include/gtkmm-3.0/gtkmm.h:90,
from main.cpp:1:
/usr/include/cairo/cairo-ft.h:50:35: fatal error: fontconfig/fontconfig.h: No such file or directory
#include <fontconfig/fontconfig.h>

[code]....

View 10 Replies View Related

C# :: How To Start Application And Automatically Pass Input To That Application

May 9, 2012

I want to create an application that starts an application and passes input to that application. I know how to start a process using the classes in System.Diagnostics, but I don't know how to pass data to the process.

For example, and this is just an example, I would like to be able to automatically start an application that requires a username and password and automatically enter the username and password. Of course, that might open the door to security vulnerabilities, but that's not the point of the exercise.

How to implement the functionality I described? Is there a general way to go about doing this or does it depend entirely on the idiosyncrasies of the application in question?

View 2 Replies View Related

C++ :: How To Make (compiled) Code That Other Programmers Can Use (cross-platform)

Mar 29, 2013

(C++ question) I need to be able make a compiled code (like a .dll?) which other programmers can use on linux, win,, mac, etc.

The compiled code would simply do calculations and spit out an answer in memory.

I need it to have certain functions that they can easily call and understand (without actually seeing the source).

View 2 Replies View Related

C++ :: Turn Based Game - How To Make It Cross Platform

Sep 12, 2014

I am starting a turn based battle (similar to pokemon) app. How could i make this and make it cross platform. Also is it possible to make it access gps and allow other devices with the same app communicate with each other?

I have done things on the command line but i never made anything with images so i dont even know where to start for this app.

View 4 Replies View Related

Visual C++ :: Cross Platform Program - Make A Note Of Value Of PA

Nov 4, 2013

I'm working on a project which uses gtk+ and gtkmm. We use them in preference to MFC because the program needs to be cross-platform. For quite a long time, customers on OS-X and Linux have sometimes complained that the program would crash during shutdown but the Windows version (which I work on) never seemed to suffer. However, I'm now transferring my build environment to a new PC and I'm noticing the same shutdown crashes. It's a bit complicated so let me start with a small example:-

Code:
namespace Whatever {
class B {
public:
virtual ~B();
private:
int bb;

[Code] ....

Suppose I run the above program. When it stops at breakpoint #1 I make a note of the value of pA. Eventually the program reaches breakpoints #2 and #3. At each point my this pointer is exactly the same number. If the value of pA was 0x03604fb0, my this pointer is identical at both stages.

Now let's consider the real example:-

Code:
namespace Gtk {
class Widget {
public:
virtual ~Widget() {}

[Code] .....

Suppose I run the real example. At breakpoint #1 the value of pW is 0x03604fb0. But by the time I reach breakpoint #2 my this point is slightly different:- 0x03604fcc. It doesn't seem right to me and I'm wondering if it might be contributing to our shutdown crashes.

View 6 Replies View Related

Visual C++ :: How To Determine Cross Platform Type During File Save

Nov 10, 2014

I am overriding OnSaveDocument in my MFC document class to strip out the carriage returns when saving my app's document to a UNIX file system but not when the user is saving a file to a Windows file system.

Is there a way to determine if the lpszPathName in OnSaveDocument(LPCTSTR lpszPathName) is a UNIX or Windows file system?

Note, I want to avoid hard coding server names and I want to avoid overriding the FileSave dialog and forcing the user to select Windows or UNIX.

View 6 Replies View Related

C Sharp :: Run Application When Log Off In Console Application

Oct 4, 2012

i have task scheduling application which execute every 30 minute i want to keep this process when system is log off in c# console application

View 2 Replies View Related

C/C++ :: Error Compiling A DLL

Jul 25, 2014

I'm having a constant error in my DLL regarding one simple function: I get the error:

double *(double)' differs in levels of indirection from 'double (double)'

The declaration is:

extern EXP32 double *FAR PASCAL_CONV utc2tdb(double jd);

What can be the problem?

View 1 Replies View Related

C++ :: Xcode 4 Not Compiling?

Mar 20, 2012

I'm taking an intro to c++ class and during an exercise I ran into multiple errors that are out of my knowledge to fix. The rest of the class is using Visual and that is all the instructor knows so i'm in my own figuring out Xcode. Basically I wrote the same program twice but one has a different struct and I get all sorts of errors with it. understand what the errors are and why they occurred.

The working program is this:

#include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>
using namespace std;
struct point {
public:
double x1,y1;
double x2,y2;

[code]....

This program does not compile and I get the following errors:

stl_iterator_base_types.h

1) Symantic Issue
No type named 'value_type' in 'myPoint'
2) Symantic Issue
No type named 'iterator_category in 'myPoint'
3) Symantic Issue
No type named 'difference_type' in 'myPoint'
4) Symantic Issue
No type named 'pointer' in 'myPoint'
5) Symantic Issue
No type named 'reference' in 'myPoint'

Why does one work and the other doesn't!?

View 14 Replies View Related

Visual C++ :: Compiling On X86 CPU?

Apr 30, 2015

I'm compiling some open source code (originally written for Linux / gcc) which uses the following line to determine if a particular section is being compiled for an x86 processor:-

Code:
#if ( defined(__x86_64__) || defined(__i386__) )

neither of those seems to be defined by my ageing compiler (VC++ 8.0). What would be the equivalent for building with VC8 ?

View 6 Replies View Related

C :: Redefinition Errors In When Compiling

Sep 8, 2013

have several linux header files included and when I compile my program I get the below errors..Am I NOT supposed to use some of these headers? Source is below as well.Looking through the headers mentioned in these errors, it's looking like stuff really is defined in multiple places...

Code:

codeblox@Lubuntu-pc:~/Programming/C/Network/MITM/src$ gcc -g -o mitm *.c
In file included from mitm.h:12:0,
from create_raw.c:1:
/usr/include/netpacket/packet.h:22:8: error: redefinition of ‘struct sockaddr_ll’
In file included from /usr/include/linux/netdevice.h:30:0,
from /usr/include/linux/if_arp.h:26,
from mitm.h:10,
from create_raw.c:1:
}

[code]....

View 5 Replies View Related

C :: Compiling Makefile - Error

Feb 5, 2013

I've a problem compiling my makefile. The additional files are enclosed.

the error I get:
$make ./main
gcc -ggdb main.c
/tmp/ccPIxwjP.o: In function `main':
/home/ilan/Embedded_linux/Lesson-2-Makefiles/lesson-2.1/main.c:6: undefined reference to `func1'
/home/ilan/Embedded_linux/Lesson-2-Makefiles/lesson-2.1/main.c:7: undefined reference to `func2'
collect2: error: ld returned 1 exit status
make: *** [main.o] Error 1
$

Code:
my make file:
main : main.o file1.o file2.o
gcc -ggdb main.o file1.o file2.o -o gdb-main
main.o : main.c file1.h file2.h

[Code] .....

View 4 Replies View Related

C :: Compiling 2 Files In Linux Gcc

Sep 22, 2014

I want to use two separate files in 1 program, but cannot get it to work. I don't know if it's my files or the compiling thats wrong. I have never used 2 files in my programs so far. Only used #include <stdio.h>.

Here are my files:
extern_static.c Code: extern int i;
int main(void)
{

[Code]....

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved