Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
build error using codeblocks
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
enrico68
Apprentice
Apprentice


Joined: 21 Oct 2016
Posts: 169

PostPosted: Sat Jan 20, 2018 7:12 pm    Post subject: build error using codeblocks Reply with quote

Hello,

I have an issue when trying to build the following C program with codeblocks:

Code:
#include <stdio.h>

main()

{

printf  ("Hello!");



return 0;


}


I get the following build error: /usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/.../.../.../lib64/Scrtl.o In function '_start' :
(.text+0x20) Undefined reference to main
error: ld returned 1 exit status

It is my very first try at C, as I do not have any experience or knowledge about programming. If I run the same program with codeblocks in Windows, it works, here with Gentoo it does not. What is the problem?
Back to top
View user's profile Send private message
enrico68
Apprentice
Apprentice


Joined: 21 Oct 2016
Posts: 169

PostPosted: Sat Jan 20, 2018 10:07 pm    Post subject: Reply with quote

Code:
#include <stdlib.h> 


did the trick....
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum