Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to create an alias on ubuntu for the bellow commands:

g++ -lSDL -lSDLmain -lSDL_image -lGL -lGLU src.cpp -o a.out
g++ -lGL -lglut `sdl-config --cflags --libs` src.cpp -o a.out

When I execute them in the terminal all goes very well, but if I create aliases for them I find the following error:

/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/crt1.o(.text+0x18): error: undefined reference to 'main'
collect2: ld returned 1 exit status
bash: -L/usr/lib/i386-linux-gnu: No such file or directory

The aliases are:

alias g++="g++ -lGL -lglut `sdl-config --cflags --libs`"
alias gcpp="g++ -lSDL -lSDLmain -lSDL_image -lGL -lGLU"
share|improve this question

1 Answer 1

up vote 0 down vote accepted

I have used the following alias and it worked well.

alias g+++="g++ -lSDL -lSDLmain -lSDL_image -lGL -lGLU"

The first does not work.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.