728x90

설치방법은 물론 여러가지다. 이 글에서는 가장 간단하게 설치하는 yum 으로 설치할 것이다. 먼저 Linux 에 설치돼있는지 검사해보자.

rpm -qa | grep gcc


현재 설치돼있지 않다면 아주 간단하게 아래의 명령을 이용해서 설치해보자.

su -c  'yum -y install gcc'


너무 간단한가? 설치가 모두 끝났는지 다시 한번 검사해보자.

rpm -qa | grep gcc






현재 설치된 버전은 4.4.4 임을 알 수 있다. 이제 간단한 코딩을 통해 테스트해보자. vi 를 열어서 아래와 같이 아주 간단한 코딩을 해보자. 파일의 이름은 hello.c 이다.




이제 파일을 저장하고 컴파일하자.





gcc -W -Wall -O2 -o hello hello.c


-Wall 옵션은 모든 경고 메시지를 출력하라는 뜻
-W 옵션은 -Wall 옵션에서 제외된 16가지 다른 경로 메시지를 출력하라는 뜻
즉, 이 두 개의 옵션을 통해 모든 경고 메시지를 출력하는 뜻이다.
-O2 옵션은 숫자 0이 아니라 영문대문자 'O'이다. 최적화에 대한 옵션이어서 컴파일과정에서 속도를 향상시키고 사이즈를 줄일 때 사용한다.
-o 옵션은 영문소문자 'o'이다. output 즉 컴파일해서 나오는 실행 파일의 이름은 이 옵션 뒤에 나오는 이름으로 하라는 뜻. 그래서 이 파일을 컴파일하면 뒤에 나오는 'hello'가 실행파일이 되는 것이다.





만일 컴파일에 에러가 없다면 바로 프롬프트가 떨어질 것이다. 그럼 hello 라는 실행파일이 만들어 진다. 실행해보자.





간단하다. 표준 출력으로 'Hello, world' 라는 글자를 출력한다. 전세계적으로 C 언어를 처음 배우는 사람들이 다 하는 코드였다. 잘 설치된 것 같다.


출처 : http://javaexpert.co.kr/105

Posted by 앗뜨거
,
728x90

출처:http://nowonbun.tistory.com/138

캡쳐



Posted by 앗뜨거
,
728x90

building workspace has encountered a problem errors occurred during the build 오류와함께


Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.6 의 maven 오류


Description Resource Path Location Type Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 from http://repo1.maven.org/maven2was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 from/to central (http://repo1.maven.org/maven2): No response received after 60000 ExampleProject Unknown Maven Problem



이런 도움말이떴을떄 

 


나는 http://stackoverflow.com/questions/5074063/maven-error-failure-to-transfer 를 참조해서


cmd 에서


find ~/.m2  -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print -exec rm {} \;


을 치고


cd %userprofile%\.m2\repository for /r %i in (*.lastUpdated) do del %i


를 한다음


프로젝트를 Then rightclick on your project in eclipse and choose Maven->Update Dependencies

Posted by 앗뜨거
,