How to programm in c++ / How to execute void app_main(void) in c++

Dythe_
Posts: 7
Joined: Sun Feb 09, 2020 4:39 pm

Re: How to programm in c++ / How to execute void app_main(void) in c++

Postby Dythe_ » Mon Feb 17, 2020 3:47 am

I thought those library could be compile in c++ since I don't put an extern C wrapper in all my c++ project but anyway it's something I had already tried and just in case tried again but no change.

Here is the console log after I cleaned the project:
console_log.txt
(2.13 MiB) Downloaded 44 times
If there is a better way to send it please tell me.
Thanks again

leenowell
Posts: 84
Joined: Tue Jan 15, 2019 1:50 pm

Re: How to programm in c++ / How to execute void app_main(void) in c++

Postby leenowell » Mon Feb 17, 2020 7:59 am

Think of the header files as declaring to the compiler that at link time you will be providing that variable / function etc at link time so pretend you have already have it for now. The corresponding source files are then compiled independently using either a C or C++ compiler and the linker joins the thinks that the compiler was told to expect later with the things it actually has. So... If you include a header file in a c++ compiled source file with out the extern C wrappers it will assume the altered names will be made available at link time. This would be true if the source file containing the actual definitions are in a c++ compiled source file but not in a C compiled source file.

The ones I mention to put inside the extern C were provided precompiled as a c library hence why you need to do it.

Back to your error., You have included the source file which contains the code for the method the linker is complaining about in the src list in cmakefile.txt (or whatever the file is called) and the method definition is exactly the same as in the error message? If you think you have, out a syntax error in the function to double check the compiler is picking it up correctly.

leenowell
Posts: 84
Joined: Tue Jan 15, 2019 1:50 pm

Re: How to programm in c++ / How to execute void app_main(void) in c++

Postby leenowell » Mon Feb 17, 2020 8:05 am

If the above doesn't help might be easier to zip up the latest cut of your project and I will take another look.

Dythe_
Posts: 7
Joined: Sun Feb 09, 2020 4:39 pm

Re: How to programm in c++ / How to execute void app_main(void) in c++

Postby Dythe_ » Mon Feb 17, 2020 9:32 pm

Thank you so much,
My problem isn't a linker issue any more.
My problems comes from one of the parameter of the methods been a double pointer which cause all my problems, still have to debug that one but maybe in another question.
Probably should have notice that one since the constructor was doing just fine which mean my cpp file was to.

Thanks again for your time Leenowell.
Dythe_

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 28 guests