compiler construction - C++ programs, compiling with g++ -
I have a lot of information about compiling the C ++ program with g ++ in the Linux environment but, maybe That's something I'm missing, I'm getting this strange output / behavior.
I have the source file in test.cpp. To compile it, I did
(1) g ++ -a test.cpp g ++ -o test test.o ./test
everything works fine But when I had complained and linked the same step, like
(2) g ++ test.cpp -o test ./test => works fine (3) G ++ - Test.cpp -o test => does not work
In my last case, test is generated but is no longer executable; But in my estimation it should work fine. So, what is wrong or do I need to change some settings / configurations ??
I'm using G ++ 4.3.3
Thanks.
when you say:
g ++ -c test .cpp -o test
-C prevents flag linking, is therefore not executable - you are renaming the .o file
Actually , Do not do this.
Comments
Post a Comment