Hi everyone,

I just finished to implement my first "serious" C++ program on my laptop. When I compile it (on my laptop and some other machine), it is working without the least problem.

g++ -g -pthread -std=c++0x compute_gsea_thread_global_map_opt_results.cpp -o compute_gsea.out

When I try to compile it on one of the big computer (with 24 cores) of our institution, I first found that I had to use this command as g++ by default is a quite old version of it.

g++44 -g -pthread -std=c++0x compute_gsea_thread_global_map_opt_results.cpp -o compute_gsea.out

However, I get this error when using that command :

/tmp/sbrohee/ccMGMUfo.o: In function `writeToFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/u/sbrohee/Program/gsea/compute_gsea_thread_global_map_opt_results.cpp:203: undefined reference to `std::basic_ofstream<char, std::char_traits<char> >::basic_ofstream(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)'
collect2: ld returned 1 exit status

Any idea of the reason of this issue?

Many thanks to all of you,

Cheers,

Sylvain

You might try linking to stdc++:

gcc yourcode.cpp -lstdc++

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.