Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code generation failed: Unrecognized flag '-FitObjData' in 'p2'

I am getting this error "Unrecognized flag '-FitObjData' in 'p2'" after adding libpng static library to my project for use with pngwriter. How do I fix this error and what is it telling me? I am compiling with VC10.

like image 418
user1304765 Avatar asked Feb 07 '23 14:02

user1304765


2 Answers

I also encountered this issue while trying to link with openssl.

The issue was openssl was built by visual 2015 and I was linking with visual 2012. This difference might trigger some dark magic in the visual studio backend.

Try to recompile your static library with visual 2010.

like image 53
Regis Portalez Avatar answered Feb 24 '23 11:02

Regis Portalez


If your solution has multiple projects and build configurations, make sure you update the target platform for all projects and build configurations.

I ran into this problem after updating from VS 2010 to VS 2015. One project failed to build in Debug configuration because a library it depended on (in the same solution) was still being built (in its Debug configuration) with Platform Toolset = "Visual Studio 2010". Updating that to "Visual Studio 2015 (v140)" fixed my problem.

like image 37
Ted W Avatar answered Feb 24 '23 11:02

Ted W