Search Results

Search found 2237 results on 90 pages for 'msp430 gcc'.

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

  • combine two GCC compiled .o object files into a third .o file

    - by ~lucian.grijincu
    How does one combine two GCC compiled .o object files into a third .o file? $ gcc -c a.c -o a.o $ gcc -c b.c -o b.o $ ??? a.o b.o -o c.o $ gcc c.o other.o -o executable If you have access to the source files the -combine GCC flag will merge the source files before compilation: $ gcc -c -combine a.c b.c -o c.o However this only works for source files, and GCC does not accept .o files as input for this command. Normally, linking .o files does not work properly, as you cannot use the output of the linker as input for it. The result is a shared library and is not linked statically into the resulting executable. $ gcc -shared a.o b.o -o c.o $ gcc c.o other.o -o executable $ ./executable ./executable: error while loading shared libraries: c.o: cannot open shared object file: No such file or directory $ file c.o c.o: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped $ file a.o a.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped

    Read the article

  • Why doesn't GCC produce a warning when assigning a signed literal to an unsigned type?

    - by maerics
    Several questions on this website reveal pitfalls when mixing signed and unsigned types and most compilers seem to do a good job about generating warnings of this type. However, GCC doesn't seem to care when assigning a signed constant to an unsigned type! Consider the following program: /* foo.c */ #include <stdio.h> int main(void) { unsigned int x=20, y=-30; if (x > y) { printf("%d > %d\n", x, y); } else { printf("%d <= %d\n", x, y); } return 0; } Compilation with GCC 4.2.1 as below produces no output on the console: gcc -Werror -Wall -Wextra -pedantic foo.c -o foo The resulting executable generates the following output: $ ./foo 20 <= -30 Is there some reason that GCC doesn't generate any warning or error message when assigning the signed value -30 to the unsigned integer variable y?

    Read the article

  • How do I install gcc 4.8.1 on Ubuntu 13.04?

    - by sud_the_devil
    I have a 64 bit UBUNTU 13.04 running gcc --version shows me gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3 But on May 31 2013 gcc 4.8.1 was released . And I don't know how to install it .. Can someone please explain me the steps that I need to do for successfull installation .. Also please tell me whether I can have both the instances of gcc installed i.e 4.7.3 & 4.8. 1 or not ?? And after installation how can I point to the new gcc 4.8.1 ??

    Read the article

  • gcc compiling error on Solaris 10

    - by osman toker
    I want to compile a source code, but there are some compiling errors about __sync_xxx functions (__sync_bool_compare_and_swap etc.) GCC version on machine is 3.4.3 (it must be gcc 4.1 or over for supporting atomic builtins), so I have downloaded GCC v4.6, copied it to another directory (I didn't remove v3.4.3) then change the $PATH path for GCC but it doesn't work (the same error occurs). I want to ask that is only changing gcc path with export PATH=... enough for compiling with new GCC?

    Read the article

  • how to tune libstdc++ to the native architecture when building gcc

    - by John D
    I recently found that when I build my C++ software, I get about a 10% speedup by using the g++ march=native option. When compiling gcc and libstc++, is it possible to tune the libstdc++ library to the native architecture as well? I couldn't find any mention of this in the gcc install configuration documentation. (I'm building gcc 4.6.2 on Linux Mint 11 with an Intel Core i7 Sandy Bridge-E processor.)

    Read the article

  • IAR Embedded Workbench MSP430 and *.lib files linking

    - by jeniusj
    I was assuming that it was a really simple task but I did not find anything relevant or my mistake. So putting my problem here i.e. I have some project for MSP430 which is actually in code composer studio. I have to run this whole code into IAR embedded workbench now. There are some library files(*.lib) that are also provided with the project and that should have to be linked to build the project. After little modifications code is compiling fine but I am unable to link the libraries and getting linker errors. I worked on IAR with avr but very very little just to test some sample codes. I did not find the option where to mention these library names and their respective paths. I checked out the linker tab but I am not getting any clue to link these .lib files with project.

    Read the article

  • MSP430 CMP operator

    - by Ludicrous
    Let's say I have the MSP430 assembly segment below: r15: 439c Memory map: 4390: 6045 0200 9c43 6400 8844 5044 363a 0000 Code: 448a: cmp #0x363a, 0x0(r15) 4490: jnz $+0x1c 4492: Code continues . . . 44ac: Jump to location The goal is to have the Z flag high. To do this with a cmp, both src and dst must be equal. If I have 363a in the memory location of r15, why is it that the resulting cmp does not trigger the Z flag? Through experimentation, I found that putting 3a36 in the memory location of r15 did in fact trigger the Z flag, but I don't understand why. If anyone could bring this to light, I would greatly appreciate it. If more information is needed, I will gladly provide it.

    Read the article

  • not able to use g++ from Fedora

    - by eSKay
    $ yum list | grep gcc arm-gp2x-linux-gcc.i686 4.1.2-11.fc12 @fedora arm-gp2x-linux-gcc-c++.i686 4.1.2-11.fc12 @fedora gcc.i686 4.4.3-4.fc12 @updates libgcc.i686 4.4.3-4.fc12 @updates avr-gcc.i686 4.4.2-2.fc12 updates avr-gcc-c++.i686 4.4.2-2.fc12 updates compat-gcc-34.i686 3.4.6-18 fedora compat-gcc-34-c++.i686 3.4.6-18 fedora compat-gcc-34-g77.i686 3.4.6-18 fedora compat-libgcc-296.i686 2.96-143 fedora gcc-c++.i686 4.4.3-4.fc12 updates gcc-gfortran.i686 4.4.3-4.fc12 updates gcc-gnat.i686 4.4.3-4.fc12 updates gcc-java.i686 4.4.3-4.fc12 updates gcc-objc.i686 4.4.3-4.fc12 updates gcc-objc++.i686 4.4.3-4.fc12 updates mingw32-gcc.i686 4.4.1-3.fc12 fedora mingw32-gcc-c++.i686 4.4.1-3.fc12 fedora mingw32-gcc-gfortran.i686 4.4.1-3.fc12 fedora mingw32-gcc-objc.i686 4.4.1-3.fc12 fedora mingw32-gcc-objc++.i686 4.4.1-3.fc12 fedora msp430-gcc.i686 3.2.3-3.20090210cvs.fc12 $ gcc works fine on .c files but fails on .cpp files saying: $ gcc: error trying to exec 'cc1plus': execvp: No such file or directory g++ fails saying: $ g++: Command not found. What should I do to be able to compile C++ files?

    Read the article

  • Timer a usage in msp430 in high compiler optimization mode

    - by Vishal
    Hi, I have used timer A in MSP430 with high compiler optimization, but found that my timer code is failing when high compiler optimization used. When none optimization is used code works fine. This code is used to achieve 1 ms timer tick. timeOutCNT is increamented in interrupt. Following is the code, //Disable interrupt and clear CCR0 TIMER_A_TACTL = TIMER_A_TASSEL | // set the clock source as SMCLK TIMER_A_ID | // set the divider to 8 TACLR | // clear the timer MC_1; // continuous mode TIMER_A_TACTL &= ~TIMER_A_TAIE; // timer interrupt disabled TIMER_A_TACTL &= 0; // timer interrupt flag disabled CCTL0 = CCIE; // CCR0 interrupt enabled CCR0 = 500; TIMER_A_TACTL &= TIMER_A_TAIE; //enable timer interrupt TIMER_A_TACTL &= TIMER_A_TAIFG; //enable timer interrupt TACTL = TIMER_A_TASSEL + MC_1 + ID_3; // SMCLK, upmode timeOutCNT = 0; //timeOutCNT is increased in timer interrupt while(timeOutCNT <= 1); //delay of 1 milisecond TIMER_A_TACTL = TIMER_A_TASSEL | // set the clock source as SMCLK TIMER_A_ID | // set the divider to 8 TACLR | // clear the timer MC_1; // continuous mode TIMER_A_TACTL &= ~TIMER_A_TAIE; // timer interrupt disabled TIMER_A_TACTL &= 0x00; // timer interrupt flag disabled Can anybody help me here to resolve this issue? Is there any other way we can use timer A so it works fine in optimization modes? Or do I have used is wrongly to achieve 1 ms interrupt? Thanks in advanced. Vishal N

    Read the article

  • Does using GCC specific builtins qualify as incorporation within a project?

    - by DavidJFelix
    I understand that linking to a program licensed under the GPL requires that you release the source of your program under the GPL as well, while the LGPL does not require this. The terminology of the (L)GPL is very clear about this. #include "gpl_program.h" means you'd have to license GPL, because you're linking to GPL licensed code. And #include "lgpl_program.h" means you're free to license however you want, so that it doesn't explicitly prohibit linking to LGPL source. Now, my question about what isn't clear is: [begin question] GCC is GPL licensed, compiling with GCC, does not constitute "integration" into your program, as the GPL puts it; does using builtin functions (which are specific to GCC) constitute "incorporation" even though you haven't explicitly linked to this GPL licensed code? My intuition tells me that this isn't the intention, but legality isn't always intuitive. I'm not actually worried, but I'm curious if this could be considered the case. [end question] [begin aside] The reason for my equivocation is that GCC builtins like __builtin_clzl() or __builtin_expect() are an API technically and could be implemented in another way. For example, many builtins were replicated by LLVM and the argument could be made that it's not implementation specific to GCC. However, many builtins have no parallel and when compiled will link GPL licensed code in GCC and will not compile on other compilers. If you make the argument here that the API could be replicated by another compiler, couldn't you make that identical claim about any program you link to, so long as you don't distribute that source? I understand that I'm being a legal snake about this, but it strikes me as odd that the GPL isn't more specific. I don't see this as a reasonable ploy for proprietary software creators to bypass the GPL, as they'd have to bundle the GPL software to make it work, removing their plausible deniability. However, isn't it possible that if builtins don't constitute linking, then open source proponents who oppose the GPL could simply write a BSD/MIT/Apache/Apple licensed product that links to a GPL'd program and claim that they intend to write a non-GPL interface that is identical to the GPL one, preserving their BSD license until it's actually compiled? [end aside] Sorry for the aside, I didn't think many people would follow why I care about this if I'm not facing any legal trouble or implications. Don't worry too much about the hypotheticals there, I'm just extrapolating what either answer to my actual question could imply.

    Read the article

  • Does Ubuntu ever push new versions of GCC into the package repository between releases?

    - by Lex Fridman
    Current version of GCC in Ubuntu 11.04 is 4.5.2. For certain C++0x features, I need GCC version 4.6, but would like to avoid compiling from source. Is there hope that Ubuntu will update GCC in the package repository before the next release in October (11.10). This question asks a similar thing except for an earlier version of Ubuntu and GCC. A second part of the question, if the answer is "no" to the first, then can I hope to see it appear in Ubuntu's unstable repository?

    Read the article

  • how to downgrage gcc to version 4.1.1 if I use 64-bit Ubuntu 11.10 or 12.04?

    - by SSolid
    how to downgrade gcc to version 4.1.1 if i am using 64-bit ubuntu 11.10 or 12.04? please notice that I'm using 64-bit version of ubuntu It may seems simlar to this question Old version of gcc for new Ubuntu but I can't solve it with the method provide in that thread I get some error like gcc-4.1 : Depends: cpp-4.1 (= 4.1.2-27ubuntu1) but it is not going to be installed can someone tell me how to do it? thanks

    Read the article

  • gcc built by crosstool-ng gives undefined reference

    - by netvope
    I've successfully built a toolchain using crosstool-ng with the default configuration named x86_64-unknown-linux-gnu. The documentation says: Using the toolchain is as simple as adding the toolchain's bin directory in your PATH, such as: export PATH="${PATH}:/your/toolchain/path/bin" and then using the target tuple to tell the build systems to use your toolchain: ./configure --target=your-target-tuple or make CC=your-target-tuple-gcc or make CROSS_COMPILE=your-target-tuple- and so on... I followed the instructions and attempted to build GNU tar (tar-1.25.tar.bz2) with the toolchain. The commands ./configure --target=x86_64-unknown-linux-gnu and make CROSS_COMPILE=x86_64-unknown-linux-gnu- do not work (the build will succeed, but it uses the host system's gcc). The command make CC=x86_64-unknown-linux-gnu-gcc works, but in the very last step when it tries to link, it returns errors like this: compare.o: In function `openat': /dev/shm/x-tools/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sys-root/usr/include/bits/fcntl2.h:134: undefined reference to `__openat_2' What could be the problem? Was the toolchain not properly setup? Perhaps x86_64-unknown-linux-gnu-gcc is using the header files from the host system but could not find the libraries in the target's sys-root?

    Read the article

  • More GCC link time issues: undefined reference to main

    - by vikramtheone
    Hi Guys, I'm writing software for a Cortex-A8 processor and I have to write some ARM assembly code to access specific registers. I'm making use of the gnu compilers and related tool chains, these tools are installed on the processor board(Freescale i.MX515) with Ubuntu. I make a connection to it from my host PC(Windows) using WinSCP and the PuTTY terminal. As usual I started with a simple C project having main.c and functions.s. I compile the main.c using GCC, assemble the functions.s using as and link the generated object files using once again GCC, but I get strange errors during this process. An important finding - Meanwhile, I found out that my assembly code may have some issues because when I individually assemble it using the command as -o functions.o functions.s and try running the generated functions.o using ./functions.o command, the bash shell is failing to recognize this file as an executable(on pressing tab functions.o is not getting selected/PuTTY is not highlighting the file). Can anyone suggest whats happening here? Are there any specific options I have to send, to GCC during the linking process? The errors I see are strange and beyond my understanding, I don't understand to what the GCC is referring. I'm pasting here the contents of main.c, functions.s, the Makefile and the list of errors. Help, please!!! Vikram main.c #include <stdio.h> #include <stdlib.h> int main(void) { puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */ return EXIT_SUCCESS; } functions.s * Main program */ .equ STACK_TOP, 0x20000800 .text .global _start .syntax unified _start: .word STACK_TOP, start .type start, function start: movs r0, #10 movs r1, #0 .end Makefile all: hello hello: main.o functions.o gcc -o main.o functions.o main.o: main.c gcc -c -mcpu=cortex-a8 main.c functions.o: functions.s as -mcpu=cortex-a8 -o functions.o functions.s Errors ubuntu@ubuntu-desktop:~/Documents/Project/Others/helloworld$ make gcc -c -mcpu=cortex-a8 main.c as -mcpu=cortex-a8 -o functions.o functions.s gcc -o main.o functions.o functions.o: In function `_start': (.text+0x0): multiple definition of `_start' /usr/lib/gcc/arm-linux-gnueabi/4.3.3/../../../crt1.o:init.c:(.text+0x0): first defined here /usr/lib/gcc/arm-linux-gnueabi/4.3.3/../../../crt1.o: In function `_start': init.c:(.text+0x30): undefined reference to `main' collect2: ld returned 1 exit status make: *** [hello] Error 1

    Read the article

  • compile software with older version of gcc and linux kernel

    - by ant2009
    Distributor ID: SUSE LINUX Description: openSUSE 11.4 (x86_64) Release: 11.4 Codename: Celadon gcc (SUSE Linux) 4.5.1 Linux linux-14ay 2.6.37.6-0.20-desktop #1 SMP PREEMPT 2011-12-19 23:39:38 +0100 x86_64 x86_64 x86_64 GNU/Linux Hello, I am trying to install software on the above system. However, the software that I need requires an earlier version of gcc (version 4.1) my current install version is 4.5.1. It is possible to install an 4.1 on my current system? Where would I get the gcc version from? Also, I get this message about the Linux kernel The current kernel version (2.6.37.6-0.20-desktop) is later than the version currently supported by this software (2.6.5) Is it possible to install this earlier kernel. Where would I get that from? Many thanks for any suggestions,

    Read the article

  • gcc sandboxing tool - AppArmor / CHROOT jail on Ubuntu 12.04

    - by StuR
    We have a Node application as the front end to a C++ sandboxing tool, which compiles code using gcc and outputs the result to the browser. e.g. exec("gcc -o /tmp/test /tmp/test.cpp", function (error, stdout, stderr) { if(!stderr) { execFile('/tmp/test', function(error, stdout, stderr) {}); } }); This works fine. However, as you can imagine this is a security nightmare if it were to be made public - so I was thinking of two options to protect my stack: 1) A CHROOT jail - but this in itself wouldn't be enough to prevent directory traversal / file access. 2) AppArmor ? So my question is really, how could I protect my stack from any nasties that could come from: A) Compiling unknown code using gcc B) Executing the compiled code

    Read the article

  • How to compile gcc-4.0 on Mountain Lion

    - by Frizlab
    So far I've successfully launched the configure, but when I type make, I get the following error, after some time (there's a lot which compile successfully): ld: unknown/unsupported architecture name for: -arch i686 /usr/bin/libtool: internal link edit command failed make[2]: *** [libgcc_s.dylib] Error 1 make[1]: *** [libgcc.a] Error 2 make: *** [all-gcc] Error 2 Is there a way to tell gcc not to compile itself for the i686 architecture? Here's my uname -a if it can help: Darwin Frizlabs-Computer.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64 PS: I know gcc-4.0 is ancient, but I do need it.

    Read the article

  • Installing gcc on AIX 5.3

    - by A.Rashad
    we have a development AIX 5.3 on PowerPC CPU having the standard CC compiler. I downloaded the gcc 4.2.4, unpacked it and tried to install it seems there is something missing; untar takes around 15 minutes and ends with an error trying to create a directory starting with @ sign. and in the gcc folder itself, I can't find a configure or a Makefile to install any hint on how to do so?

    Read the article

  • TI MSP430 Interrupt source

    - by TheDelChop
    Guys, I know that when working with the MSP430F2619 and TI's CCSv4, I can get more than one interrupt to use the same interrupt handler with code that looks something like this: #pragma vector=TIMERA1_VECTOR #pragma vector=TIMERA0_VECTOR __interrupt void Timer_A (void){ ServiceWatchdogTimer(); } My question is, when I find myself in that interrupt, is there a way to figure out which one of these interrupts got me here? Thank you, Joe

    Read the article

  • How can I get gcc to write a file larger than 2.0 GB?

    - by fred.bear
    I wanted to recompile 'xxd' (written in C), so I installed CodeBlocks as the IDE. All seemed to go well unil I discovered that I couldn't write past the 2.0 GB barrier... I've read that 'gcc' needs to be recompiled... (That sounds a bit dramatic..) I've read that I can use 'fread64()' instead of 'fread()' ... (didn't work) I've read something about a compiler options (?)... but I get lost at that point? I am surprised that it didn't work out-of-the-box, as I thought the 2.0 GB limit was ancient history as far as defaults go ... wrong again?:( My OS is 32-bit, on 32-bit hardware. The gcc version report in as: gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3 Is there a simple way around this issue? PS.. I was fascinated by the WARNINGS: section of 'info xxd' (..only on Linux ;)

    Read the article

  • gcc: Do I need -D_REENTRANT with pthreads?

    - by stefanB
    On Linux (kernel 2.6.5) our build system calls gcc with -D_REENTRANT. Is this still required when using pthreads? How is it related to gcc -pthread option? I understand that I should use -pthread with pthreads, do I still need -D_REENTRANT? On a side note, is there any difference that you know off between the usage of REENTRANT between gcc 3.3.3 and gcc 4.x.x ? When I use -pthread gcc option I can see that _REENTRANT gets defined. Will omitting -D_REENTRANT from command line make any difference, for example could some objects be compiled without multithreaded support and then linked into binary that uses pthreads and will cause problems? I assume it should be ok just to use: g++ -pthread > echo | g++ -E -dM -c - > singlethreaded > echo | g++ -pthread -E -dM -c - > multithreaded > diff singlethreaded multithreaded 39a40 > #define _REENTRANT 1 We're compiling multiple static libraries and applications that link with the static libraries, both libraries and application use pthreads. I believe it was required at some stage in the past but want to know if it is still required. Googling hasn't returned any recent information mentioning -D_REENTRANT with pthreads. Could you point me to links or references discussing the use in recent version of kernel/gcc/pthread? Clarification: At the moment we're using -D_REENTRANT and -lpthread, I assume I can replace them with just g++ -pthread, looking at man gcc it sets the flags for both preprocessor and linker. Any thoughts?

    Read the article

  • Where does gcc keep its built-in include directory paths

    - by Charles
    GCC has built in include directories for certain standard headers. I just need to know where this list is. My newly compiled gcc will not compile my little test C++ program because it cannot find standard headers. I think it fails because of some config options I used to make my file system more organized. I set the bindir and libdir, which I think might have screwed up the built-in include paths for some reason. Program (dummy.c): #include <iostream> void main(){} Command: g++ dummy.c Error: dummy.c:1:20: fatal error: iostream: No such file or directory

    Read the article

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