GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- undefined reference to `main'
Operating System - HP-UX
1848417
Members
2980
Online
104027
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2003 11:25 AM
07-31-2003 11:25 AM
undefined reference to `main'
i'm getting the following error attempting to create some shared libraries:
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
here's my makefile:
# This make file creates a library to be used with different programs
@SRCS = daemonStart.c getDateTime.c set_user_id.c
OBJS = daemonStart.o getDateTime.o set_user_id.o
CCFLAGS = -c -g -z +z
CC = gcc
LIBS = libckfr.a libckfr.so
all: libckfr.a libckfr.so
libckfr.a: $(OBJS)
@@echo "Loading $@ ..."
@@rm -f $@
ar cru $@ *.o
@@echo "Done"
libckfr.so: $(OBJS)
@@echo "Loading $@ ..."
@@rm -f $@
$(CC) -b -g -o $@ *.o ***problem here***
@@echo "Done"
daemonStart.o: daemonStart.c
$(CC) $(CCFLAGS) daemonStart.c
getDateTime.o: getDateTime.c
$(CC) $(CCFLAGS) getDateTime.c
set_user_id.o: set_user_id.c
$(CC) $(CCFLAGS) set_user_id.c
clean:
rm -f *~ *.o core $(LIBS)
thanks in advance,
chris
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
here's my makefile:
# This make file creates a library to be used with different programs
@SRCS = daemonStart.c getDateTime.c set_user_id.c
OBJS = daemonStart.o getDateTime.o set_user_id.o
CCFLAGS = -c -g -z +z
CC = gcc
LIBS = libckfr.a libckfr.so
all: libckfr.a libckfr.so
libckfr.a: $(OBJS)
@@echo "Loading $@ ..."
@@rm -f $@
ar cru $@ *.o
@@echo "Done"
libckfr.so: $(OBJS)
@@echo "Loading $@ ..."
@@rm -f $@
$(CC) -b -g -o $@ *.o ***problem here***
@@echo "Done"
daemonStart.o: daemonStart.c
$(CC) $(CCFLAGS) daemonStart.c
getDateTime.o: getDateTime.c
$(CC) $(CCFLAGS) getDateTime.c
set_user_id.o: set_user_id.c
$(CC) $(CCFLAGS) set_user_id.c
clean:
rm -f *~ *.o core $(LIBS)
thanks in advance,
chris
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2003 01:00 PM
07-31-2003 01:00 PM
Re: undefined reference to `main'
Looks like it may be a syntax error in the C code. Do you have a version of lint you can run against the source?
mark
mark
the future will be a lot like now, only later
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2003 01:04 PM
07-31-2003 01:04 PM
Re: undefined reference to `main'
i solved the problem. i used the ld command to make the shared library. program compiled okay.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP