Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7953 Discussions

Failed to compile sample program

Siqiao_Fu
Beginner
1,263 Views

https://software.intel.com/content/www/us/en/develop/documentation/advisor-cookbook/top/model-cpp-application-performance-on-a-target-gpu.html

 

When I compiled the native C++ implementation according to this tutorial, only the obj file was generated, not the executable file. My toolkit is the latest version, and the system is win10. I want to know why this happens.

 

icx.exe /c /Qm64 /Zi /nologo /W3 /O2 /Ob1 /Oi /D NDEBUG /D _CONSOLE /D _UNICODE /D UNICODE /EHsc /MD /GS /Gy /Zc:forScope /Fo"x64\Release\\" /TP src\main.cpp src\mandelbrot.cpp src\timer.cpp

 

This is the command I use. 

0 Kudos
1 Solution
SantoshY_Intel
Moderator
1,186 Views

Hi,

We see the option '/Fo' followed by <path of object files that need to be generated>  i.e "x64/Release" in your compiling command.

'/Fo' flag is meant to accumulate the object files at a specified path or directory. So if we use '/Fo' we get only (.obj) files in the /Fo path i.e "x64/Release", but not (.exe) .

So ignore '/Fo' option too!

Please use the below command and try re-compiling the program:

icx.exe /Qm64 /Zi /nologo /W3 /O2 /Ob1 /Oi /D NDEBUG /D _CONSOLE /D _UNICODE /D UNICODE /EHsc /MD /GS /Gy /Zc:forScope /TP src\main.cpp src\mandelbrot.cpp src\timer.cpp

Please refer to the below screenshot.

SantoshY_Intel_0-1624452935699.png

 

Thanks & Regards,
Santosh

 

 

 

View solution in original post

0 Kudos
4 Replies
SantoshY_Intel
Moderator
1,246 Views

Hi,

 

Thanks for reaching out to us.

 

We see that you used '/c' option in your compilation command. Using '/c' option will stop linking and will generate object(.o) file, instead of executable(.exe).

 

So try removing '\c' option and re-compile to generate .exe file as below:

 

icx.exe /Qm64 /Zi /nologo /W3 /O2 /Ob1 /Oi /D NDEBUG /D _CONSOLE /D _UNICODE /D UNICODE /EHsc /MD /GS /Gy /Zc:forScope /TP src\main.cpp src\mandelbrot.cpp src\timer.cpp

 

Please refer to the below screenshot.

SantoshY_Intel_0-1624439994864.png

 

Thanks & Regards,

Santosh

 

0 Kudos
Siqiao_Fu
Beginner
1,239 Views

I removed  '\c' option and re-compiled it, but the executable file still wasn't generated.

 

icx.exe /Qm64 /Zi /nologo /W3 /O2 /Ob1 /Oi /D NDEBUG /D _CONSOLE /D _UNICODE /D UNICODE /EHsc /MD /GS /Gy /Zc:forScope /Fo"x64\Release\\" /TP src\main.cpp src\mandelbrot.cpp src\timer.cpp

Siqiao_Fu_0-1624440234868.png

Siqiao_Fu_1-1624440487546.png

 

 

0 Kudos
SantoshY_Intel
Moderator
1,187 Views

Hi,

We see the option '/Fo' followed by <path of object files that need to be generated>  i.e "x64/Release" in your compiling command.

'/Fo' flag is meant to accumulate the object files at a specified path or directory. So if we use '/Fo' we get only (.obj) files in the /Fo path i.e "x64/Release", but not (.exe) .

So ignore '/Fo' option too!

Please use the below command and try re-compiling the program:

icx.exe /Qm64 /Zi /nologo /W3 /O2 /Ob1 /Oi /D NDEBUG /D _CONSOLE /D _UNICODE /D UNICODE /EHsc /MD /GS /Gy /Zc:forScope /TP src\main.cpp src\mandelbrot.cpp src\timer.cpp

Please refer to the below screenshot.

SantoshY_Intel_0-1624452935699.png

 

Thanks & Regards,
Santosh

 

 

 

0 Kudos
SantoshY_Intel
Moderator
1,113 Views

Hi,


Thanks for accepting as a solution.

As your issue has been resolved, we will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.


Have a Good day!


Thanks & Regards,

Santosh




0 Kudos
Reply