GLES-Render.cpp cocos2d-X causing compile time errors - c++

I have copied the GLES-Render.h and GLES-Render.cpp files into my project and added them to the Android.ml file. Now the file is full of errors like
Symbol 'GL_FLOAT' could not be resolved
Symbol 'GL_FALSE' could not be resolved
When i click on any of these symbols eclipse opens up glew.h file or the some error open up on CCGLProgram.h. What am i doing wrong ? Is there OpenGL includes that i have to include ?
Kind Regards

You cna check this GLES-Render.h/.cpp in this link. and also add GLES-Render in your android.mk file. GLES-RENDER

Related

could not find cdt include path

I am new to Eclipse CDT 2020/9 and installed the IDF-ESP32-plugin.
I can compile "Hello World" from within Eclipse and it runs fine on the target hardware.
However, in Eclipse editor view I got lots of errors about symbols that cannot be resolved. These symbols are defined in .h files which are #included in the source - without a failure mark.
Seems that others have the same problem still unresolved.
I found some description about Preprocessor Include Paths which I cannot follow because the menu entry Preprocessor Include P... is missing in my Eclipse installation.
An Example:
The first missing symbol is esp_chip_info_t. It is declared in esp_system.h. I can follow the regarding #include by right-click on the filename and choose Open Declaration. That means: Eclipse knows where that file is and it contains the symbol.
I wonder why the editor can not resolve that symbol.
Q1: Shall Eclipse editor find that symbol or have I to do something about it?
If Yes, what could be missing in my installation?
Q2: What may be the reason that I do not see the menu entry Preprocessor Include Path? I guess if I could use that entry I would be able to help the editor finding the .h file.
Addition: The subject is even more confusing:
There a two .c-files: main.c and hello_world_main.c. In main.c the #inlude files are all unresoled, while in hello_world_main.c they have been found by Eclipse. If I follow an #include in hello_world_main.c (F3) I see e.g. esp_system.h. That file itself has #includes, e.g. esp_err.h. They are not flagged unresolved but I cannot follow (F3 does not work).
How can I find out why Eclipse behaves as it does?

QtCreator - Compiling issue - External source files

I have a Qt project, accessing another cross-platform (boost) project on my disc. Adding the header includes does not seem to cause any problem.
#include "../../Visual Studio 2015/Projects/..." //Header file down the road
Adding existing source files to the sources folder in my Qt Project works also without a problem, the files are found and I can open them. I believe the files are not correctly compiled - if at all - as I get a linker error, telling me that %sourcefile%.obj could not be opened. (not created)
LNK1104: cannot open file 'debug\Error.obj'
I tried copying the content of Error.cpp into a new .cpp file created in the Qt project directory. After that the error message jumped to the next source file. I could now do this for all source files, but this seems to be quite... unhandy. Changes in the original project won't affect the Qt project then.
Does somebody know the problem / got a solution to it ?
I checked this question, answer and comments already, but that did not seem to fix the error or change anything.
The solution was quite simple and a little strange. It appears that something is causing an issue when using paths with spaces with Qt's include(...) and SOURCES in a *.pro file.
//This apparently works and source files are compiled.
include(C:/ProjDir/ProjName.pri)
//This works too, but the source files are not being compiled.
include("../../Visual Studio 2015/Projects/ProjDir/ProjName.pri")
Thanks to JKSH on the Qt-Forums and Sebastian for his hint using a .pri file.

Visual Studio External Symbol Error while file is present

I am trying to compile minidump_file_writer_unittests located here to compile on my Windows machine. You can clone the repository to download the solution. The code previously was only compiled for Linux so there are some problems. Currently, I am facing Unresolved External Symbol error. I understand that this error is because my code can't find the relevant source files.
Concretely, the basic problem is that minidump_file_writer.cc fails to locate the function UTF32ToUTF16Char(*str, out) on line 122 and UTF8ToUTF16Char on line 151. This function is present in ..\common\string_conversion.h and the source file for this header file is in the same directory. I have included the source in the project and yet it fails to detect the problem.
Can you please see where exactly is the problem here?
You need to include file convert_UTF.c to your "minidump_file_writer_unittest" project. It compiles after that.

linking error: ambiguous libboost*.lib vs boost*.lib

