C++ Projects?
Is there any way to make a C++ Project (or compile) using VI or VI Improved? by project I mean have a 'file1.h' and 'file1.cpp' and be able to link or compile them in some way. In Visual C++ (M$) you just click file > new > project and then add files to the project. If there is no way to do this in a Shell (VI or GVIM) does someone know of a program that can do this my I don't know if I can do this in KDevelop because its not working property. Thank You.
|
Yeah, theres Makefiles that do this. Theres a prog called Automake that can do what you need, but if you wish to get UBER! then check this out:
http://vertigo.hsrl.rutgers.edu/ug/make_help.html have fun |
i may have got the wrong idea by what you typed, and maybe what chewy said is what your looking for ..
but you say you want to compile it, so why don't you just type : g++ file1.cpp as long as file1.h is in the includes (#include "file1.h") it should compile ? i mean you can use vi(m) to code your project and then use gcc (g++) to compile ... again i may have got misled by what you typed, but isn't this all your looking for ? |
EDIT -- Didnt read entire post, stupid me.
|
Oh, I'm so dumb I should of just tried that!! What I would do is that I brougth files originally make in Visual C++ and since it sucks it gives errors in Linux, anyways what are the programs that can compile C++ files like Kdevelop or VC++?
Thanks. |
i already told you :
g++ if you are actually trying to say, what are some IDE's for coding C++ projects then kdeveolop is one, kate, emacs, Anjuta, gvim, rhide , etc, etc. ..... |
Quote:
g++:compiler ln:linker make:takes care of your projects; takes a makefile which defines which files are in your project. Sample: #Path to the project directory PPRJ=/home/sources/Linux.emptyproject/ PSRC=$(PPRJ)src/ PCLS=$(PSRC)classes/ #Set this if you have .h which are stored in a different location from .c/.cpp #INCLUDEPATH=$(PSRC)/wherever/Make/ #Name of the executable BINNAME=HELLOWORLD #Project files PRJOBJECTS=$(PSRC)main.o $(PCLS)class1.o $(PCLS)class2.o /usr/lib/libpthread.so CC=g++ CFLAGS=-Wall -ggdb -I$(INCLUDEPATH) prj: $(PRJOBJECTS) $(CC) -o $(BINNAME) $(PRJOBJECTS) main.o: $(PSRC)main.cpp $(PSRC)main.h $(CC) $(CFLAGS) -c $(PSRC)main.cpp class1.o: $(PCLS)class1.cpp $(PCLS)class1.h $(CC) $(CFLAGS) -c $(PCLS)class1.cpp class2.o: $(PCLS)class2.cpp $(PCLS)class2.h $(CC) $(CFLAGS) -c $(PCLS)class2.cpp clean: rm -f *.o rm -f a.out rm -f $(BINNAME) This expects the makefile in /home/sources/Linux.emptyproject/, main.h/.cpp in ./src, class1/2.h/.cpp in ./src/classes. At the console, just cd to /home/sources/Linux.emptyproject/ and type make. |
Quote:
Alex |
All times are GMT -5. The time now is 07:47 AM. |