-1
Born.cpp  
Born.h  
build  
dist  
doc_TP2.doxyfile  
Makefile  
nbproject  
PrincipalProgram.cpp  
validationFormat.cpp  
validationFormat.h

In a main repository, I have all the files and directories. I tried running g++ PrincipalProgram.cpp, but I got the following error:

/usr/bin/ld: /tmp/cc63Jbm6.o: in function `main':
PrincipalProgram.cpp:(.text+0xaf): undefined reference to `util::validerPointCardinal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: PrincipalProgram.cpp:(.text+0x16f): undefined reference to `util::validerPointCardinal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: PrincipalProgram.cpp:(.text+0x22c): undefined reference to `bornesQuebec::Borne::Borne(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: PrincipalProgram.cpp:(.text+0x245): undefined reference to `bornesQuebec::Borne::reqBorneFormate[abi:cxx11]() const'
/usr/bin/ld: PrincipalProgram.cpp:(.text+0x2f4): undefined reference to `bornesQuebec::Borne::asgNomTopographique(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: PrincipalProgram.cpp:(.text+0x338): undefined reference to `bornesQuebec::Borne::reqBorneFormate[abi:cxx11]() const'
collect2: error: ld returned 1 exit status

I am not very experienced with c++ yet. How can I run this project?

EDIT

If I try running make in the repo, I got this:

"make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/home/Session_Hiver_2021/Correction_IFT_1003/TP2/PourCorrection/solutionTp2/Tp2'
"make"  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux/tp2
make[2]: Entering directory '/home/Session_Hiver_2021/Correction_IFT_1003/TP2/PourCorrection/solutionTp2/Tp2'
make[2]: 'dist/Debug/GNU-Linux/tp2' is up to date.
make[2]: Leaving directory '/home/Session_Hiver_2021/Correction_IFT_1003/TP2/PourCorrection/solutionTp2/Tp2'
make[1]: Leaving directory '/home/Session_Hiver_2021/Correction_IFT_1003/TP2/PourCorrection/solutionTp2/Tp2'
Leo
  • 21
  • 4
  • IF you want to build the application you need to build all the source files. Simplist way is `g++ Born.cpp PrincipalProgram.cpp validationFormat.cpp` but you should really look up how to build and then combine object files. – Martin York Mar 12 '21 at 17:09
  • Run the makefile with the command `make`. – sweenish Mar 12 '21 at 17:09

1 Answers1

1

The project contains a makefile. You can use the command make in the terminal. Makefiles contain the necessary instructions to compile the complete project.

If that, for whatever reason, fails then there is probably documentation somehwhere that you should read.

sweenish
  • 4,793
  • 3
  • 12
  • 23