hoping someone might be able to help me out. I have been writing addins in C#, but now im trying to start out with using c++/Cli for some wrappers. but I'm getting errors from the start...
here are the steps I took to create a c++/Cli class project.
1.open VS2015 and create new c++/CLI class project,
2. close and open the sln file from MicroStation SDK command prompt
3. add include location to properties.
4. add lib location to properties
5. then all I did was start to add using statements to my header file. I only added #include<Mstn\MdlApi\MdlApi.h>
once I added that I got 2 errors.
cannot open source file "_config-eccp.h"
and #error directive: Data Alignment must be defined in basedefs.h.
im a newbie what it comes to c++...
John Drsek said:here are the steps I took to create a c++/Cli class project
When you write a *.mke make file and use bmake to build your app. you can benefit from the SDK examples.
*.mke
Some SDK examples have a Viz Studio solution, but I don't think that there is any C++/CLI example.
Try adding pre-processor definition WinNT to your Viz Studio project. That macro would be defined in your make file by one of the numerous *.mki include files. You have to replicate that in Viz Studio to build your project correctly.
WinNT
*.mki
Regards, Jon Summers LA Solutions
okay....
I really don't know what I'm doing when it comes to these bmake files.
I did define WinNT and that got rid of the second error.
but the first, cannot open source file "_config-eccp.h"
if coming from line 214 of config.h. but I have searched everywhere on my c drive and can not find the _config-eccp.h file.
John Drsek said:I really don't know what I'm doing when it comes to these bmake files
Most of us are in the same boat. I've been doing this stuff for more than two decades and still find those *.mki include files a mystery. Fortunately, we don't have to get involved with those too often (and only for reference, never to edit).
The simplest approach: when in Rome, do as the Romans do. Copy the example bmake files and modify.
..\SDK\include\Bentley\stdcxx\rw\config.h contains some information for the C++ compiler. I've never used it or seen it mentioned. Best left alone. However, that config.h has only 36 lines.
..\SDK\include\Bentley\stdcxx\rw\config.h
config.h
There is _config.h that has more lines and this...
// NOTE: the __EDG__ macro is #defined by most EDG-based compilers #if defined (__EDG__) \ && !defined (__DECCXX) \ && !defined (__HP_aCC) \ && !defined (__INTEL_COMPILER) \ && !defined (_SGI_COMPILER_VERSION) // FIXME: make this more robust by detecting the EDG eccp demo // during library configuration (and avoid relying on compiler // specific macros) # include "_config-eccp.h" #endif // __EDG__
I've never seen that file mentioned nor have I had to use it. Why it attempts to include the missing _config-eccp.h is buried in the C++ compiler. I don't know what defines __EDG__ — it's not in any of the __EDG__ files.
_config-eccp.h
__EDG__
thank you for helping me.
I can make a test c++/cli with a simple function and call that from c# easily (plenty on stuff on the internet). but when trying to do the same with the SDK im feeling stuck.
I decided to just set up a c++ project just to get something working. So if you use bmake to build do you still set up a visual studio project..and just not worry about the errors.
I get the same exact error in my c++ project. whenever I add any of the include header files from the SDK I get that cannot open source file "_config-eccp.h" error. I set up my additional include and lib locations in the project settings and my include statements are valid and intillesense is working as the header files show up as im typing the include statement.
should I be going about this is a different way. I like the intellisense of visual studio. are there certain header files I need to include first??
i feel like once i get by this set up stuff i could get going.