Search Results

Search found 2303 results on 93 pages for 'llvm gcc'.

Page 11/93 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • GCC / C++ Static linking for headers in a shared object

    - by Swaroop S
    -I am trying to create a shared object libfoo.so. libfoo.so is created from "foo.c" - Assume that I include headers "static.h" and "Dynamic.h" where in I want the compiler to resolve the symbols for Static.h and leave the rest ie from Dynamic.h for runtime. - How do i do this ? What are the CFLAG and LDFLAG options that I need to pass. - My makefile is setup to create a shared object using the CFLAGS=fPIC , shared , W1,export-dynamic. - In the include paths i Specify the correct location for "Static.h" Can someone help me ?

    Read the article

  • syscall from within GCC inline assembly

    - by guest
    is it possible to write a single character using a syscall from within an inline assembly block? if so, how? it should look "something" like this: __asm__ __volatile__ ( " movl $1, %%edx \n\t" " movl $80, %%ecx \n\t" " movl $0, %%ebx \n\t" " movl $4, %%eax \n\t" " int $0x80 \n\t" ::: "%eax", "%ebx", "%ecx", "%edx" ); $80 is 'P' in ascii, but that returns nothing. any suggestions much appreciated!

    Read the article

  • How to deprecate a macro in GCC?

    - by Eric
    Hi, i Know how to use attribute deprecated to deprcate a function like this: int old_fn () __attribute__ ((deprecated)); But how to deprecate a Macro like this: #define OLD_MACRO 1 Thank you in advance. Eric

    Read the article

  • gcc architecture question

    - by Andy
    Hi, I'm compiling my program with architecture set to -mtune=i386 However, I'm also linking statically against several libs (libpng, zlib, jpeglib, vorbisfile, libogg). I've built these libs on my own using configure and make, so I guess these libs were built with architecture being set to my system's architecture which would be i686. But I don't want that! I want my program to run on i386, too, so I need to make sure that all these libs that I'm statically linking against are built for i386, too. So my question: Is there a convenient way to build libpng/zlib/jpeglib/vorbisfile/libogg etc. for i386 or do I have to modify all of their makefiles manually and make sure that -mtune is set to i386? Thanks for help! Andy

    Read the article

  • GCC: visibility of symbols in standalone C++ applications

    - by Albert
    Hi, Because of a strange C++ warning about the visibility of some symbols and an interesting answer, linking to a paper which describes the different visibility types and cases (section 2.2.4 is about C++ classes), I started to wonder if it is needed for a standalone application to export symbols at all (except main - or is that needed?). Why exactly are they needed to be exported in standalone applications? Is "an exported symbol" an synomym for "visible symbol"? I.e. a hidden symbol is a symbol which is not exported? Do the object files already differ between visible symbols and hidden symbols? Or is this made at the linking step, so that only the visible symbols are exported? Does the visibility of symbols matter in case for debug information? Or is that completely independent, i.e. I would also get a nice backtrace if I have all symbols hidden? How is STABS/DWARF related to the visibility of symbols?

    Read the article

  • Calling assembly in GCC????

    - by rbr200
    include static inline uint xchg(volatile unsigned int *addr, unsigned int newval) { uint result; asm volatile("lock; xchgl %0, %1" : "+m" (*addr), "=a" (result) : "1" (newval) : "cc"); return result; } Can some one tell me what this code does exactly. I mean I have an idea or the parts of this command. "1" newval is the input, "=a" is to flush out its previous value and update it. "m" is for the memory operation but I am confused about the functionality of this function. What does the "+m" sign do? Does this function do sumthing like m=a; m = newval; return a

    Read the article

  • template warnings and error help, (gcc)

    - by sil3nt
    Hi there, I'm working on an container class template (for int,bool,strings etc), and I've been stuck with this error cont.h:56: error: expected initializer before '&' token for this section template <typename T> const Container & Container<T>::operator=(const Container<T> & rightCont){ what exactly have I done wrong there?. Also not sure what this warning message means. cont.h:13: warning: friend declaration `bool operator==(const Container<T>&, const Container<T>&)' declares a non-template function cont.h:13: warning: (if this is not what you intended, make sure the function template has already been declared and add <> after the function name here) -Wno-non-template-friend disables this warning at this position template <typename T> class Container{ friend bool operator==(const Container<T> &rhs,const Container<T> &lhs); public:

    Read the article

  • GCC Preprocessor for inline method name

    - by Maz
    Hi I'm working on a project where I have code like the following: #define NAME() Array inline NAME()* NAME()_init (void* arg0){return (NAME()*)Object_init(arg0);} But I get the following result: inline Array* Array _init (void* arg0){return (Array*)Object_init(arg0);} With a space between the "Array" and the "_init" Because this is a function name, I obviously do not want the space. Does anyone know how to get the space out? Thanks.

    Read the article

  • gcc compilations (sometimes) result in cpu underload

    - by confusedCoder
    I have a larger C++ program which starts out by reading thousands of small text files into memory and storing data in stl containers. This takes about a minute. Periodically, a compilation will exhibit behavior where that initial part of the program will run at about 22-23% CPU load. Once that step is over, it goes back to ~100% CPU. It is more likely to happen with O2 flag turned on but not consistently. It happens even less often with the -p flag which makes it almost impossible to profile. I did capture it once but the gprof output wasn't helpful - everything runs with the same relative speed just at low cpu usage. I am quite certain that this has nothing to do with multiple cores. I do have a quad-core cpu, and most of the code is multi-threaded, but I tested this issue running a single thread. Also, when I run the problematic step in multiple threads, each thread only runs at ~20% CPU. I apologize ahead of time for the vagueness of the question but I have run out of ideas as to how to troubleshoot it further, so any hints might be helpful. UPDATE: Just to make sure it's clear, the problematic part of the code does sometimes (~30-40% of the compilations) run at 100% CPU, so it's hard to buy the (otherwise reasonable) argument that I/O is the bottleneck

    Read the article

  • I have a following gcc compilation warning

    - by thetna
    symbol.h:179: note: expected ‘uintptr_t *’ but argument is of type ‘PRECEDENCE’ The corresponding code is : 176 void symbol_SetCount(SYMBOL, unsigned long); 177 unsigned long symbol_GetCount(SYMBOL); 178 179 size_t symbol_Ordering(uintptr_t*, SYMBOL); 180 181 void symbol_CheckIndexInRange(int); 182 void symbol_CheckNoVariable(SYMBOL); SYMBOL is defined as: typedef size_t SYMBOL Any effort will be highly appreciated.

    Read the article

  • Constant embedded for loop condition optimization in C++ with gcc

    - by solinent
    Will a compiler optimize tihs: bool someCondition = someVeryTimeConsumingTask(/* ... */); for (int i=0; i<HUGE_INNER_LOOP; ++i) { if (someCondition) doCondition(i); else bacon(i); } into: bool someCondition = someVeryTimeConsumingTask(/* ... */); if (someCondition) for (int i=0; i<HUGE_INNER_LOOP; ++i) doCondition(i); else for (int i=0; i<HUGE_INNER_LOOP; ++i) bacon(i); someCondition is trivially constant within the for loop. This may seem obvious and that I should do this myself, but if you have more than one condition then you are dealing with permuatations of for loops, so the code would get quite a bit longer. I am deciding on whether to do it (I am already optimizing) or whether it will be a waste of my time.

    Read the article

  • GCC compiler -- bug or unspecified behavior?

    - by Jared P
    When I have conflicting definitions of the ivars of a class in objective-c (not redeclaring the class in the same file, but rather naming the same class with diff ivars, no warnings or better yet errors are issued by the compiler. However, both sets of ivars are useable by the appropriate methods in the respective files. For instance Foo.m: @interface foo { int a; } - (int)method; @end @implementation foo - (int)method { return a; } @end Bar.m: @interface foo { float baz; } @end @implementation foo (category) - (float)blah { return baz; } @end compiles without warnings or errors. Is this intentional? Is this an unchecked error? (for the record, a and baz are actually the same memory location.)

    Read the article

  • aligning extern constants (gcc)

    - by ~buratinas
    I want to make some static constants globally visible. I'm pretty familiar how to do that in C++. The problem is that these constants need to be aligned to some exotic boundary. Do I have to specify the alignment in extern declaration? I'm using GCC4.5 in *.cpp file static const constant_t constant __attribute__((aligned(64))) = {blah,blah,blah}; in *.h file //Which one is correct? extern const constant_t constant; extern const constant_t constant __attribute__((aligned(64)));

    Read the article

  • GCC 4.5.0 released

    <b>GNU.org:</b> "The GNU project and the GCC developers are pleased to announce the release of GCC 4.5.0. This release is a major release, containing new features (as well as many other improvements) relative to GCC 4.4.x."

    Read the article

  • Should I install GCC 64 bit on a new server?

    - by diederikvanliere
    I am going to rebuild my server and I am wondering whether I should install GCC 32 or 64 bit. I develop in Python and I use some libraries that would benefit from a 64 bit GCC installation but I am not sure if I am going to run into problems with other programs / libraries. What are your thoughts?

    Read the article

  • Install VMWare Tools from VMWare Workstation 7.1.1 build-282343 on Debian squeeze: complaint about gcc path not valid

    - by Misha Koshelev
    Dear All: I am trying to install VMWare tools on Debian Squeeze. My error: Before you can compile modules, you need to have the following installed... make gcc kernel headers of the running kernel Searching for GCC... The path "/usr/bin/gcc" is not valid path to the gcc binary. Would you like to change it? [yes] uname -a: Linux debian 2.6.32-5-686 #1 SMP Sat Sep 18 02:14:45 UTC 2010 i686 GNU/Linux dpkg -l | grep make ii make 3.81-8 An utility for Directing compilation. dpkg -l | grep gcc ii gcc 4:4.4.4-2 The GNU C compiler ii gcc-4.4 4.4.4-8 The GNU C compiler ii gcc-4.4-base 4.4.4-8 The GNU Compiler Collection (base package) ii libgcc1 1:4.4.4-8 GCC support library whereis gcc gcc: /usr/bin/gcc /usr/lib/gcc Thank you Misha

    Read the article

  • LLVM: Passing a pointer to a struct, which holds a pointer to a function, to a JIT function

    - by Rusky
    I have an LLVM (version 2.7) module with a function that takes a pointer to a struct. That struct contains a function pointer to a C++ function. The module function is going to be JIT-compiled, and I need to build that struct in C++ using the LLVM API. I can't seem get the pointer to the function as an LLVM value, let alone pass a pointer to the ConstantStruct that I can't build. I'm not sure if I'm even on the track, but this is what I have so far: void print(char*); vector<Constant*> functions; functions.push_back(ConstantExpr::getIntToPtr( ConstantInt::get(Type::getInt32Ty(context), (int)print), /* function pointer type here, FunctionType::get(...) doesn't seem to work */ )); ConstantStruct* struct = cast<ConstantStruct>(ConstantStruct::get( cast<StructType>(m->getTypeByName("printer")), functions )); Function* main = m->getFunction("main"); vector<GenericValue> args; args[0].PointerVal = /* not sure what goes here */ ee->runFunction(main, args);

    Read the article

  • Why gcc4 warn and how to avoid it

    - by vitaly.v.ch
    I have a function declared as: void event_add_card (EventAddr addr, EventType type, unsigned char card); and union typedef union EventData { float money; /**< money info */ unsigned char card; /**< new card */ } EventData; When i compile following code: EventData data = {}; event_add_card (0,0, data.card); with enabled warning -Wconversion I receive following warning: player-stud.c|71| warning: passing argument 3 of 'event_add_card' with different width due to prototype Why gcc4 unsuccessful and how to fix It???

    Read the article

  • Implicit declaration when using a function before it is defined in C, why can't the compiler figure this out?

    - by rolls
    As the title says, I know what causes this error but I want to know why the compiler gives it in this circumstance. Eg : main.c void test(){ test1(); } void test1(){ ... } Would give an implicit declaration warning as the compiler would reach the call to test1() before it has read its declaration, I can see the obvious problems with this (not knowing return type etc), but why can't the compiler do a simple pass to get all function declarations, then compile the code removing these errors? It just seems so simple to do and I don't believe I've seen similar warnings in other languages. Does anyone know if there is a specific purpose for this warning in this situation that I am overlooking?

    Read the article

  • Get the default link configuration gcc uses when calling the linker.

    - by witkamp
    I am using the CodeSorcery arm-eabi-gcc tool chain and I have a problem using ld separate from gcc I can compile my simple program and link it, if I let gcc call the ld. This works not problem g++ test.cpp; # Works This does not work because of missing symbols g++ -c test.cpp ld -o test crti.o crtbegin.o test.o crtend.o crtn.o -lgcc -lc -lstdc++; # Fails Notice I am adding the gcc libraries to the ld command What am I missing? Also if there is a better way to make configuring ld to using the default gcc linking? Thanks

    Read the article

  • how to fix fatal error jvmti.h No such file or directory compilation terminated on c code ubuntu? [on hold]

    - by Blue Rose
    how to fix fatal error jvmti.h No such file or directory compilation terminated c code ubuntu? my c code is: #include "jvmti.h" JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *jvm, char *options, void *reserved) { /* We return JNI_OK to signify success */ printf("\nBushra Za'areer,\n\n"); return JNI_OK; } JNIEXPORT void JNICALL Agent_OnUnload(JavaVM *vm) { } type this command in terminal: gcc -Wall -W -Werror first_agent.c -o firstagent first_agent.c:1:19: fatal error: jvmti.h: No such file or directory compilation terminated. where java jdk version javac 1.7.0_25 where gcc version gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-2ubuntu4) here should update gcc version to 4.8?

    Read the article

  • Is there any simple C++ code to grab video from UVC webcam and display it simultaneously?

    - by mShero
    I'm very very new to Linux and programming! I'm using ubuntu 11.10 - 64 bits with gcc 4.6.1 I've been searching online for an example C++ code that simply grabs video from a compliant UVC webcam and displays it simultaneously.. I need to compile it on gcc. In OpenCV, it's a very simple code less than 20 lines as I remember! I found this: http://v4l2spec.bytesex.org/spec/capture-example.html But it's very huge code relative to OpenCV code ?! and even when I tried to compile it using gcc.. I got many errors! I copied the code into a cpp file: cap.cpp then wrote in the terminal: gcc cap.cpp -o cap and the errors showed up... same errors with g++ I hope if someone can help me and tell me where can I find another simpler code? and how can I test it ? Thank you :)

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >