g++의 기본 include 디렉토리 추가

purewell의 이미지

RedHat8에서 g++의 기본 include 디렉토리는

/usr/include 와 /usr/local/include 입니다.

새로운 기본 include 디렉토리를 추가하고 싶습니다.

ex) /usr/myinclude

어떻게 해야하나요?

mach337의 이미지

다음처럼 옵션을 사용합니다. 직접입력하거나 Makefile 에 추가하거나 말이죠.

-I/usr/myinclude

purewell의 이미지

답변 감사드립니다.

그렇다면 stlport 를 쓰려면,

항상 -I /usr/local/include/stlport를 해줘야하나요?

BCC5.5 같은 경우 bin 디렉토리에 bcc32.cfg 에

컴파일러 옵션을 미리 넣어줄 수 있도록 되어 있지만,

gcc/g++ 은 그런 기능이 없는 건가요?

_____________________________
언제나 맑고픈 샘이가...
http://purewell.biz

monpetit의 이미지

있긴 있습니다만 절대 추천하지 않습니다.
gcc -v 하면 첫줄에 나오는 게 spec 파일의 위치입니다.
Reading specs from ... 이렇게 나오는데 이 파일을 에디터로 열어서
cpp 옵션에 -I/usr/myinclude 등을 넣어놓으면 됩니다.
하지만 이럴 경우 다른 컴퓨터에선 컴파일이 되지 않기 때문에 이 방법을 사용하는 사람은 없다고 봐도 됩니다.
조금 귀찮더라고 -Ipath 를 사용하거나, Makefile을 이용하는 것이 상식입니다.

mach337의 이미지

BCC 라면 Borland Compiler 인가요..?
Unix Clone OS 는 주로 Makefile 을 사용합니다.
여기에 여러가지 옵션을 미리 정의해서 사용합니다.
따라서 프로젝트마다 다른 컴파일 옵션은 여기서 정의해서 사용합니다.

purewell의 이미지

답변 감사드립니다.
(BCC는 Borland社 컴파일러입니다)

제가 이런 삽질을 하려는 이유는 STLPort를 기본 STL로
쓰고 싶어서입니다.

아앍!!!
spec 파일이 상당히 복잡다양하게 생겼군요.

_____________________________
언제나 맑고픈 샘이가...
http://purewell.biz

cdpark의 이미지

purewell wrote:

제가 이런 삽질을 하려는 이유는 STLPort를 기본 STL로
쓰고 싶어서입니다.

아예 STLPort를 /usr/include에 설치하시죠?

gcc의 기본 설정을 바꾸는 것보다는 이 쪽이 정신건강에 이롭습니다.

purewell의 이미지

기본적으로 stlport를 설치하면...

/usr/local/include/stlport 에 설치됩니다.

거기에 여러파일이 있지만서도.... pthread.h 라는 녀석이 있는데,

이 녀석은 /usr/include 에도 있는 녀석이랍니다.

/usr/include 에 무턱대고 copy 하면 안 좋을 것 같습니다만... ㅠ_-);

_____________________________
언제나 맑고픈 샘이가...
http://purewell.biz

mastercho의 이미지

그렇게 까지 하면서...

g++에 지원하는 STL대신 STL-Port를 사용하시려는 이유가 있으신지??

승자는 자기보다 우월한 사람을 보면 존경심을 갖고 그로부터 배울 점을 찾지만 패자는 자기보다 우월한 사람을 만나면 질투심을 갖고 어디 구멍난 곳이 없는지 찾는다.
- 하비스

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.