OK, so HostGator for some reason no longer allows gcc/g++ access unless you have a Designated Server account, which is a lot of money to spend just to compile my "Hello World" program. Thus I figured I'd compile at home, then upload. Program is your regular old bare-bones Hello World C program using printf. Compiles and runs fine on Kali Linux at home. When I upload the executable to the CentOS server via Filezilla and chmod and execute the file, I get a seg fault. HostGator server CPU is AMD-Opteron-6378 running CentOS. I'm compiling using gcc on a Lenovo laptop …

Member Avatar
Member Avatar
+0 forum 8

Dear friends: ` The gcc version used in my opensue 42.1 is 4.8, i installed a gcc 6 from the opensuse package download center by "oneclickinstall".` The installation process was sucessful, but the gcc in my system is still 4.8. So how to resolve this problem. Regards

Member Avatar
Member Avatar
+0 forum 1

I hot the following program from the book 'C++ For Dummies' but have two questions about it. First I compiled the program but I'm afraid to run because the memery created from the heap does not appear to me to get de-allocated. Am I correct in not wanting to run this and is my reason valid? Secondly, on the line `Student* pS = new Student;` is it alway a rule that memory created from the heap must be access via a pointer? I know when I removed the `*` I get the following error from g++. `constructor.cpp:30:22: error: conversion from …

Member Avatar
Member Avatar
+0 forum 5

Consider the following code: #include<stdio.h> #define msizeof(type) ((char*)(&type) - (char*)(&type - 1)) int main() { int x; printf("%u %u\n", msizeof(x), sizeof(x)); return 0; } The Above code when compiled with g++ compiles just fine and works well without any wanrings, while in gcc it gives the following warning: `integer overflow in expression`. Though the code works fine on running. This warning goes away when I change the macro to: `#define msizeof(type) ((char*)(&type + 1) - (char*)(&type))`. My Questions: 1. What does the warning `integer overflow in expression` mean? 2. Why am I getting it? 3. Why does changing it to …

Member Avatar
Member Avatar
+0 forum 6

Hi)I've been using Codeblocks for a long time;since I configured the Toolchain executables shortly after installing I had no problems with compiler;but now when I try to compile a program, codeblocks responds with a statements about wrong compiler path;when I try to run a program it responds with "Target uses an invalid compiler; run aborted";I've checked compilers and their pathes and - everything is correct..can anyone tell me how to fix this?

Member Avatar
+0 forum 0

Hello How can we know which GCC version is compatiable with a given Python version ? Regards

Member Avatar
-1 forum 0

I am using the gcc compiler and I am new to using flags. Can any one tell me a source for it. e.g. I wanted to use *-funroll-loops* but I dont know the proper syntax. Can any one help.

Member Avatar
Member Avatar
+0 forum 4

A complete C implementation of Linked List...tested on Linux GCC

Member Avatar
Member Avatar
+0 forum 5

This is more of a tale of "I think I broke it". Basically as an assignment for CS I have to write an assembler for a subset of the MIPS assembly language. Currently it is not working, getting a sigseg, so I decided to debug the code and step through it line by line. Every time I reach line 65 I get these messages from Code::Blocks: At D:\C++\MIPSAssemblerCS241\asm.cc:65 Program received signal SIGSEGV, Segmentation fault. On top of that I get little pop-up windows in the corners warning me about the very same segmentation fault. As such I naturally inspected line …

Member Avatar
Member Avatar
+0 forum 5

float det(float A[][10],int m) { float B[10][10],d=0; int i,a,b,x,y; if(m==2) return (A[0][0]*A[1][1])-(A[1][0]*A[0][1]); else { x=0;y=0; for(i=0;i<m;i++) { for(a=0;a<m;a++) { if(a==i) continue; else { for(b=1;b<m;b++) { B[x][x]=A[a][b]; x++; } } } if(i%2) d-=det(B,x); else d+=det(B,x); } } return d; } I tried to run the program, but it exits with error code 255. Using Dev CPP with MinGW. Pls Help!

Member Avatar
Member Avatar
+0 forum 1

Hi! I use Linux Mint Maya and I need to install some software from sources but the problem is that GCC is not working. When I type gcc or make command I get a error like this: bash: /usr/bin/gcc: cannot execute binary file How can I fix that?

Member Avatar
Member Avatar
+0 forum 9

