---
title: "hello world, i linux"
type: "forum-thread"
url: "https://www.webforum.nu/amne/c-cpp/27993-hello-world-i-linux"
topic: "C/C++"
topic_url: "https://www.webforum.nu/amne/c-cpp"
author: "bughawk"
published: "2000-10-02T18:43:00.000Z"
updated: "2000-10-02T20:16:00.000Z"
replies: 3
views: 448
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/c-cpp/27993-hello-world-i-linux"
---

# hello world, i linux

## #1 — bughawk, 2000-10-02T18:43Z

yrin@c213\~/hacking/div-tester\>more test.cpp
\#include \<iostream\>

using namespace std;

void main (void)
{
  cout \<\< "test" \<\< endl;
}

yrin@c213\~/hacking/div-tester\>gcc -o test test.cpp 
/tmp/cctwVlbh.o: In function \`main':
/tmp/cctwVlbh.o(.text+0x4): undefined reference to \`endl(ostream &)'
/tmp/cctwVlbh.o(.text+0xe): undefined reference to \`cout'
/tmp/cctwVlbh.o(.text+0x13): undefined reference to \`ostream::operator\<\<(char const \*)'
/tmp/cctwVlbh.o(.text+0x1e): undefined reference to \`ostream::operator\<\<(ostream &(\*)(ostream &))'
collect2: ld returned 1 exit status
yrin@c213\~/hacking/div-tester\>

..Och varför vill inte detta fungera ? :l

Permalänk: https://www.webforum.nu/p/27993

## #2 — bughawk, 2000-10-02T19:58Z

En kompis kom på lösningen..

Måste förstås använda "g++", inte "gcc".. ;)

Permalänk: https://www.webforum.nu/p/400869

## #3 — Swey, 2000-10-02T20:04Z

Bra att det löste sig. Säg till när du gjort ditt första riktiga Linux-prog så får vi se hur det blev ;)

Permalänk: https://www.webforum.nu/p/400870

## #4 — bughawk, 2000-10-02T20:16Z

Jag borde nog börja med att port:a alla möjliga småprylar som jag har hållit på med... :)

Och så måste jag lära mig linux-api:et...

Permalänk: https://www.webforum.nu/p/400871

---

Tråden på webben: https://www.webforum.nu/amne/c-cpp/27993-hello-world-i-linux
