Pelles C forum

C language => Beginner questions => Topic started by: bitcoin on August 07, 2019, 12:22:37 AM

Title: How to compile C++ with Pelles?
Post by: bitcoin on August 07, 2019, 12:22:37 AM
Can I compile C++ code in C? I try to add in project simple C++ file. But I have error:

Code: [Select]
Building test.obj.
*** Error: cl.exe /c /nologo /O2 /X /I"C:\Program Files\Microsoft Visual Studio\ATL\Include" /I"C:\Program Files\Microsoft Visual Studio\Include" /I"C:\Program Files\Microsoft Visual Studio\MFC\Include" "....\test.cpp" -Fo"...\test.obj"
*** Error:Cannot found file
Done.

I have Visual Studio in computer.
Title: Re: How to compile C++ with Pelles?
Post by: TimoVJL on August 07, 2019, 09:35:31 AM
You can't, if it is C++ code.
If C code is in .cpp file, option /TC force cl to act like a C compiler.
Title: Re: How to compile C++ with Pelles?
Post by: bitcoin on August 07, 2019, 05:27:39 PM
I see in Add-ins "C++ simple build" and think, that it can help build C++ code.
So, sorry.
Title: Re: How to compile C++ with Pelles?
Post by: TimoVJL on August 07, 2019, 06:31:45 PM
Sorry.
It is possible to use a msvc compiler with poide and there are Add-ins for helping it.
But no debugging support.

1. CppFile AddIn come with PellesC and Path environment variable have to set to correct VS directory before starting poide
or Tools -> Options... -> Folders -> Executables inside poide.

2. Add VS library folder to poide LIB path.
Project -> Project options... -> Folders -> Libraries

Some of them:
https://forum.pellesc.de/index.php?topic=489.msg2145#msg2145

https://forum.pellesc.de/index.php?topic=7039.msg26707#msg26707
https://forum.pellesc.de/index.php?topic=3250.msg24126#msg24126


PellesC project to Visual Studio:
https://forum.pellesc.de/index.php?topic=7284.msg27674#msg27674

EDIT 2019-08-11:
Do we need a CppFile with additional features ?
Like CPPFLAGS in resource, so user can permanently change it ?
A user / local ini -file ?
Title: Re: How to compile C++ with Pelles?
Post by: bitcoin on September 13, 2019, 03:47:47 PM
Quote
Do we need a CppFile with additional features ?
Like CPPFLAGS in resource, so user can permanently change it ?
A user / local ini -file ?
No, I want to test some mix of C \ C++ code. I try to learn pure C++, without STL and other..only OOP (class,objects).
Title: Re: How to compile C++ with Pelles?
Post by: TimoVJL on September 13, 2019, 05:32:09 PM
CppFile 2.2 have a support for CPPFLAGS, it may help in mixed C/C++ projects.
Code: [Select]
[cppflags]
cppflags=/c /nologo /O2 /X