How to compile C++ with Pelles?

Started by bitcoin, August 07, 2019, 12:22:37 AM

Previous topic - Next topic

bitcoin

Can I compile C++ code in C? I try to add in project simple C++ file. But I have error:

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.

TimoVJL

#1
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.
May the source be with you

bitcoin

I see in Add-ins "C++ simple build" and think, that it can help build C++ code.
So, sorry.

TimoVJL

#3
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 ?
May the source be with you

bitcoin

QuoteDo 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).

TimoVJL

CppFile 2.2 have a support for CPPFLAGS, it may help in mixed C/C++ projects.
[cppflags]
cppflags=/c /nologo /O2 /X

May the source be with you