Intel® oneAPI Base Toolkit
Support for core tools and libraries to build and deploy high-performance data-centric applications
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
283 Discussions

Intel Oneapi won't compile C++ GUI project without a main

Blake1
Beginner
191 Views

I am trying to build a legacy project involving a mix of fortran and C++ which uses a GUI. There is no main program in either the fortran or C++. When I try to use the C++ from the Base Toolkit, an error occurs, at link time, saying it can't resolve the external reference to __MAIN_. This is because there is, and never was, a main program in this code. I am building using Visual Studio 2019. This error was not occuring until I installed the Base Toolkit. How can I get around this error and get my project built?

When someone responds, can you send me an Email using 'blakemitchell636@gmail.com' 

Thanks.

0 Kudos
6 Replies
NoorjahanSk_Intel
Moderator
169 Views

Hi @Blake1,


Thanks for reaching out to us.


Could you please provide us with a sample reproducer and the steps you have followed so that we can try it at our end?

Also please do let us know the compiler being used to build the project.



Thanks & Regards,

Noorjahan.



Blake1
Beginner
152 Views

What in the world is a sample reproducer??? I have worked in this industry for  40+ years and I have never

heard of such a thing?!?!? This application consists of about 375 files containing almost 2 1/2 million lines of code. It DOES NOT belong to me, but the company for which I work. It is proprietary to the company and I

can NOT provide it to anyone! I have put together a project using Visual Studio 2019 with intel oneAPI installed. The fortran compiler is installed and the oneAPI base toolkit which has the C++ and DPC++ compilers in it. The application does not have a main program. When I compile it, the compile works fine, but when it tries to link, I get an unresolved external error which says it can not find the __MAIN_. When I try to add a main program, it builds a .exe file, but it will start and then immediately shut down as the main is a dummy which doesn't do anything. I don't know how to explain it better than that!!! If you can't understand this simple explanation, then I need to get help from someone else.

NoorjahanSk_Intel
Moderator
124 Views

Hi,


>>What in the world is a sample reproducer??? 


Apologies for any confusion.


We mean to ask you to isolate the issue with a small code so that it would help us to understand how your code works.


Could you please let us know how your code got worked even without the main?

Also please let us know the compiler being used before and after installation of oneAPI Base toolkit.



Thanks & Regards,

Noorjahan.


NoorjahanSk_Intel
Moderator
93 Views

Hi @Blake1,


Could you please try to build your program by making the below changes in visual studio configuration properties?


>>Open Project configuration properties.


>>Go to Linker -> System


>> Change Subsystem to Windows (/SUBSYSTEM: WINDOWS)


Please let us know if you still face any issues.



Thanks & Regards,

Noorjahan.


NoorjahanSk_Intel
Moderator
66 Views

Hi @Blake1,


We haven't heard back from you. Could you please provide an update on your issue?


Thanks & Regards,

Noorjahan.



NoorjahanSk_Intel
Moderator
38 Views

Hi,


We have not heard back from you, so we will close this inquiry now. If you need further assistance, please post a new question.


Thanks & Regards,

Noorjahan.


Reply