Linking with gcc


 
Thread Tools Search this Thread
Top Forums Programming Linking with gcc
# 1  
Old 02-11-2005
Linking with gcc

Forgive as I am new to the gcc compiler and to linux. I am trying to compile/link a program for the first time and am receiving an error complaining about the crtbegin.o file. I use the -v option and get the following:
Using built-in specs.
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/inf
o --mandir=/usr/share/man --libdir=/usr/lib --enable-languages=c,c++,f77,objc,java,ada --enable-libgcj --with-gxx-include-
dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit i486-suse-linux
Thread model: posix
gcc version 3.2.2
ld --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o BCPProductSummary.x /usr/lib/gcc-lib/../crt1.o /usr/l
ib/gcc-lib/../crti.o crtbegin.o -L/home/jab910/Work/AIX/Source/Common -L/home/jab910/Work/AIX/Source/Messaging -L/pcs/bin
-L/usr/lib/gcc-lib/.. -ldb2 -lmqm -lCommon BCPProductSummarySetup.o BCPProductSummaryProcess.o -lgcc -lgcc_eh -lc -lgcc -l
gcc_eh crtend.o /usr/lib/gcc-lib/../crtn.o
ld: cannot open crtbegin.o: No such file or directory
done
jab910@ossdb2:~/Work/AIX/Source/BCPProductSummary> locate crtbegin.o

/usr/lib/gcc-lib/i486-suse-linux/3.2.2/crtbegin.o
The /usr/lib/gcc-lib/../crti.o crtbegin.o are listed in the ld but can it can not find it. Why is that???
# 2  
Old 02-14-2005
This probably relates to how gcc was installed. The compiler expects certain files to be in specified directories - crt0.o crtbegin.o are called startup files. C requires certain things to happen before the main() function is called.

I don't know where suse gcc expects the startup object modules to be. Someone else here may know.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Linking Automation

Hi, How to link the files automatically in linux on daily basis ? For example : I have file abc.20130911.txt ln -s source/ abc.20130911.txt dest/abc.20130911.txt But in my machine files will be generate with date time stamp every day, without manual linking every day is there any... (4 Replies)
Discussion started by: Balasankar
4 Replies

2. Programming

Linking .so into C program

I have a C binary file(.so as extension) which is delivered by a product. How do i use this functionalities of this .so file in my C program? How can in link the .so to my C program? (1 Reply)
Discussion started by: vkca
1 Replies

3. Programming

Database Linking

Hey, i cant seem to find #include<sqlite3> in the libraries, even after installing sqlite3 in linux. how do i solve this problem (1 Reply)
Discussion started by: gregarion
1 Replies

4. UNIX for Dummies Questions & Answers

is linking possible?

how would i link 2 files together? is it the same as copying? (1 Reply)
Discussion started by: trob
1 Replies

5. Solaris

Installing gcc - recieve error message gcc : cannot execute

AIM- Install Oracle 11g on Solaris using VMWare Steps 1.Logged on as root 2.Created subfolders à /usr/local/bin & /usr/local/bin/gcc 3.Downloaded gcc & libiconv & unzipped them on my harddrive & burnt them on CD 4.Copied files from CD to /usr/local/bin/gcc 5.Terminal (root) à pkgadd -d... (8 Replies)
Discussion started by: Ackers
8 Replies

6. Solaris

linking in solaris9

at the end of the compilation in solaris 9. it is showing link error. like..... ld: fatal: library -lgthread-2.0 not found failed to create the binary the library is in /usr/lib and in /usr/local/lib the lib file is present --->libgthread.2.0.so ......etc if i remove... (3 Replies)
Discussion started by: biswajithit
3 Replies

7. Programming

beginner at C: Need help compiling/linking with gcc

I'm trying to do something fairly simple but keep getting frustrating messages.. Here it is: I have 3 files: init.h <header> init.c <#include <curses.h> and "init.h"> main.c <#include "init.h"> now, how can I compile my main.c using gcc? ( I have a hard time making the init.o) ... (1 Reply)
Discussion started by: My_Name
1 Replies

8. Programming

dynamic linking in gcc

Hai Friends how to use dynamic library linking in gcc. I have create the library files and placed it in /lib directory and my program should refer to that library dynamically.. How do i do that.. Thanks in advance (0 Replies)
Discussion started by: collins
0 Replies

9. Programming

Linking problem while linking to shared library

Hi I'm getting ld: fatal: option -h and building a dynamic executable are incompatible ld: fatal: Flags processing errors When I run ld -shared -L/usr/dt/lib -lDtSvc -o builtin.so Workspace.o after running gcc -fPIC -I/usr/X11R6/include -I/usr/dt/include -c Workspace.c I'm... (6 Replies)
Discussion started by: laho
6 Replies

10. UNIX Desktop Questions & Answers

Linking Directories...

Hi there, I am very new to UNIX. Currently, I am running Mac OS X. I set up a FTP server on my computer so that I can transfer files back and forth between my computer at home and at work. All my data and files are located in a directory in another drive, but when I log in, I would be in my... (3 Replies)
Discussion started by: floppiless
3 Replies
Login or Register to Ask a Question