Search Results

Search found 2220 results on 89 pages for 'gcc'.

Page 3/89 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Using MSADO15.DLL and C++ with MinGW/GCC on Windows Vista

    - by Eugen Mihailescu
    INTRODUCTION Hi, I am very new to C++, is my 1st statement. I have started initially with VC++ 2008 Express, I've notice that GCC becomes kind of standard so I am trying to make the right steps event from the beginning. I have written a piece of code that connects to MSSQL Server via ADO, on VC++ it's working like a charm by importing MSADO15.dll: #import "msado15.dll" no_namespace rename("EOF", "EndOfFile") Because I am going to move from VC++ I was looking for an alternative (eventually multi-platform) IDE, so I stick (for this time) with Code::Block (I'm using last nightly buil, SVN 6181). As compiler I choose to use GCC 3.4.5 (ported via MinGW 5.1.6), under Vista. I was trying to compile a simple "hello world" application with GCC that use/import the same msado15.dll (#import "c:\Program Files\Common Files\System\ADO\msado15.dll" no_namespace rename("EOF", "EndOfFile")) and I was surprised to see a lot of compile-time errors. I was expected that the #import compiler's directive will generate a library from "msado15.dll" so it can link to it later (link-edit time or whatever). Instead it was trying to read it as a normal file (like a header file,if you like) because it was trying to interprete each line in the DLL (which has a MZ signature): Example: Compiling: main.cpp E:\MyPath\main.cpp:2:64: warning: extra tokens at end of #import directive In file included from E:\MyPath\main.cpp:2: c:\Program Files\Common Files\System\ADO\msado15.dll:1: error: stray '\144' in program In file included from E:\MyPath\main.cpp:2: c:\Program Files\Common Files\System\ADO\msado15.dll:1:4: warning: null character(s) ignored c:\Program Files\Common Files\System\ADO\msado15.dll:1: error: stray '\3' in program c:\Program Files\Common Files\System\ADO\msado15.dll:1:6: warning: null character(s) ignored c:\Program Files\Common Files\System\ADO\msado15.dll:1: error: stray '\4' in program ... and so on. MY QUESTION Well, it is obvious that under this version of GCC the #import directive does not do the expected job (perhaps #import is not supported anymore by GCC), so finally my question: how to use the ADO to access MSSQL database on a C++ program compiled with GCC (v3.4.5)?

    Read the article

  • gcc compilation without using system defined header locations

    - by bogertron
    I am attempting to compile a c++ class using gcc. Due to the nature of the build, I need to invoke gcc from a non-standard location and include non-system defined headers, only to add a set from a different location. However, when I do this, I run into an issue where I cannot find some base symbols (suprise suprise). So i am basically running this command to compile my code: -->(PARENT_DIR)/usr/bin/gcc # invoke compiler -B$(PARENT_DIR)/usr/lib64/gcc/suselinux-x8664 -B$(PARENT_DIR)/usr/lib64 #C/C++ flags -fPIC -fvisibility=default -g -c -Wall -m64 -nostdinc # source files -I$(SRC_DIR_ONE)/ -I$(SRC_DIR_TWO) -I../include # 'Mock' include the system header files -I$(PARENT_DIR)/usr/include/c++/$(GCC_VERSION) -I$(PARENT_DIR)/usr/include/c++/$(GCC_VERSION)/backward -I$(PARENT_DIR)/usr/include/c++/$(GCC_VERSION)/x86_64-suse-linux -I$(PARENT_DIR)/usr/lib64/x86_64-suse-linux/$(GCC_VERSION)/include -I$(PARENT_DIR)/usr/lib64/gcc/x86_64-suse-linux/$(GCC_VERSION)/include -I$(PARENT_DIR)/usr/lib64/gcc/x86_64-suse-linux/$(GCC_VERSION)/include-fixed -I$(PARENT_DIR)/usr/src/linux/include -I$(PARENT_DIR)/usr/x86_64-suse-linux/include -I$(PARENT_DIR)/usr/include/suselinux-x8664 -I$(PARENT_DIR)/usr/suselinux-x8664/include -I$(PARENT_DIR)/usr/include -I$(PARENT_DIR)/usr/include/linux file.cpp I am getting several errors which indicate that the base headers are not being included: such as: $(PARENT_DIR)/usr/include/c++/$(GCC_VERSION)/cstddef ::prtdiff_t has not been declared $(PARENT_DIR)/usr/include/c++/$(GCC_VERSION)/cstddef ::size_t has not bee declared. Is there something that I am doing wrong when I include the header file directories? Or am I looking in the wrong place?

    Read the article

  • gcc, strict-aliasing, and casting through a union

    - by Joseph Quinsey
    About a year ago the following paragraph was added to the GCC Manual, version 4.3.4, regarding -fstrict-aliasing: Similarly, access by taking the address, casting the resulting pointer and dereferencing the result has undefined behavior [emphasis added], even if the cast uses a union type, e.g.: union a_union { int i; double d; }; int f() { double d = 3.0; return ((union a_union *)&d)->i; } Does anyone have an example to illustrate this undefined behavior? Note this question is not about what the C99 standard says, or does not say. It is about the actual functioning of gcc, and other existing compilers, today. My simple, naive, attempt fails. For example: #include <stdio.h> union a_union { int i; double d; }; int f1(void) { union a_union t; t.d = 3333333.0; return t.i; // gcc manual: 'type-punning is allowed, provided ...' } int f2(void) { double d = 3333333.0; return ((union a_union *)&d)->i; // gcc manual: 'undefined behavior' } int main(void) { printf("%d\n", f1()); printf("%d\n", f2()); return 0; } works fine, giving on CYGWIN: -2147483648 -2147483648 Also note that taking addresses is obviously wrong (or right, if you are trying to illustrate undefined behavior). For example, just as we know this is wrong: extern void foo(int *, double *); union a_union t; t.d = 3.0; foo(&t.i, &t.d); // UD behavior so is this wrong: extern void foo(int *, double *); double d = 3.0; foo(&((union a_union *)&d)->i, &d); // UD behavior For background discussion about this, see for example: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1422.pdf http://gcc.gnu.org/ml/gcc/2010-01/msg00013.html http://davmac.wordpress.com/2010/02/26/c99-revisited/ http://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.html http://stackoverflow.com/questions/98650/what-is-the-strict-aliasing-rule http://stackoverflow.com/questions/2771023/c99-strict-aliasing-rules-in-c-gcc/2771041#2771041 The first link, draft minutes of an ISO meeting seven months ago, notes in section 4.16: Is there anybody that thinks the rules are clear enough? No one is really able to interpret tham.

    Read the article

  • Yesterday's broken codebase hunt me back

    - by sandun dhammika
    I need a fun oky. I just love this openmoko hardware and hacking into it. Please could somebody help me to compile qemu.I 'm so sad and I want to compile qemu and it required the GCC3.x and then I downloaded gcc 3.2 but when I configure it and build it, it gives a very sad error message. G_FOR_TARGET=" "SHELL=/bin/sh" "EXPECT=expect" "RUNTEST=runtest" "RUNTESTFLAGS=" "exec_prefix=/gcc-3.2" "infodir=/gcc-3.2/info" "libdir=/gcc-3.2/lib" "prefix=/gcc-3.2" "tooldir=/gcc-3.2/i686-pc-linux-gnu" "AR=ar" "AS=as" "CC=gcc" "CXX=c++" "LD=ld" "LIBCFLAGS=-g -O2" "NM=nm" "PICFLAG=" "RANLIB=ranlib" "DESTDIR=" DO=all multi-do make[1]: Leaving directory `/gcc-3.2/gcc-3.2/zlib' make[1]: Entering directory `/gcc-3.2/gcc-3.2/fastjar' make[1]: Leaving directory `/gcc-3.2/gcc-3.2/fastjar' make[1]: Entering directory `/gcc-3.2/gcc-3.2/gcc' gcc -c -DIN_GCC -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I. -I./. -I./config -I./../include ./read-rtl.c -o read-rtl.o In file included from ./read-rtl.c:24:0: ./rtl.h:125:3: warning: type of bit-field ‘code’ is a GCC extension ./rtl.h:128:3: warning: type of bit-field ‘mode’ is a GCC extension ./read-rtl.c: In function ‘fatal_with_file_and_line’: ./read-rtl.c:61:1: warning: traditional C rejects ISO C style function definitions ./read-rtl.c: In function ‘read_rtx’: ./read-rtl.c:662:8: error: lvalue required as increment operand make[1]: *** [read-rtl.o] Error 1 make[1]: Leaving directory `/gcc-3.2/gcc-3.2/gcc' make: *** [all-gcc] Error 2 This is so sad and this is sooo bad. I have searched patches and workaround all over the Internet to this,but I couldn't find any alternative for this. I'm out of my patience now. I want that virtual machine ready and I want to make a debug host cos I don't have some money to buy original neo 1937 hardware. The patch that I have found comes with a nasty error too. I'm so sick of it.Any idea how could I fix this problem and make this work? Please please I'm begging you somebody help me please. Thanks all.

    Read the article

  • gcc ignores LC_ALL

    - by user332433
    Hi, I was trying to get gcc give error message in a different language. But it still gives me the error message in english. my locale output varun@varun-desktop:$ locale LANG=en_IN LC_CTYPE="es_EC.utf8" LC_NUMERIC="es_EC.utf8" LC_TIME="es_EC.utf8" LC_COLLATE="es_EC.utf8" LC_MONETARY="es_EC.utf8" LC_MESSAGES="es_EC.utf8" LC_PAPER="es_EC.utf8" LC_NAME="es_EC.utf8" LC_ADDRESS="es_EC.utf8" LC_TELEPHONE="es_EC.utf8" LC_MEASUREMENT="es_EC.utf8" LC_IDENTIFICATION="es_EC.utf8" LC_ALL=es_EC.utf8 gcc.mo is present in my /usr/share/local/es i am also getting the error messages for other programs like apt in spanish but not gcc. Can anybody help me in this regard?? I am using gcc-4.4.3 on 64bit ubuntu 10.04 machine thank you

    Read the article

  • Ruby Enterprise fails to compile with GCC 4.5

    - by Andrew
    Ruby Enterprise Edition fails to compile from sources with GCC 4.5, but sucessfully compiles with 4.3.3. Actually, not sure if it's about GCC, but, in fact, i686 Arch linux system with laest updates won't compile RE. Compilation fails with the message: mkdir -p .ext/common make PRELIBS='-Wl,-rpath,/opt/ruby-enterprise-1.8.7-2010.01/lib -L/opt/ruby-enterprise-1.8.7-2010.01/lib -ltcmalloc_minimal ' ./lib/fileutils.rb:1215: [BUG] Segmentation fault ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2010.01 make: *** [.rbconfig.time] Aborted Are there any solutions excepting GCC downgrade?

    Read the article

  • GCC - How to realign stack?

    - by psihodelia
    I try to build an application which uses pthreads and __m128 SSE type. According to GCC manual, default stack alignment is 16 bytes. In order to use __m128, the requirement is the 16-byte alignment. My target CPU supports SSE. I use a GCC compiler which doesn't support runtime stack realignment (e.g. -mstackrealign). I cannot use any other GCC compiler version. My test application looks like: #include <xmmintrin.h> #include <pthread.h> void *f(void *x){ __m128 y; ... } int main(void){ pthread_t p; pthread_create(&p, NULL, f, NULL); } The application generates an exception and exits. After a simple debugging (printf "%p", &y), I found that the variable y is not 16-byte aligned. My question is: how can I realign the stack properly (16-byte) without using any GCC flags and attributes (they don't help)? Should I use GCC inline Assembler within this thread function f()?

    Read the article

  • avr-gcc Atmel AVR microncontrollers on Linux / Windows Arduino IDE

    - by Prakash
    I recently heard all about avr-gcc and avr-lib support on Linux that can be used for developing code for Atmel AVR micro-controller (ATmega48/88/168, ATmega16/32). I also understand that Arduino also uses Atmel's AVR micro-controller (I am not sure which one). Now different vendors have designed their own product (using Atmel AVR uc) where code is to be developed using avr-gcc i.e. on Linux platform. In the same regards Arduino's Windows IDE is much simpler and easy to code with. I am confused as to which platform is more promising - what are the benefits of learning avr-gcc? Which is the better option to program using the same? What type of application can we develop using avr-gcc compiler?

    Read the article

  • math library in gcc

    - by Betamoo
    I am writing a program on linux gcc... When I tried to include <math.h> I found that I need to link math library by using command gcc -lm But I am searching for another way to link the math library 'in code', that does not require the user to compile using any options.. Can gcc -lm be done in c code using #pragma or something? EDIT: I have changed -ml to -lm

    Read the article

  • argument order in cygwin gcc 4.3 matters when linking with glib-2.0

    - by SetJmp
    I am trying to compile code that works on os x and linux using cygwin. However, I am finding that the argument order to gcc gives unanticipated results. For example, the following fails: gcc -std=gnu99 `pkg-config --libs glib-2.0 --cflags glib-2.0` nb-learn.c but the following works: gcc -std=gnu99 nb-learn.c `pkg-config --libs glib-2.0 --cflags glib-2.0` Can someone explains how this works? Also, are there techniques or code I can look at for getting autoconf to change the argument order depending on the platform? Thanks, SetJmp (gcc 4.3.4)

    Read the article

  • Learning to read GCC assembler output

    - by porgarmingduod
    I'm considering picking up some very rudimentary understanding of assembly. My current goal is simple: VERY BASIC understanding of GCC assembler output when compiling C/C++ with the -S switch. Just enough to do simple things such as looking at a single function and verifying whether GCC optimizes away things I expect to disappear. Does anyone have/know of a truly concise introduction to assembly, relevant to GCC and specifically for the purpose of reading, and a list of the most important instructions anyone casually reading assembly should know?

    Read the article

  • simple IDE in C,link my program to gcc

    - by Moein Hoseini Manesh
    hi my friends, I wanna to write simple C compiler,I wrote some parts of it it can check synetic of C,now I need to link my program to gcc how can I do it? I wanna to link it,for example when user open file in my programm,gcc compile it and save it where the user want. now I don't now how to say gcc to complie this file,show error and ... [english is not my mother language,and my english is not so well,so I apologize for any mistake in my post or If I can't reached my mean]

    Read the article

  • Tips on using GCC as a new user

    - by ultrajohn
    I am really new to GCC and I don't how to use it. I already have a copy of a pre-compiled gcc binaries i've downloaded from one of the mirror sites in the gcc website.. Now, I don't where to go from here... Please give me some tips on the different path to proceed.. I am sorry for the rather vague question.. What I want are tips on how to use GCC... I've programmed in C in the past using the TC compiler... Thanks! I really appreciate all of your suggestions... Thanks again.. :)

    Read the article

  • GCC compiling a dll with __stdcall

    - by Chad
    When we compile a dll using __stdcall inside visual studio 2008 the compiled function names inside the dll are. FunctionName Though when we compile the same dll using GCC using wx-dev-cpp GCC appends the number of paramers the function has, so the name of the function using Dependency walker looks like. FunctionName@numberOfParameters or == FunctionName@8 How do you tell GCC compiler to remove @nn from exported symbols in the dll?

    Read the article

  • Tips on using GCC as a new programmer

    - by ultrajohn
    I am really new to GCC and I don't how to use it. I already have a copy of a pre-compiled gcc binaries i've downloaded from one of the mirror sites in the gcc website.. Now, I don't where to go from here... Please give me some tips on the different path to proceed..

    Read the article

  • Are nested functions a bad thing in gcc ?

    - by LB
    Hi, I know that nested functions are not part of the standard C, but since they're present in gcc (and the fact that gcc is the only compiler i care about), i tend to use them quite often. Is this a bad thing ? If so, could you show me some nasty examples ? What's the status of nested functions in gcc ? Are they going to be removed ? thanks

    Read the article

  • Two method for linking a object using GCC ?

    - by bluewater
    I've known that I should use -l option for liking objects using GCC. that is gcc -o test test.c -L./ -lmy But I found that "gcc -o test2 test.c libmy.so" is working, too. When I use readelf for those two executable I can't find any difference. Then why people use -l option for linking objects? Does it have any advantage?

    Read the article

  • GCC fatal error: stdio.h: No such file or directory

    - by user2615799
    I'm trying to compile a program in C on OS X 10.9 with GCC 4.9 (experimental). For some reason, I'm getting the following error at compile time: gcc: fatal error: stdio.h: No such file or directory I then tried a simple Hello World program: #include <stdio.h> int main(int *argc, const char *argv[]) { printf("Hello, world!"); return 0; } Again, upon running gcc -o ~/hello ~/hello.c, I got the same error. I'm using an experimental version of gcc, but it seems implausible that there would be a release which generated errors upon importing stdio. What could be causing this issue, and how can it be fixed?

    Read the article

  • Why is gcc failing with "unrecognized command line option "-L/lusr/opt/mpfr-2.4.2/lib" "?

    - by Mike
    My sysadmin recently installed a new version of GCC, in /lusr/opt/gcc-4.4.3. I tested it as follows: mike@canon:~$ cat test.c int main(){ return 0; } mike@canon:~$ gcc test.c /lusr/opt/gcc-4.4.3/libexec/gcc/i686-pc-linux-gnu/4.4.3/cc1: error while loading shared libraries: libmpfr.so.1: cannot open shared object file: No such file or directory After informing my sysadmin about this, he said to add /lusr/opt/mpfr-2.4.2/lib:/lusr/opt/gmp-4.3.2/lib to my LD_LIBRARY_PATH. After doing this, I get the following error: mike@canon:~$ gcc test.c cc1: error: unrecognized command line option "-L/lusr/opt/mpfr-2.4.2/lib" First, my sysadmin wasn't entirely sure this was the best workaround(though he did say it worked for him...), so is there a better solution? Second, why am I getting a linker error from cc, and how can I fix it? Some information which may be helpful: mike@canon:~$ env | grep mpfr OLDPWD=/lusr/opt/mpfr-2.4.2/lib LD_LIBRARY_PATH=/lusr/opt/mpfr-2.4.2/lib:/lusr/opt/gmp-4.3.2/lib: mike@canon:~$ echo $LDFLAGS (the above is a blank line)

    Read the article

  • How to install old versions of gcc on Fedora without a VM?

    - by mikeh
    Hi, I need gcc 4.3 running alongside the shipped 4.4 on an FC13 machine. I can't do the VM solution discussed at http://serverfault.com/questions/88445/how-to-install-old-versions-of-gcc-on-fedora-12 since I need hardware access (CUDA computations on the graphics card). There's no compat-gcc-43 package (only compat-gcc-34). So I've built gcc by hand and am now trying to decide how to "install" it. Could anyone confirm that this was my only option, and/or suggest a best practice for how to manage the side-by-side gcc versions?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >