Search Results

Search found 286 results on 12 pages for 'mingw'.

Page 10/12 | < Previous Page | 6 7 8 9 10 11 12  | Next Page >

  • C: Running Unix configure file in Windows

    - by Shiftbit
    I would like to port a few applications that I use on Linux to Windows. In particular I have been working on wdiff. A program that compares the differences word by word of two files. Currently I have been able to successfully compile the program on windows through Cygwin. However, I would like to run the program natively on Windows similar to the Project: UnixUtils. How would I go about porting unix utilities on a windows environment? My possible guess it to manually create the ./configure file so that I can create a proper makefile. Am I on the right track? Has anyone had experience porting GNU software to windows? Update: I've compiled it on Code::Blocks and I get two errors: wdiff.c|226|error: `SIGPIPE' undeclared (first use in this function) readpipe.c:71: undefined reference to `_pipe' readpipe.c:74: undefined reference to `_fork This is a linux signal that is not supported by windows... equvilancy? wdiff.c|1198|error: `PRODUCT' undeclared (first use in this function)| this is in the configure.in file... hardcode would probably be the fastest solution... Outcome: MSYS took care of the configure problems, however MinGW couldnt solve the posix issues. I attempt to utilize pthreads as recommended by mrjoltcola. However, after several hours I couldnt get it to compile nor link using the provided libraries. I think if this had worked it would have been the solution I was after. Special mention to Michael Madsen for MSYS.

    Read the article

  • C file read leaves garbage characters

    - by KJ
    Hi. I'm trying to read the contents of a file into my program but I keep occasionally getting garbage characters at the end of the buffers. I haven't been using C a lot (rather I've been using C++) but I assume it has something to do with streams. I don't really know what to do though. I'm using MinGW. Here is the code (this gives me garbage at the end of the second read): include include char* filetobuf(char *file) { FILE *fptr; long length; char *buf; fptr = fopen(file, "r"); /* Open file for reading */ if (!fptr) /* Return NULL on failure */ return NULL; fseek(fptr, 0, SEEK_END); /* Seek to the end of the file */ length = ftell(fptr); /* Find out how many bytes into the file we are */ buf = (char*)malloc(length+1); /* Allocate a buffer for the entire length of the file and a null terminator */ fseek(fptr, 0, SEEK_SET); /* Go back to the beginning of the file */ fread(buf, length, 1, fptr); /* Read the contents of the file in to the buffer */ fclose(fptr); /* Close the file */ buf[length] = 0; /* Null terminator */ return buf; /* Return the buffer */ } int main() { char* vs; char* fs; vs = filetobuf("testshader.vs"); fs = filetobuf("testshader.fs"); printf("%s\n\n\n%s", vs, fs); free(vs); free(fs); return 0; } The filetobuf function is from this example http://www.opengl.org/wiki/Tutorial2:_VAOs,_VBOs,_Vertex_and_Fragment_Shaders_%28C_/_SDL%29. It seems right to me though. So anyway, what's up with that?

    Read the article

  • c++ OpenCV CVCalibrateCamera2 is causing multiple errors

    - by tlayton
    I am making a simple calibration program in C++ using OpenCV. Everything goes fine until I actually try to call CVCalibrateCamera2. At this point, I get one of several errors: If the number of images which I am using is equal to 4 (which is the number of points being drawn from each image: OpenCV Error: Sizes of input arguments do not match (Both matrices must have the same number of points) in unknown function, file ......\src\cv\cvfundam.cpp, line 870 If the number of images is below 20: OpenCV Error: Bad argument (The total number of matrix elements is not divisible by the new number of rows) in unknown function, file ......\src\cxcore\cxarray.cpp, line 2749 Otherwise, if the number of image is 20 or above: OpenCV Error: Unsupported format or combination of formats (Invalid matrix type) in unknown function, file ......\src\cxcore\cxarray.cpp, line 117 I have checked the arguments for CVCalibrateCamera2 many times, and I am certain that they are of the correct dimensions relative to one another. It seems like somewhere the program is trying to reshape a matrix based on the number of images, but I can't figure out where or why. Any ideas? I am using Eclipse Galileo, MINGW 5.1.6, and OpenCV 2.1.

    Read the article

  • Makefile for DOS/Windows and Cygwin

    - by Thomas Matthews
    I need to have a makefile work under DOS (Windows) and Cygwin. I having problems with the makefile detecting the OS correctly and setting appropriate variables. The objective is to set variables for the following commands, then invoke the commands in rules using the variables: Delete file: rm in Cygwin, del in DOS. Remove directory: rmdir (different parameters in Cygwin and DOS) Copy file: cp in Cygwin, copy in DOS. Testing for file existance: test in Cygwin, IF EXIST in DOS. Listing contents of a file: cat in Cygwin, type in DOS. Here is my attempt, which always uses the else clause: OS_KIND = $(OSTYPE) #OSTYPE is an environment variable set by Cygwin. ifeq ($(OS_KIND), cygwin) ENV_OS = Cygwin RM = rm -f RMDIR = rmdir -r CP = cp REN = mv IF_EXIST = test -a IF_NOT_EXIST = ! test -a LIST_FILE = cat else ENV_OS = Win_Cmd RM = del -f -Q RMDIR = rmdir /S /Q IF_EXIST = if exist IF_NOT_EXIST = if not exist LIST_FILE = type endif I'm using the forward slash character, '/', as a directory separator. This is a problem with the DOS command, as it is interpreting it as program argument rather than a separator. Anybody know how to resolve this issue? Edit: I am using make with Mingw in both Windows Console (DOS) and Cygwin.

    Read the article

  • Disassembling with python - no easy solution?

    - by Abc4599
    Hi, I'm trying to create a python script that will disassemble a binary (a Windows exe to be precise) and analyze its code. I need the ability to take a certain buffer, and extract some sort of struct containing information about the instructions in it. I've worked with libdisasm in C before, and I found it's interface quite intuitive and comfortable. The problem is, its Python interface is available only through SWIG, and I can't get it to compile properly under Windows. At the availability aspect, diStorm provides a nice out-of-the-box interface, but it provides only the Mnemonic of each instruction, and not a binary struct with enumerations defining instruction type and what not. This is quite uncomfortable for my purpose, and will require a lot of what I see as spent time wrapping the interface to make it fit my needs. I've also looked at BeaEngine, which does in fact provide the output I need, a struct with binary info concerning each instruction, but its interface is really odd and counter-intuitive, and it crashes pretty much instantly when provided with wrong arguments. The CTypes sort of ultimate-death-to-your-python crashes. So, I'd be happy to hear about other solutions, which are a little less time consuming than messing around with djgcc or mingw to make SWIGed libdisasm, or writing an OOP wrapper for diStorm. If anyone has some guidance as to how to compile SWIGed libdisasm, or better yet, a compiled binary (pyd or dll+py), I'd love to hear/have it. :) Thanks ahead.

    Read the article

  • Producing 64-bit builds on Windows with free software

    - by pauldoo
    Hi, I have a C++ project that I've been developing in Microsoft Visual C++ 2008 Express Edition. It has come to the point that I'd like to port to 64-bit and continue development. What is the best way to do this using free software? My thoughts so far: The Express Edition of MSVC doesn't come with 64-bit compilers, so I can install the Windows SDK to get these. I could then port my project files to nmake, and use the IDE just as a tool to debug and invoke my nmake scripts.. The downside to this is that nmake looks very poor. The example towards the end of this tutorial suggests that nmake cannot figure out source file dependences itself, and I don't know of anything equivelant to gcc -M that I could use. Another option might be to use vcbuild from the Windows SDK to produce 64-bit builds from my existing vcproj files. Preliminary investigations show that this doesn't really work, as my project files don't have the 64-bit configurations present. (Perhaps I could fudge this by adding the 64-bit configurations to the vcproj files in a text editor.) A final option might be to give up on MSVC, and port my project to the MinGW/MSYS toolchain.

    Read the article

  • Compile and optimize for different target architectures

    - by Peter Smit
    Summary: I want to take advantage of compiler optimizations and processor instruction sets, but still have a portable application (running on different processors). Normally I could indeed compile 5 times and let the user choose the right one to run. My question is: how can I can automate this, so that the processor is detected at runtime and the right executable is executed without the user having to chose it? I have an application with a lot of low level math calculations. These calculations will typically run for a long time. I would like to take advantage of as much optimization as possible, preferably also of (not always supported) instruction sets. On the other hand I would like my application to be portable and easy to use (so I would not like to compile 5 different versions and let the user choose). Is there a possibility to compile 5 different versions of my code and run dynamically the most optimized version that's possible at execution time? With 5 different versions I mean with different instruction sets and different optimizations for processors. I don't care about the size of the application. At this moment I'm using gcc on Linux (my code is in C++), but I'm also interested in this for the Intel compiler and for the MinGW compiler for compilation to Windows. The executable doesn't have to be able to run on different OS'es, but ideally there would be something possible with automatically selecting 32 bit and 64 bit as well. Edit: Please give clear pointers how to do it, preferably with small code examples or links to explanations. From my point of view I need a super generic solution, which is applicable on any random C++ project I have later. Edit I assigned the bounty to ShuggyCoUk, he had a great number of pointers to look out for. I would have liked to split it between multiple answers but that is not possible. I'm not having this implemented yet, so the question is still 'open'! Please, still add and/or improve answers, even though there is no bounty to be given anymore. Thanks everybody!

    Read the article

  • strict aliasing and alignment

    - by cooky451
    I need a safe way to alias between arbitrary POD types, conforming to ISO-C++11 explicitly considering 3.10/10 and 3.11 of n3242 or later. There are a lot of questions about strict aliasing here, most of them regarding C and not C++. I found a "solution" for C which uses unions, probably using this section union type that includes one of the aforementioned types among its elements or nonstatic data members From that I built this. #include <iostream> template <typename T, typename U> T& access_as(U* p) { union dummy_union { U dummy; T destination; }; dummy_union* u = (dummy_union*)p; return u->destination; } struct test { short s; int i; }; int main() { int buf[2]; static_assert(sizeof(buf) >= sizeof(double), ""); static_assert(sizeof(buf) >= sizeof(test), ""); access_as<double>(buf) = 42.1337; std::cout << access_as<double>(buf) << '\n'; access_as<test>(buf).s = 42; access_as<test>(buf).i = 1234; std::cout << access_as<test>(buf).s << '\n'; std::cout << access_as<test>(buf).i << '\n'; } My question is, just to be sure, is this program legal according to the standard?* It doesn't give any warnings whatsoever and works fine when compiling with MinGW/GCC 4.6.2 using: g++ -std=c++0x -Wall -Wextra -O3 -fstrict-aliasing -o alias.exe alias.cpp * Edit: And if not, how could one modify this to be legal?

    Read the article

  • Basic compile issue with QT4

    - by Cobus Kruger
    I've been trying to get a dead simple listing from a university textbook to compile with the newest QT SDK for Windows I downloaded last night. After struggling through the regular nonsense (no make.bat, need to manually add environment variables and so on) I am finally at the point where I can build. But only one of the two libraries seem to work. The .pro file I use is dead simple: SUBDIRS += utils \ dataobjects TEMPLATE = subdirs In each of these two subfolders I have the source for a library. Running QMAKE generates a makefile and running Make runs through all the preliminaries and then fails on the g++ call: g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc --out-implib,libdataobjects.a -shared -mthreads -Wl -Wl,--out-implib,c:\Users\Cobus\workspace\lib\libdataobjects.a -o ..\..\lib\dataobjects.dll object_script.dataobjects.Debug -L"c:\Users\Cobus\Portab~1\Qt\2010.02.1\qt\lib" -LC:\Users\Cobus\workspace\lib -lutils -lQtXmld4 -lQtGuid4 -lQtCored4 c:/users/cobus/portab~1/qt/2010.02.1/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -lutils The problem seems to be right near the end of the command line, where -lutils is added, indicating that there is a library by the name of utils. While I would have expected to see that, you'll notice the library names after --out include lib in the name, so they become libutils and libdataobjects. I have tried to figure out why this is happening, to no avail. Anyone have an idea what's going on?

    Read the article

  • C# vs C - Big performance difference

    - by John
    I'm finding massive performance differences between similar code in C anc C#. The C code is: #include <stdio.h> #include <time.h> #include <math.h> main() { int i; double root; clock_t start = clock(); for (i = 0 ; i <= 100000000; i++){ root = sqrt(i); } printf("Time elapsed: %f\n", ((double)clock() - start) / CLOCKS_PER_SEC); } And the C# (console app) is: using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { DateTime startTime = DateTime.Now; double root; for (int i = 0; i <= 100000000; i++) { root = Math.Sqrt(i); } TimeSpan runTime = DateTime.Now - startTime; Console.WriteLine("Time elapsed: " + Convert.ToString(runTime.TotalMilliseconds/1000)); } } } With the above code, the C# completes in 0.328125 seconds (release version) and the C takes 11.14 seconds to run. The c is being compiled to a windows executable using mingw. I've always been under the assumption that C/C++ were faster or at least comparable to C#.net. What exactly is causing the C to run over 30 times slower? EDIT: It does appear that the C# optimizer was removing the root as it wasn't being used. I changed the root assignment to root += and printed out the total at the end. I've also compiled the C using cl.exe with the /O2 flag set for max speed. The results are now: 3.75 seconds for the C 2.61 seconds for the C# The C is still taking longer, but this is acceptable

    Read the article

  • Should i enforce realloc check if the new block size is smaller than the initial ?

    - by nomemory
    Can realloc fail in this case ? int *a = NULL; a = calloc(100, sizeof(*a)); printf("1.ptr: %d \n", a); a = realloc(a, 50 * sizeof(*a)); printf("2.ptr: %d \n", a); if(a == NULL){ printf("Is it possible?"); } return (0); } The output in my case is: 1.ptr: 4072560 2.ptr: 4072560 So 'a' points to the same adress. So should i enforce realloc check ? Later edit: Using MinGW compiler under Windows XP. Is the behaviour similar with gcc on Linux ? Later edit 2: Is it OK to check this way ? int *a = NULL, *b = NULL; a = calloc(100, sizeof(*a)); b = realloc(a, 50 * sizeof(*a)); if(b == NULL){ return a; } a = b; return a;

    Read the article

  • fesetround with MSVC x64

    - by mr grumpy
    I'm porting some code to Windows (sigh) and need to use fesetround. MSVC doesn't support C99, so for x86 I copied an implementation from MinGW and hacked it about: //__asm__ volatile ("fnstcw %0;": "=m" (_cw)); __asm { fnstcw _cw } _cw &= ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO); _cw |= mode; //__asm__ volatile ("fldcw %0;" : : "m" (_cw)); __asm { fldcw _cw } if (has_sse) { unsigned int _mxcsr; //__asm__ volatile ("stmxcsr %0" : "=m" (_mxcsr)); __asm { stmxcsr _mxcsr } _mxcsr &= ~ 0x6000; _mxcsr |= (mode << __MXCSR_ROUND_FLAG_SHIFT); //__asm__ volatile ("ldmxcsr %0" : : "m" (_mxcsr)); __asm { ldmxcsr _mxcsr } } The commented lines are the originals for gcc; uncommented for msvc. This appears to work. However the x64 cl.exe doesn't support inline asm, so I'm stuck. Is there some code out there I can "borrow" for this? (I've spent hours with Google). Or will I have to go on a 2 week detour to learn some assembly and figure out how to get/use MASM? Any advice is appreciated. Thank you.

    Read the article

  • Xlib.h and Xutil.h not found in Eclipse, how can I fix this?

    - by eclipseNoob
    Hi, I'm a newbie to Eclipse IDE for C/C++ development. I just installed MingW and set it up as my system's environment variable. I am trying to make an application that uses the X library but eclipse cant seem to find it. Eclipse works with any other simple standard library functions but it cant find the X library. Please Help! Here's a sample code snippet that's failing: #include <stdio.h> #include <X11/Xlib.h> // Can't find this #include <X11/Xutil.h> // Or this... int main() { printf("Hello"); return 0; } Do I have to download the X library from somewhere? If so then from where and where do I paste it to? Please tell me what to do in order for me to start coding using the Xlib in Eclipse. If you find any useful links, please dont hesitate to post. Thanks.

    Read the article

  • C headers: compiler specific vs library specific?

    - by leonbloy
    Is there some clear-cut distinction between standard C *.h header files that are provided by the C compiler, as oppossed to those which are provided by a standard C library? Is there some list, or some standard locations? Motivation: int this answer I got a while ago, regarding a missing unistd.h in the latest TinyC compiler, the author argued that unistd.h (contrarily to sys/unistd.h) should not be provided by the compiler but by your C library. I could not make much sense of that response (for one thing shouldn't that also apply to, say, stdio.h?) but I'm still wondering about it. Is that correct? Where is some authoritative reference for this? Looking in other compilers, I see that other "self contained" POSIX C compilers that are hosted in Windows (like the GCC toolchain that comes with MinGW, in several incarnations; or Digital Mars compiler), include all header files. And in a standard Linux distribution (say, Centos 5.10) I see that the gcc package provides a few header files (eg, stdbool.h, syslimits.h) in /usr/lib/gcc/i386-redhat-linux/4.1.1/include/, and the glibc-headers package provides the majority of the headers in /usr/include/ (including stdio.h, /usr/include/unistd.h and /usr/include/sys/unistd.h). So, in neither case I see support for the above claim.

    Read the article

  • opengl + glew in Eclipse (for windows)

    - by echo
    I'm trying to get glew to work under eclipse (mingw) in windows. Seems as if it is extremely unusual not to use Visual Studio in this context. The install instructions for glew is simply "use the project file in build/vc6/"... The glew readme also writes: "If you wish to build GLEW from scratch (update the extension data from the net or add your own extension information), you need a Unix environment (including wget, perl, and GNU make). The extension data is regenerated from the top level source directory with: make extensions" In order to get glew to work in eclipse and windows I have to compile it in a unix environment? Is there no other way? Sure, it would probably be a learning experience to pull that off (if I were to succeed) but I feel that my time is best spent actually working on my project. And even if I did manage to crosscompile everything, would it work in anything but Visual Studio? Is the whole thing unfeasible and the best solution is to install Visual Studio? Google haven't been of much help, I feel like I am the only one that has ever attempted to do this (is there a good reason this?).

    Read the article

  • FORTRAN: Invalid form for an assignment

    - by Sam Goodness
    I can't get this code to compile uding either the g77 minGW compiler or the g95 compiler. Does anyone know why? I get these errors with the g77: diff5z10.for: In subroutine `diffract': diff5z10.for:579: Tropo100 = 20.34 - .077 * Dist ^ Invalid form for assignment statement at (^) diff5z10.for:581: IF (Freq .GT. 1000) FreqAdj = 24.5 - 7200/(Freq+3000) ^ Invalid form for assignment statement at (^) and i get these errors when compiling with g95: In file diff5z10.for:574 CLUTTER = steep*CLUTTER 1 Error: Unclassifiable statement at (1) In file diff5z10.for:580 FreqAdj = 23.978 - 58026.76 / (Freq + 2320) 1 Error: Unclassifiable statement at (1) here is the code from this section of the program: (starting with line 362) Span = .28 - .144 * (Round - 1.2) Para = C / Span**2 IF (Ratio .GT. .4) Para = 6.25 * (C - 1) CLUTTER = Para * (RATIO - .4)**2 - C IF (CLUTTER .GT. 0.) CLUTTER = 0. CSlope = SQRT(freq)/350 steep = 1 + CSlope * (dist - Horizon) IF (steep .LT. 0) steep = 0 IF (steep .GT. 1) steep = 1 CLUTTER = steep*CLUTTER Tropo100 = 20.34 - .077 * Dist FreqAdj = 23.978 - 58026.76 / (Freq + 2320) IF (Freq .GT. 1000) FreqAdj = 24.5 - 7200/(Freq+3000) TropoFd = Tropo100 - FreqAdj FS_field = 106.9 - 20 * LOG10(Dist) Scatter = TropoFd - FS_field !loss ref to free space DiffL = Scatter - DLOSS Combine = 150/(20 - DiffL) - 5 IF (DiffL .LT. -10) Combine = 0 IF (DiffL .GT. 10) Combine = DiffL DLOSS = DLOSS + Combine RETURN END

    Read the article

  • How to modify Keyboard interrupt (under Windows XP) from a C++ Program ?

    - by rockr90
    Hi everyone ! We have been given a little project (As part of my OS course) to make a Windows program that modifies keyboard input, so that it transforms any lowercase character entered into an uppercase one (without using caps-lock) ! so when you type on the keyboard you'll see what you're typing transformed into uppercase ! I have done this quite easily using Turbo C by calling geninterrupt() and using variables _AH, _AL, i had to read a character using: _AH = 0x07; // Reading a character without echo geninterrupt(0x21); // Dos interrupt Then to transform it into an Upercase letter i have to mask the 5th bit by using: _AL = _AL & 0xDF; // Masking the entered character with 11011111 and then i will display the character using any output routine. Now, this solution will only work under old C DOS compilers. But what we intend to do is to make a close or similar solution to this by using any modern C/C++ compiler under Windows XP ! What i have first thought of is modifying the Keyboard ISR so that it masks the fifth bit of any entered character to turn it uppercase ! But i do not know how exactly to do this. Second, I wanted to create a Win32 console program to either do the same solution (but to no avail) or make a windows-compatible solution, still i do not know which functions to use ! Third I thought to make a windows program that modifies the ISR directly to suit my needs ! and i'm still looking for how to do this ! So please, If you could help me out on this, I would greatly appreciate it ! Thank you in advance ! (I'm using Windows XP on intel X86 with mingw-GCC compiler.)

    Read the article

  • Can't get node.js built on cygwin

    - by mwt
    Following the instructions here: https://github.com/ry/node/wiki/Building-node.js-on-Cygwin-(Windows) I've tried installing on two machines, either of which I'd be happy to get up and running. WinXP On 'make', I get: Build failed: -> task failed <err #2>: {task: libv8.a SConstruct -> libv8.a} According to the instructions, this is caused by having $SHELL set to a Windows style path, but I've set it to /bin/bash and get the same error. Win7 On './configure', I get: $ ./configure Checking for program g++ or c++ : /usr/bin/g++ Checking for program cpp : /usr/bin/cpp Checking for program ar : /usr/bin/ar Checking for program ranlib : /usr/bin/ranlib Checking for g++ : ok Checking for program gcc or cc : /usr/bin/gcc 0 [main] python 1092 C:\bin\python.exe: *** fatal error - unable to remap \\?\C:\lib\python2.6\lib-dynload\_functools.dll to same address as parent: 0x360000 != 0x3E0000 Stack trace: Frame Function Args 002891E8 6102749B (002891E8, 00000000, 00000000, 00000000) 002894D8 6102749B (61177B80, 00008000, 00000000, 61179977) 0028A508 61004AFB (611A136C, 61241CF4, 00360000, 003E0000) End of stack trace 0 [main] python 3536 fork: child 1092 - died waiting for dll loading, errno 11 /Users/Michael/Desktop/node/wscript:177: error: could not configure a c compiler! I've run 'rebaseall' and restarted the machine but still get that error. Edit: Ok, rebaseall was apparently erroring on some mingw stuff, so I edited the rebaseall script to fix that, and now it configures on Win7. The new problem is that it emits the exact same error as my XP machine now when I try to make. This is on tag v0.3.5.

    Read the article

  • which file stored os.environ,and store where , disk c: or disk d:

    - by zjm1126
    my code is : os.environ['ss']='ssss' print os.environ and it show : {'TMP': 'C:\\DOCUME~1\\ADMINI~1\\LOCALS~1\\Temp', 'COMPUTERNAME': 'PC-200908062210', 'USERDOMAIN': 'PC-200908062210', 'COMMONPROGRAMFILES': 'C:\\Program Files\\Common Files', 'PROCESSOR_IDENTIFIER': 'x86 Family 6 Model 15 Stepping 2, GenuineIntel', 'PROGRAMFILES': 'C:\\Program Files', 'PROCESSOR_REVISION': '0f02', 'SYSTEMROOT': 'C:\\WINDOWS', 'PATH': 'C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\Hewlett-Packard\\IAM\\bin;C:\\Program Files\\Common Files\\Thunder Network\\KanKan\\Codecs;D:\\Program Files\\TortoiseSVN\\bin;d:\\Program Files\\Mercurial\\;D:\\Program Files\\Graphviz2.26.3\\bin;D:\\TDDOWNLOAD\\ok\\gettext\\bin;D:\\Python25;C:\\Program Files\\StormII\\Codec;C:\\Program Files\\StormII;D:\\zjm_code\\;D:\\Python25\\Scripts;D:\\MinGW\\bin;d:\\Program Files\\Google\\google_appengine\\', 'TEMP': 'C:\\DOCUME~1\\ADMINI~1\\LOCALS~1\\Temp', 'BID': '56727834-D5C3-4EBF-BFAA-FA0933E4E721', 'PROCESSOR_ARCHITECTURE': 'x86', 'ALLUSERSPROFILE': 'C:\\Documents and Settings\\All Users', 'SESSIONNAME': 'Console', 'HOMEPATH': '\\Documents and Settings\\Administrator', 'USERNAME': 'Administrator', 'LOGONSERVER': '\\\\PC-200908062210', 'COMSPEC': 'C:\\WINDOWS\\system32\\cmd.exe', 'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH', 'CLIENTNAME': 'Console', 'FP_NO_HOST_CHECK': 'NO', 'WINDIR': 'C:\\WINDOWS', 'APPDATA': 'C:\\Documents and Settings\\Administrator\\Application Data', 'HOMEDRIVE': 'C:', 'SS': 'ssss', 'SYSTEMDRIVE': 'C:', 'NUMBER_OF_PROCESSORS': '2', 'PROCESSOR_LEVEL': '6', 'OS': 'Windows_NT', 'USERPROFILE': 'C:\\Documents and Settings\\Administrator'} i find google-app-engine set user_id in os.version not in session,look here at line 96-100 and line 257 , and aeoid at line 177 , and i want to know : which file stored os.environ ,and store where , disk c: ,or disk d: ? thanks

    Read the article

  • How do I distribute my slightly customized Linux in VirtualBox?

    - by goodrone
    Suppose I've got some Arch Linux installation which I'd like to distribute among students with (sometimes very) basic Linux knowledge to make them able to compile C programs in an environment very similar to that in the university. (Things like Cygwin or MinGW seem to be inappropriate here.) I also choose VirtualBox as a holder for the virtual system. The question is: how do I distribute it? I mean: installing VirtualBox on the target machine (if not still installed) uncompressing and copying my image file (.VDI) registering the image (so that VirtualBox could see it when launched) configuring the guest system in VirtualBox (network, memory, etc.) optionally installing PuTTY to simplify interfacing with the guest Linux Should I create an installer? Which one? Or just write some .BAT-scripts? (Target host system is Windows, mostly XP and Vista.) I definately don't want to have a webpage with screen shot explaining where to click and what to press, because it's boring. Additionaly, what will be the best (the most user-friendly) way to configure network when the guest Linux system is run for the first time?

    Read the article

  • Howcome some C++ functions with unspecified linkage build with C linkage?

    - by christoffer
    This is something that makes me fairly perplexed. I have a C++ file that implements a set of functions, and a header file that defines prototypes for them. When building with Visual Studio or MingW-gcc, I get linking errors on two of the functions, and adding an 'extern "C"' qualifier resolved the error. How is this possible? Header file, "some_header.h": // Definition of struct DEMO_GLOBAL_DATA omitted DWORD WINAPI ThreadFunction(LPVOID lpData); void WriteLogString(void *pUserData, const char *pString, unsigned long nStringLen); void CheckValid(DEMO_GLOBAL_DATA *pData); int HandleStart(DEMO_GLOBAL_DATA * pDAta, TCHAR * pLogFileName); void HandleEnd(DEMO_GLOBAL_DATA *pData); C++ file, "some_implementation.cpp" #include "some_header.h" DWORD WINAPI ThreadFunction(LPVOID lpData) { /* omitted */ } void WriteLogString(void *pUserData, const char *pString, unsigned long nStringLen) { /* omitted */ } void CheckValid(DEMO_GLOBAL_DATA *pData) { /* omitted */ } int HandleStart(DEMO_GLOBAL_DATA * pDAta, TCHAR * pLogFileName) { /* omitted */ } void HandleEnd(DEMO_GLOBAL_DATA *pData) { /* omitted */ } The implementations compile without warnings, but when linking with the UI code that calls these, I get a normal error LNK2001: unresolved external symbol "int __cdecl HandleStart(struct _DEMO_GLOBAL_DATA *, wchar_t *) error LNK2001: unresolved external symbol "void __cdecl CheckValid(struct _DEMO_MAIN_GLOBAL_DATA * What really confuses me, now, is that only these two functions (HandleStart and CheckValid) seems to be built with C linkage. Explicitly adding "extern 'C'" declarations for only these two resolved the linking error, and the application builds and runs. Adding "extern 'C'" on some other function, such as HandleEnd, introduces a new linking error, so that one is obviously compiled correctly. The implementation file is never modified in any of this, only the prototypes.

    Read the article

  • How am i overriding this C++ inherited member function without the virtual keyword being used?

    - by Gary Willoughby
    I have a small program to demonstrate simple inheritance. I am defining a Dog class which is derived from Mammal. Both classes share a simple member function called ToString(). How is Dog overriding the implementation in the Mammal class, when i'm not using the virtual keyword? (Do i even need to use the virtual keyword to override member functions?) mammal.h #ifndef MAMMAL_H_INCLUDED #define MAMMAL_H_INCLUDED #include <string> class Mammal { public: std::string ToString(); }; #endif // MAMMAL_H_INCLUDED mammal.cpp #include <string> #include "mammal.h" std::string Mammal::ToString() { return "I am a Mammal!"; } dog.h #ifndef DOG_H_INCLUDED #define DOG_H_INCLUDED #include <string> #include "mammal.h" class Dog : public Mammal { public: std::string ToString(); }; #endif // DOG_H_INCLUDED dog.cpp #include <string> #include "dog.h" std::string Dog::ToString() { return "I am a Dog!"; } main.cpp #include <iostream> #include "dog.h" using namespace std; int main() { Dog d; std::cout << d.ToString() << std::endl; return 0; } output I am a Dog! I'm using MingW on Windows via Code::Blocks.

    Read the article

  • cython setup.py gives .o instead of .dll

    - by alok1974
    Hi, I am a newbie to cython, so pardon me if I am missing something obvious here. I am trying to build c extensions to be used in python for enhanced performance. I have fc.py module with a bunch of function and trying to generate a .dll through cython using dsutils and running on win64: c:\python26\python c:\cythontest\setup.py build_ext --inplace I have the dsutils.cfg in C:\Python26\Lib\distutils. As required the disutils.cfg has the following config settings: [build] compiler = mingw32 My startup.py looks like this: from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext ext_modules = [Extension('fc', [r'C:\cythonTest\fc.pyx'])] setup( name = 'FC Extensions', cmdclass = {'build_ext': build_ext}, ext_modules = ext_modules ) I have latest version mingw for target/host amdwin64 type builds. I have the latest version of cython for python26 for win64. Cython does give me an fc.c without errors, only a few warning for type conversions, which I will handle once I have it right. Further it produces fc.def an fc.o files Instead of giving a .dll. I get no errors. I find on threads that it will create the .so or .dll automatically as required, which is not happening.

    Read the article

  • C++: Weird Segmentation fault.

    - by Kleas
    I am trying to print something using C++. However, I am running into a strange bug that has left me clueless, I use the following code: PRINTDLG pd; ZeroMemory(&pd, sizeof(pd)); pd.lStructSize = sizeof(pd); pd.Flags = PD_RETURNDEFAULT; PrintDlg(&pd); // Set landscape DEVMODE* pDevMode = (DEVMODE*)GlobalLock(pd.hDevMode); pDevMode->dmOrientation = DMORIENT_LANDSCAPE; pd.hwndOwner = mainWindow; pd.Flags = PD_RETURNDC | PD_NOSELECTION; GlobalUnlock(pd.hDevMode); if (PrintDlg(&pd)) { DOCINFO di; di.cbSize = sizeof(DOCINFO); di.lpszDocName = "Test Print"; di.lpszOutput = (LPTSTR)NULL; di.fwType = 0; //start printing StartDoc(pd.hDC, &di); int a; int b; int c; int d; int e; int f; // int g; // Uncomment this -> CRASH EndDoc(pd.hDC); DeleteDC(pd.hDC); } else { cout << "Did not print: " << CommDlgExtendedError() << endl; } The moment I uncomment 'int g;' I get a: "Program received signal SIGSEGV, Segmentation fault." I use codeblocks and the mingw compiler, both up to date. What could be causing this?

    Read the article

  • Integrate QT and OpenCV in Visual Studio

    - by user2891190
    Sorry If you feel that this is an already asked question. But I googled for more than 2 days any tried lots of solution which given through stackoverflow and referred lots of tutorials. But I couldn't get a proper idea. I am already working in a project which use c++(visual studio) with opencv which I am developing as my university project. I have developing this for last 2 months. But now I want to add a better UI.(Previously I considered only on the functionality) So I decided to move into QT. I'm new to QT. So I did some google search. I know that I can do this with the QT creator. But I want to do this in visual studio as the functionality of my project is bit complex. What I already know is I have to build opencv with Qt using cmake. I followed few tutorials. But most of the tutorials use mingw and QT creator. http://www.anlak.com/build-debug-opencv-vs2010/ Accoring to above tutorial I generated a visual studio project using cmake. But when I tried to open that solution file my visual studio becomes not-responding. I can't figure out the reason. I tried two days and I couldn't find a proper tutorial which describes integration of QT and opencv in visual studio. So can someone give me the instruction to integrate QT and Opencv in visual studio.

    Read the article

< Previous Page | 6 7 8 9 10 11 12  | Next Page >