beginner at C: Need help compiling/linking with gcc


 
Thread Tools Search this Thread
Top Forums Programming beginner at C: Need help compiling/linking with gcc
# 1  
Old 03-05-2005
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)

thanks
# 2  
Old 03-06-2005
Please make sure that you have read our rules. And note:
(5) Search the forums database with your keywords before asking.

Please learn how to find and examine our FAQ section. From our home page go to Answers to Frequently Asked Questions.
In the FAQ section is an article Unix Tutorials/Programming Tutorials/Shell Scripting Tutorials with a link to a tutorial that will answer your question.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Compiling GCC 6.3.0 - Error with Library

First of all -- thanks for being patient with me. I hope I'm submitting this correctly. Also I haven't done UNIX Admin since the early 1990's. I'm actually a DBA. But, since I'm the one in the office with the UNIX experience, I'm the SA. I haven't been able to compile GCC 6.3.0 which I need... (9 Replies)
Discussion started by: PJ_Namias
9 Replies

2. SuSE

Problem compiling the kernel and linking problems in OpenSuse 12.3

Hi everyone I installed OpenSuse 12.3 and many development tools but when i propose build the kernel from the source (the first step make menuconfig) i saw this: HOSTLD scripts/kconfig/mconf /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: warning: libdl.so.2,... (2 Replies)
Discussion started by: bacesado
2 Replies

3. Programming

Compiling and linking Shared Libraries.

I have one C program which contains a function call. I have been given some .so and .h files. I want to know how to compile and link the c program with .so files. I tried following: $ gcc My_program.c libCommon.so My_program.c: In function āmainā: My_program.c:11: warning: parameter names... (3 Replies)
Discussion started by: junaid.nehvi
3 Replies

4. Programming

gcc compiling error

I am using gcc to compile c objects on solaris 5.10 and hit the following error messages: /usr/include/sys/vfs.h:323: error: syntax error before "statvfs64_t" /usr/include/sys/vfs.h:334: error: syntax error before "statvfs64_t" gmake: *** Error 1 The c program files were copied over from... (3 Replies)
Discussion started by: med7006
3 Replies

5. Programming

probs compiling with gcc + lpthread

Im trying to write a program atm which uses mutexes to control thread access to a certain code section ( the critical section). However, whenever I compile the code using gcc I get the following message from gcc Unresolved text symbol "pthread_mutex_lock" Unresolved text symbol... (1 Reply)
Discussion started by: JamesGoh
1 Replies

6. Programming

gcc compiling with -DUSE_LONGLONG

Sorry for a silly question. I a program that need to compile with -DUSE_LONGLONG to turn on the long Int as the document of that program said so, but I really don't know how to do this. I normally do this: ./configure make make install and it works fine. But I don't know how to compile... (2 Replies)
Discussion started by: hiepng
2 Replies

7. UNIX for Dummies Questions & Answers

errors compiling gcc 4.2.1

Hello, I have never had a successful compile on the 2.6 kernel. On every arch in which I try to compile gcc I get either "i686-pc-cygwin-ar command not found or "i686-suse-linux-ar command not found. This always happens during the make process after configure checks for ar and finds it's just ar.... (2 Replies)
Discussion started by: kwa71
2 Replies

8. Programming

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... (1 Reply)
Discussion started by: jbeauchamp
1 Replies

9. 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

10. Programming

compiling and linking 2 C files ...??

Hi mates, I am trying to copile and link to C programs with command: cc file1,file2 but i raises the error "file not found" ... am i doing the right way? any suggestion will be appreciated. thanks abdul (4 Replies)
Discussion started by: abdul
4 Replies
Login or Register to Ask a Question