I'm using boost in my project. I've downloaded pre-compiled binaries from here http://boost.teeks99.com/
When linking I receive such error:
Error 18 error LNK2005: "public: void __cdecl boost::thread::join(void)" (?join#thread#boost##QEAAXXZ) already defined in boost_thread-vc110-mt-1_52.lib(boost_thread-vc110-mt-1_52.dll) C:\Oleg\projects\MBClient\FastNativeAdapter\libboost_thread-vc110-mt-1_52.lib(thread.obj) FastNativeAdapter
Why boost contains two lib with so similar name, what is the difference between them?
libboost_thread-vc110-mt-1_52.lib
boost_thread-vc110-mt-1_52.lib
How to fix linking error?
upd I've compiled boost myself. I've added boost_1_53_0\stage\lib directory to linker. This directory actually contains 3 "copies" of "each" file, for example:
boost_atomic-vc110-mt-1_53.dll
boost_atomic-vc110-mt-1_53.lib
libboost_atomic-vc110-mt-1_53.lib
So It's clear what compiler claims about. Somehow it can't understand which version of lib file to use. It's likely connected with static/dinamic linking, but I still can not find the solution. I'm sure my problems is pretty common so I hope someone can suggest me what to do.
I've tried to delete all "libboost*" files from folder but then I receive such error:
Error 15 error LNK1104: cannot open file 'libboost_date_time-vc110-mt-1_53.lib'
I've tried to delete all "boost*lib" files from folder but then I receive such error:
Error 15 error LNK1104: cannot open file 'boost_thread-vc110-mt-1_53.lib'
Then I copied boost_thread-vc110-mt-1_53.lib back and I receive a lot of errors like that:
Error 16 error LNK2005: "public: virtual __cdecl boost::detail::thread_data_base::~thread_data_base(void)" (??1thread_data_base#detail#boost##UEAA#XZ) already defined in boost_thread-vc110-mt-1_53.lib(boost_thread-vc110-mt-1_53.dll)
So when there are no boost_thread-vc110-mt-1_53.lib compiler claims that it's missing, when there is boost_thread-vc110-mt-1_53.lib compiler claims that "function is already defined". Probaly somehow I do use dinamic and static linking at the same time or something like that?
upd2 i've uncommented #define BOOST_ALL_DYN_LINK as suggested here and now code compiles! i'm investigating if everything else is fine. however i didn't understand why I should uncomment #define BOOST_ALL_DYN_LINK so comments are welcome.
Edit: Initial statement removed since an edit to the post changed the situation.
Based on http://www.boost.org/doc/libs/1_53_0/more/getting_started/unix-variants.html#library-naming (as provided by Igor R.):
libboost_thread-vc110-mt-1_52.lib is a static lib (no need for the DLL)
boost_thread-vc110-mt-1_52.lib is the import lib for the DLL
You only need to use one of these.
Another idea/solution to try if you hit the error LNK1104: cannot open file 'libboost_date_time-*.lib' error:
In our project, we include the boost/date_time.hpp file. We define the constant BOOST_ALL_NO_LIB instead of BOOST_ALL_DYN_LINK in our project settings to tell boost not to automatically select which libraries to link against.
See the Boost documentation for more information about this option.
So you could add BOOST_ALL_NO_LIB in Project Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions and check whether this linker error goes away.
I think first of all you need to correct your question. Do you mean (I guess you already know the difference between DLL and LIB )
libboost_thread-vc110-mt-1_52.lib
boost_thread-vc110-mt-1_52.dll
or
libboost_thread-vc110-mt-1_52.lib
boost_thread-vc110-mt-1_52.lib
Anyway, it seems the issue is you're mixing static(libboost_thread-vc110-mt-1_52.lib) and shared (boost_thread-vc110-mt-1_52.lib) boost libraries. But without the working environment and platform details I cannot purpose an exact solution. If you work in Visual Studio ,then you can go to right click on project file > properties > linker > input > ignore specific library and add libboost_thread-vc110-mt-1_52.lib there and try.
asking myquestion myself.
need to uncomment #define BOOST_ALL_DYN_LINK (refer to description)

LNK1004: Cannot open file 'Jsfwbase12D.lib'

So, I'm a bit confused on this error that I'm getting while compiling/linking a C++ project.
In the Input section of the Linker configuration, we have a additional dependency with the file name Jsfwbase12D.lib. This file was recently changed to Jsfwbase12.lib without the capital D. I changed the references within the project to the new file name and then attempted to re-compile and got the below error message.
Error 2 fatal error LNK1104: cannot open file 'Jsfwbase12D.lib' m5gaddrs m5gaddrs
I opened up the vcproj file in notepad and searched for the old file name and it found zero results.
Does anyone have any idea why the linker isn't looking for the correct file and instead trying to find the old one?
Edit:
I opened the obj file in notepad and found the old Jsfwbase12D.lib reference. So it appears that's why the linker is failing. Now the real question is, why is the compiler inserting those references for debug mode if they are not specified anywhere?
/DEFAULTLIB:"Jsfwbase12D.lib"
Your code likely contains #pragma comment(lib, "Jsfwbase12D.lib") somewhere. This informs the linker of a dependency which gets included during link time.