»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 08-15-2003, 04:35 PM   #1 (permalink)
Registered User
 
Join Date: Apr 2002
Location: Georgia
Posts: 137
Jüš† ä gü¥ is on a distinguished road
Kids Which libs to link for simple C program in gcc?

Anyone know the library(ies) and/or object file(s) which gcc tells ld to link in before generating a simple C program?

I am using gcc under the Dev-C++ environment on Windows, so it might be specific to that.

I know you can just use the -o switch and go the whole way of compiling a simple C file and creating the executable all in one step, but I want to use the -c switch, make an object file, and then use ld to link that object file with (the things I am asking for now) to make an executable that way.

I have tried crt1.o and crt2.o as those seemed like prime candidates, but they didn't help. I'm pretty sure it is one of the lib<nameoflib>.a files but I don't see any which seem right.

BTW, I'm not even trying to use any functions (other than main). I just want to get this to work first.

basically

int main(void){
return 0;
}

gcc -c test.c
ld test.o -l<stuff that I need now>
test


__________________
Jüš† ä €öm¶ù†Ê® §ÇÌÈñŒ mÅjÒ®
Jüš† ä gü¥ is offline   Reply With Quote
Old 08-17-2003, 06:23 AM   #2 (permalink)
Registered User
 
nukes's Avatar
 
Join Date: Oct 2002
Location: Scotland, UK
Posts: 2,946
nukes is on a distinguished road
Send a message via AIM to nukes Send a message via Yahoo to nukes
I think you need libc as well. use -lc
__________________
_____
NuKeS
nukes is offline   Reply With Quote
Old 09-10-2003, 08:53 PM   #3 (permalink)
Registered User
 
Join Date: Apr 2002
Location: Georgia
Posts: 137
Jüš† ä gü¥ is on a distinguished road
Quote:
Originally posted by nukes
I think you need libc as well. use -lc
Actually, I don't even HAVE libc with this. The libraries I have are

crt1.o
crt2.o
crtmt.o
crtst.o
CRT_fp10.o
CRT_fp8.o
CRT_noglob.o
dllcrt1.o
dllcrt2.o
gcrt1.o
gcrt2.o
libadvapi32.a
libbfd.a
libcap.a
libcoldname.a
libcomctl32.a
libcomdlg32.a
libcrypt32.a
libctrl3d32.a
libd3dim.a
libd3drm.a
libd3dxof.a
libddraw.a
libdinput.a
libdlcapi.a
libdplayx.a
libdsetup.a
libdsound.a
libdxguid.a
libfrtbegin.a
libg2c.a
libg2c.la
libgdi32.a
libglaux.a
libglu32.a
libglut.a
libglut32.a
libgmon.a
libhistory.a
libiberty.a
libimagehlp.a
libimm32.a
libiphlpapi.a
libkernel32.a
liblargeint.a
liblz32.a
libm.a
libmapi32.a
libmfcuia32.a
libmfmtapi.a
libmingw32.a
libmingwex.a
libmingwthrd.a
libmmalloc.a
libmoldname.a
libmpr.a
libmsacm32.a
libmsimg32.a
libmsvcp60.a
libmsvcrt.a
libmsvcrt20.a
libmsvcrt40.a
libmswsock.a
libnddeapi.a
libnetapi32.a
libntdll.a
libobjc.a
libobjc.la
libodbc32.a
liboleaut32.a
libolecli32.a
liboledlg.a
libolepro32.a
libolesvr32.a
libopcodes.a
libopcodes.la
libopengl32.a
libpenwin32.a
libpkpd32.a
libpsapi.a
librapi.a
librasapi32.a
libreadline.a
librpcdce4.a
librpcns4.a
librpcrt4.a
libscrnsave.a
libscrnsavw.a
libsecur32.a
libsetupapi.a
libshell32.a
libshlwapi.a
libstdc++.a
libstdc++.la
libsupc++.a
libsupc++.la
libsvrapi.a
libtapi32.a
libth32.a
libthunk32.a
liburl.a
libuser32.a
libuserenv.a
libuuid.a
libvdmdbg.a
libversion.a
libvfw32.a
libwin32spl.a
libwininet.a
libwinmm.a
libwinspool.a
libwinstrm.a
libwow32.a
libws2_32.a
libwsock32.a
libwst.a


Now, out of that selection, WHICH one (or, if not one, minimal ones) do I include as my libraries in order to get a simple C program to work in DevC++'s version of gcc?
__________________
Jüš† ä €öm¶ù†Ê® §ÇÌÈñŒ mÅjÒ®
Jüš† ä gü¥ is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 12:02 AM.