Hi All! I need to use C++ units (*.cpp) in my GPC projects. If I use C units (*.c) in my project (just like {$L socketmain.c}) it's ok but if I try to use {$L socketmain.cpp} then Pascal compiler tells me
gpc: ./socketmain.cpp: C++ compiler not installed on this system.
But it installed. Two things I tried to do: 1. Export environment variables CXX and CPP with "g++" value 2. Change *cpp_options in my gpc specs file. There was no such section before, so I inserted it into from gcc specs file. Now this section looks like:
*cpp_options: %{C:%{!E:%eGNU C does not support -C without using -E}} %{std*} %{nostdinc*} %{C} %{v} %{I*} %{P} %{$} %I %{MD:-M -MF %W{!o: %b.d}%W{o*:%.d%*}} %{MMD:-MM -MF %W{!o: %b.d}%W{o*:%.d%*}} %{M} %{MM} %W{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{M|MD|MM|MMD:%{o*:-MQ %*}} %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3} %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs} %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} %{fno-inline|O0|!O*:-D__NO_INLINE__} %{ffast-math:-D__FAST_MATH__} %{fshort-wchar:-U__WCHAR_TYPE__ -D__WCHAR_TYPE__=short\ unsigned\ int} %{fshow-column} %{fno-show-column} %{fleading-underscore} %{fno-leading-underscore} %{foperator-names} %{fno-operator-names} %{ftabstop=*} %{remap} %{g3:-dD} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*&U*&A*} %{i*} %Z %i %{E:%{!M*:%W{o*}}}
But nothing changed. What have I do to compile projects with C++ files? I have not ideas for the present, please give them to me:)
Software versions: Linux: RedHat (kernel 2.5.52) gpc: gpc version 2.1 (20020510), based on 2.95.3 20010315 (release) gcc: gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)
mailto:marny@rambler.ru
IM wrote:
Hi All! I need to use C++ units (*.cpp) in my GPC projects. If I use C units (*.c) in my project (just like {$L socketmain.c}) it's ok but if I try to use {$L socketmain.cpp} then Pascal compiler tells me
gpc: ./socketmain.cpp: C++ compiler not installed on this system.
But it installed. Two things I tried to do:
By default, the automake mechanism only uses the compilers that were built and installed together with GPC. Apparently you have the C++ compiler separately installed.
You can try the option `--automake-g++=g++' (if `g++' is your C++ compiler). This might cause problems if the versions of the compilers differ too much, but often it should work.
Frank
FH> IM wrote:
Hi All! I need to use C++ units (*.cpp) in my GPC projects. If I use C units (*.c) in my project (just like {$L socketmain.c}) it's ok but if I try to use {$L socketmain.cpp} then Pascal compiler tells me
gpc: ./socketmain.cpp: C++ compiler not installed on this system.
But it installed. Two things I tried to do:
FH> You can try the option `--automake-g++=g++' (if `g++' is your C++ FH> compiler). This might cause problems if the versions of the FH> compilers differ too much, but often it should work.
Thanks for advice! But it does not work in my system :(
I tried also the following options (with same result): --automake-c++=g++ --automake-cpp=g++ --automake-схх=g++
Ingvar
Ingvar Marny wrote:
FH> IM wrote:
Hi All! I need to use C++ units (*.cpp) in my GPC projects. If I use C units (*.c) in my project (just like {$L socketmain.c}) it's ok but if I try to use {$L socketmain.cpp} then Pascal compiler tells me
gpc: ./socketmain.cpp: C++ compiler not installed on this system.
But it installed. Two things I tried to do:
FH> You can try the option `--automake-g++=g++' (if `g++' is your C++ FH> compiler). This might cause problems if the versions of the FH> compilers differ too much, but often it should work.
Thanks for advice! But it does not work in my system :(
You need a rather recent GPC for this (try the latest alpha).
Frank
Ingvar mailto:marny@rambler.ru
It should also be pointed out that if C++ objects are being used and the versions are different, then name mangling becomes a concern.
Are the name mangling systems used by GPC and g++ compatable between identical versions of gcc?
In other words, if GPC is built along with g++ from the same gcc source tree, will the objects interact appropriately, or are the differences between the languages simply too much for gcc to handle?
--- Frank Heckenbach frank@g-n-u.de wrote:
IM wrote:
Hi All! I need to use C++ units (*.cpp) in my GPC projects. If I use C
units
(*.c) in my project (just like {$L socketmain.c}) it's ok but if I try to use {$L socketmain.cpp} then Pascal compiler tells me
gpc: ./socketmain.cpp: C++ compiler not installed on this system.
But it installed. Two things I tried to do:
By default, the automake mechanism only uses the compilers that were built and installed together with GPC. Apparently you have the C++ compiler separately installed.
You can try the option `--automake-g++=g++' (if `g++' is your C++ compiler). This might cause problems if the versions of the compilers differ too much, but often it should work.
Frank
-- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88 1707
===== ======= Frank D. Engel, Jr.
__________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Frank D. Engel, Jr. wrote:
It should also be pointed out that if C++ objects are being used and the versions are different, then name mangling becomes a concern.
Are the name mangling systems used by GPC and g++ compatable between identical versions of gcc?
In other words, if GPC is built along with g++ from the same gcc source tree, will the objects interact appropriately, or are the differences between the languages simply too much for gcc to handle?
Currently, GPC and C++ objects are not compatible. You need a non-OOP ("C style") interface.
Frank
On Thu, 16 Jan 2003, Frank Heckenbach wrote:
Frank D. Engel, Jr. wrote:
It should also be pointed out that if C++ objects are being used and the versions are different, then name mangling becomes a concern.
Are the name mangling systems used by GPC and g++ compatable between identical versions of gcc?
In other words, if GPC is built along with g++ from the same gcc source tree, will the objects interact appropriately, or are the differences between the languages simply too much for gcc to handle?
Currently, GPC and C++ objects are not compatible. You need a non-OOP ("C style") interface.
Yes, but think he didn't get that far.
Instead of including .cpp sources in the .pas file, why not compile the .cpp's with "-c" option and then including the resulting .o files on the gpc command line?
Russ
Thanks to All! Well I just had translated my C++ files to usual C and had successfully compiled the project. It's certainly temporary solution and I hope that somewhen in future I will have an ability to make it with C++:) Ingvar.