Dear all, I am certainly not an expert in C++ development but after some time, I had some code running and compiling for a bio-informatics tool. As always in Science, I changed my area of research of a while and when I came back to my tool, I had changed my computer (and my gcc version) in between. In the program, I run several threads that call a function. This is where the function run_es_pval is called (and where the error message takes place) for (int i = 0; i < threadNb; i++) { int start = i * datasetPerThread; …

Member Avatar
Member Avatar
+0 forum 2

I don't know jack about Visual Studio, and I'd like to keep it that way because I like doing stuff on the command line, I have my preferences. But my teacher uses it to compile and I'm curious what I did wrong because gcc didn't throw anything. So, code (Without header, which just defines constants and function names): #include <allegro.h> #include <stdio.h> #include <stdlib.h> #include "midterm.h" void draw(); BITMAP *sc; SAMPLE *clap, *bounce; int color; void start() { score=0; b.sp = speed; b.rad = radius; p.x = width/2; p.y = height-margin; p.length = paddle_length; num_lives=3; num_blocks = 30; top=0; go=0; …

Member Avatar
Member Avatar
+0 forum 3

Pretty self explanatory code. Why doesn't it work! #include <stdio.h> int main() { __asm__("number dw 0"); // declare number? printf("%d",number); __asm__("mov %eax,number" "inc %eax" "mov number,%eax"); printf("%d",number); return 0; } cc ex1.c -o ex1 ex1.c: In function ‘main’: ex1.c:22:17: error: ‘number’ undeclared (first use in this function) ex1.c:22:17: note: each undeclared identifier is reported only once for each function it appears in make: *** [ex1] Error 1 Thanks. I have a lot of knowledge gaps to fill... the gcc manual was confusing me with regards to inline assembly as was google results for tutorials... working on an intel i7 processor

Member Avatar
Member Avatar
+0 forum 3

Alright, so I need some more help. This time, the problem is not inherently in the code (Though I've had trouble with that thus far too). I am currently playing around with open and close file dialogs trying to get what seems to be an out-dated "GetOpenFileName()" function to work. and this lead me down the path of what is this IFileOpenDialog this and that and other things... EVENTUALLY, I found the suggestion to use the Open Watcom compiler instead of the GCC compiler. I followed the code::blocks instructons to plug the Watcom compiler in and now I am getting …

Member Avatar
Member Avatar
+0 forum 12

*Hello people of the DaniWebs! It's been a long time since I've been talking and asking here, under the name of **katmai539**. I've lost account information and also the email address linked to it. I haven't been active in the software development-branch for the past few years but recently I decided to pick up the old habit of coding some stuff, next to my awesome job as a cashier at the local supermarket monopolist Albert Heijn.* Now to BUSINESS! As you can see I'm still using **SDL** for a thing and another. I managed to compile a dll for sdl_draw …

Member Avatar
+0 forum 0

Background, I want to install allegro on the iMac 10.6.8 after my macbook crapped out. It didn't compilers installed whatsoever, so I had to find Xcode at a seedy 3rd party site because apple no longer supports Xcode for 10.6. It came as a binary, simple install didn't give me any install options so I assume it installed fine. Oh yeah I installed GCC for reasons I don't remember, for the most part it looks like it installed correctly because gcc,g++ and gfortran are all on there. Funny thing is gcc and g++ have binaries in /usr/bin I have no …

Member Avatar
Member Avatar
+0 forum 1

Is there any standard function in gcc that is equivalent to getch() so that I can read the input without hitting enter key?

Member Avatar
Member Avatar
+0 forum 6

Hi, I have a problem with a the imput of some data on a program Im making (FYI new in c++, homework). So basicly the progrma I have is to imput diferent type of data, this is what im doing. (Im using codeblock 8.02 in Ubuntu 10.04 ) #include <iostream> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <cmath> using namespace std; struct person { int cod; char name[40], cid[15]; }client[100]; main() { int opc,exit serch, c=0, i, e; while(exit!=1) { cout<<"1. Imput data"<<endl; cout<<"2. Out data"<<endl; cout<<"3. Exit"<<endl; cout<<"Enter an opcion: " cin>opc; system("clear"); swith(opc) { case 1: cout<<"Enter code: …

Member Avatar
Member Avatar
+0 forum 5

I'm trying to write an echo like thing doing this : [CODE]> echo Muffins Muffinst > echo two muffins two muffins[/CODE] The problem Is that the program isn't being started from command line, The > is my programs input prompt (trying to write a very simple command line) How would I do this? Would it be possible with formatted input (cin>>)? or would I have to use scanf?

Member Avatar
Member Avatar
+0 forum 3

Hi, I'm having a major problem with passing GCC link flags in Xcode. I created a C program that creates and runs a neural network using the FANN library. When I compile this command line I use the command [CODE]gcc main.c -o train_test -l fann[/CODE] to link the fann library into the compiler. I am now attempting to make a GUI for this program in Objective-C. Everything seems fine apart from the fact that I cant seem to work out how to pass the fann library to the LLVM GCC 4.2 compiler, or if this is even possible. If anyone …

Member Avatar
+0 forum 0

I've created a new class called BulletList2(linked list) using the built in dialog(File>New Class) which created a header file called bulletlist.h (in project folder>include) and a source file called bulletlist2.cpp(in project folder > src). header file [CODE=c++]#ifndef BULLETLIST2_H #define BULLETLIST2_H class BulletList2 { [...] } #endif // BULLETLIST2_H [/CODE] In class and main file [CODE=c++]#include "bulletlist2.h"[/CODE] I get this error: fatal error: bulletlist2.h: No such file or directory| ||=== Build finished: 1 errors, 0 warnings ===| I'm using Ubuntu Natty Narwhal 64-bit and Code::Blocks installed from Software Center

Member Avatar
Member Avatar
+0 forum 3

Hi! I have recently started using linux and I was recommended gcc compiler. I have written a basic program just to see if it works. And it doesn't. I am trying to compile it with Terminal, and with the following command :[CODE]gcc ~/Desktop/C++/test.cpp -o testing)[/CODE] My program it responds with: [CODE]/home/john/Desktop/C++/test.cpp:1:1: error: 'include' does not name a type[/CODE] If on the other hand I write [CODE]gcc test.cpp -o testing[/CODE] the result is: [CODE]gcc: test.cpp: No such file or directory gcc: no input files[/CODE] I am wondering what that means and how i could fix it. Here is the code of …

Member Avatar
Member Avatar
+0 forum 4

Hello altogether, I am supposed to work through a project written in C++ and QT for Windows platforms. Now I am not an expert in window-related stuff. I installed MinGW 3.4.5 and QTSDK on Win XP SP3. I am using the tool "qmake" to create a makefile with all dependecies and that works just nice. Then I use "make" to do the compiling and I get massive errors like these: [CODE]C:/Programme/MinGW/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bi ts/istream.tcc:973: error: `__num' was not declared in this scope[/CODE] For me that looks like the installation of MinGW is somehow corrupted. Does anybody know how to fix that? Are …

Member Avatar
Member Avatar
+0 forum 6

Hello! I am making a program which does many computations for a Photovoltaic system. The problem is that i get a strange segmentation fault error when I run the program. Here is where it crushes (at for-loop of calculation S5) : [CODE] commands..... ... ... /******************** WIRING *******************************/ Ni = N_I/(Ns*Np); S1 = 0; for(j=0; j<Np; j++) S1 += (j-1)*Lpv2 + Lpv2/2; S2 = 0; for(j=0; j<Nr; j++) S2 += 2*h_d + W_T + (j-1)*Np*Lpv2; S3 = 0; for(j=0; j<Nc; j++) S3 += h_d + (j-1)*Ns*Lpv1; S4 = 0; for(j=0; j<Nc_nm; j++) S4 += h_d + (j-1)*Ns*Lpv1; S5 = 0; …

Member Avatar
Member Avatar
+0 forum 4

[CODE]myuser@linux:~/Desktop$ gcc -nostdlib -Wl,-dynamic-linker,/home/myuser/Desktop/ld-linux-x86-64.so.2,-rpath,/home/myuser/Desktop libc.so.6 libgcc_s.so.1 simple.c myuser@linux:~/Desktop$ ldd a.out linux-vdso.so.1 => (0x00007fffbf5ff000) libc.so.6 => /home/myuser/Desktop/libc.so.6 (0x00007f308b7ae000) libgcc_s.so.1 => /home/myuser/Desktop/libgcc_s.so.1 (0x00007f308b598000) /home/myuser/Desktop/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x00007f308bb11000) myuser@linux:~/Desktop$ [/CODE] Which ld is being used, the one on the Desktop or the one in /lib64 ? What options do I have to use so it uses the one on my Desktop ?

Member Avatar
+0 forum 0

Hi, I can not create executable code by using a makefile.How can I generate the executable code.I wrote this lines into my makefile and in the terminal I wrote make but I can not do it.Please help me. myprog : myprog.o mylibrary.o gcc myprog.o mylibrary.o -o myprog myprog.o : myprog.c mylibrary.h gcc -c myprog.c mylibrary.h -o myprog.o mylibrary.o : mylibrary.c mylibrary.h gcc -c mylibrary.c -o mylibrary.o I take lost separator error.How can I fix this?

Member Avatar
Member Avatar
+0 forum 4

Hi, I am trying to pass a string to a MACRO using -D option in gcc. I am not getting desired output, below is snippet, please let me know what I am missing. $ gcc -o finame -D CORE="op1_log.txt" finame.c [CODE] #define STR(x) x int main() { FILE *fp; char filename[30]; strcpy(filename,STR(CORE)); fp = fopen(filename,"w"); printf("%s\n",filename); if(fp == NULL) printf("Can not open File\n"); } [/CODE]

Member Avatar
Member Avatar
+0 forum 10

hi could anybody guide me how could i install latest version of GCC on my window 7 computer. thanx!

Member Avatar
Member Avatar
+0 forum 3

Hi, I have prolly very noobish question. I compile my program separately with GCC by: [CODE]gcc -O2 -Wall -c foo.c[/CODE] I just wat to ask if there is a chance to specify the output destination of [B]foo.o[/B] file. Now the output is forwarded to the makefile dir. Thank you for your interest.

Member Avatar
Member Avatar
+0 forum 5

The End.