Jump to content
  • Advertisement
Sign in to follow this  
dolphins87

C help

This topic is 4093 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am doing an assignment for my comp science class and I get everything to compile fine as indiviual files but when I try to link them nothing happens and I cant edit the compiler cause it on a remote computer and we are using shell /tmp/ccSncJdl.o(.text+0x19): In function `main': : undefined reference to `ReadData' collect2: ld returned 1 exit status Any help would be appericated

Share this post


Link to post
Share on other sites
Advertisement
I am using gcc main.c and then we are instructed u use ./a.out to run the program we are using SSH Secure File Transfer to access all this on a computer at school.

Share this post


Link to post
Share on other sites
For linking you need to specify all of your files in the same command.

i.e. To compile and link in one step:
gcc main.c somefile.c otherfile.c
./a.out

or to compile and link separately:
gcc -c main.c
gcc -c somefile.c
gcc -c otherfile.c
gcc main.o somefile.o otherfile.o
./a.out

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!