Danya🔥
https://www.coursera.org/learn/build-a-computer
Rose
User NUR has 1/2 warnings; be careful! Reason: whatapp ad
Rose
User abdul has 1/2 warnings; be careful! Reason: facebook spam
Rose
User Zülfikar has 1/2 warnings; be careful! Reason: offtop
CPU_Governor
Someone that knows C, C++, RUST and is into embedded system, emulation, virtualization, operating system dev; what fields can he be classified under . like can i say i'm a low level developer
CPU_Governor
Or systems programmer
CPU_Governor
This
Okay thanks
Sarmat
app.h(320): Error C4668 : 'INTERNAL_EXPERIMENTAL' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' 10>app.h(341): Error C4668 : 'INTERNAL_EXPERIMENTAL' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' 10>app.h(353): Error C4668 : 'INTERNAL_EXPERIMENTAL' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' 10>app.h(382): Error C4668 : 'INTERNAL_EXPERIMENTAL' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' trying to compile Firebase sdk in my unreal engine project and taking this error. someone know how to fix it? i changed cpp standards in project but it not helped
Rithesh
Hii
Aminos
hii
Aminos
hi I am new and I want to learn c++ can you please give me the best sources to start and study c++
Rose
hi I am new and I want to learn c++ can you please give me the best sources to start and study c++
Please check out this channel - @Resources for information on learning sources for C and C++ (books and videos) and Frequently Asked Questions.
Aminos
thank you so much
Ибраги́м
https://itnext.io/c-20-concepts-complete-guide-42c9e009c6bf
Sarmat
guys, where is windows absolute path to cpp #include <objc/objc.h> file?
Manav
guys, where is windows absolute path to cpp #include <objc/objc.h> file?
That depends on what build system you use if any. Normally it'll search the standard include directories
Sarmat
That depends on what build system you use if any. Normally it'll search the standard include directories
I'm on windows 11. I'm trying to compile firebase-cpp-sdk. I've been stuck on this for three days now. It looks like it cannot be compiled...
Manav
I'm on windows 11. I'm trying to compile firebase-cpp-sdk. I've been stuck on this for three days now. It looks like it cannot be compiled...
Explain what you're doing. Just because it doean't happen for you doesn't mean it can't.
Sarmat
Explain what you're doing. Just because it doean't happen for you doesn't mean it can't.
I trying to integrate firebase sdk to my unreal engine project. I download prebuilded files and headers from their github, integrated it and linked to my unreal engine project. I getting error "Cannot open include file: 'objc/objc.h': No such file or directory". So, i can't found this file on my pc. When i deleting this line i getting linker LNK2019, LNK2001 errors. I tried google this, many sites give me information it's mvsc compiler issue, because it's old. I updated this, but taking this errors again. My head will destroy with this SDK.
Sarmat
Sorry for my English(
Sarmat
I linked it by Unreal Build Tool. this is function where i taking all static libraries private List<string> GetStaticLibraries() { List<string> Output = new List<string>(); if (Target.Platform == UnrealTargetPlatform.Win64) { Output.AddRange(new[] { Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_analytics.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_app.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_app_check.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_auth.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_database.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_dynamic_links.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_firestore.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_functions.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_gma.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_installations.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_messaging.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_remote_config.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_storage.lib"}) }); } // and other stuff, telegram does not allow me to send message bigger return Output; }
Sarmat
This is main UBT function: public FirebaseSDK(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; CppStandard = CppStandardVersion.Cpp17; Type = ModuleType.External; bEnableExceptions = true; string JavaPath = Environment.GetEnvironmentVariable("JAVA_HOME"); if (JavaPath != null) { PublicIncludePaths.Add(Path.Combine(JavaPath, "include")); PublicIncludePaths.Add(Path.Combine(JavaPath, "include", "win32")); PublicIncludePaths.Add(Path.Combine(JavaPath, "include", "win32", "bridge")); } else { Console.WriteLine("JAVA Path is null. Try to add environment variable to your windows system called JAVA_HOME, or change variable name in Build.cs file of plugin"); } PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "include")); foreach (var staticLibrary in GetStaticLibraries()) { string NewPath = Path.Combine(ModuleDirectory, "libs", "windows", staticLibrary); PublicAdditionalLibraries.Add(NewPath); RuntimeDependencies.Add(NewPath); } }
Sarmat
This is firebase part of code where error occurs: #ifdef FIREBASE_PLATFORM_ANDROID #include <jni.h> #else if FIREBASE_PLATFORM_IOS || FIREBASE_PLATFORM_TVOS extern "C" { #include <objc/objc.h> } // extern "C" #endif // FIREBASE_PLATFORM_ANDROID, FIREBASE_PLATFORM_IOS, // FIREBASE_PLATFORM_TVOS
Manav
I linked it by Unreal Build Tool. this is function where i taking all static libraries private List<string> GetStaticLibraries() { List<string> Output = new List<string>(); if (Target.Platform == UnrealTargetPlatform.Win64) { Output.AddRange(new[] { Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_analytics.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_app.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_app_check.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_auth.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_database.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_dynamic_links.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_firestore.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_functions.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_gma.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_installations.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_messaging.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_remote_config.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_storage.lib"}) }); } // and other stuff, telegram does not allow me to send message bigger return Output; }
You're adding them to win64 platform. Shouldn't this be android?
Sarmat
You're adding them to win64 platform. Shouldn't this be android?
I don't think so. It's basic include files of firebase sdk. I can't see versions of headers for each platforms here is one unique version for all platforms.
Manav
I don't think so. It's basic include files of firebase sdk. I can't see versions of headers for each platforms here is one unique version for all platforms.
From the docs, it seems for desktop there's different set of libraries. https://firebase.google.com/docs/cpp/setup?platform=android#desktop-workflow
Manav
it finds FIREBASE_PLATFORM_IOS or FIREBASE_PLATFORM_TVOS so the definitions are there
Sarmat
it finds FIREBASE_PLATFORM_IOS or FIREBASE_PLATFORM_TVOS so the definitions are there
I'm using Auth part of firebase sdk. It is in allowed libs list.
Sarmat
Header file is in include/auth/credential.h
Manav
can you share the exact errors?
Sarmat
can you share the exact errors?
[1/4] Compile [x64] FirebaseUser.cpp 10>credential.h(31): Error C1083 : Cannot open include file: 'objc/objc.h': No such file or directory
Sarmat
Hmm, it can't find objc.h because it's supposed to be in ios
Okay, well, I think we should stop racking our brains now. I’d rather give up SDK and use REST. Thank you very much for your help! And sorry for wasting your time. Good luck in everything!
Sarmat
I mean, you're building the project for ios. It needs to build on xcode which will provide objc.h as a platform
Yeah, i understand. But i don't have iOS device and this will be waste of time. I'll drop this idea at this moment.
Manav
But it's your decision in the end.
Sarmat
But it's your decision in the end.
Okey, ty for all. I will think about it
Manav
I linked it by Unreal Build Tool. this is function where i taking all static libraries private List<string> GetStaticLibraries() { List<string> Output = new List<string>(); if (Target.Platform == UnrealTargetPlatform.Win64) { Output.AddRange(new[] { Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_analytics.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_app.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_app_check.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_auth.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_database.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_dynamic_links.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_firestore.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_functions.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_gma.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_installations.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_messaging.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_remote_config.lib"}), Path.Combine(new[] {"VS2019", "MD", "x64", "Release", "firebase_storage.lib"}) }); } // and other stuff, telegram does not allow me to send message bigger return Output; }
Hmm i looked at firebase. You're linking the windows libs here. You should be linking target specific libs. For instance, for android the libs are in $FIREBASE_CPP_SDK_DIR/libs/android/<abi>/
Manav
Those shared windows libs at $FIREBASE_CPP_SDK_DIR/libs/windows/VS2019/MD/x64/Release are for desktop workflow
Manav
What you did incorrectly is to not add a desktop version of firebase configurarion file.
\Device\NUL
https://github.com/neosmart/pevents
MᏫᎻᎯᎷᎷᎬᎠ
Is it possible to redirect input coming from some std::istream to some std::ostream?
nami
Is it possible to redirect input coming from some std::istream to some std::ostream?
https://www.geeksforgeeks.org/dup-dup2-linux-system-call/amp/
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
Is there any library for it?
Danya🔥
Is it possible to redirect input coming from some std::istream to some std::ostream?
Here is answer from ChatGPT: Yes, it is possible to redirect input from an std::istream to an std::ostream in C++. This is commonly done using a loop that reads from the istream and writes to the ostream. Here's a simple example using C++ standard streams: #include <iostream> int main() { std::istream& input = std::cin; // This could be any input stream, e.g., a file stream std::ostream& output = std::cout; // This could be any output stream, e.g., a file stream char buffer[256]; while (input.getline(buffer, 256)) { output << buffer << std::endl; } return 0; } In this example, input and output are references to std::cin and std::cout, respectively. The program reads lines from the input stream and writes them to the output stream. You can modify this to use other types of streams, like file streams (std::ifstream and std::ofstream), by changing the initialization of input and output.
MᏫᎻᎯᎷᎷᎬᎠ
What I'm looking for is something related to streambuf class
nami
So there is no standard way to do this
Not aware of C++ way this was the C way
MᏫᎻᎯᎷᎷᎬᎠ
What I'm looking for is something related to streambuf class
You can redirect std::ostream to another std::ostream Using rdbuf std::ofstream out("file.txt"); std::cout.rdbuf(out.rdbuf()); std::cout << "This line goes to the file.txt";
2foryou
Hello I am working on an MFC app I want to create the following usage scenario Go to windows file explorer Select many files of .txt Hit ENTER and open all files in one instance of the MFC APP Can anyone give me instructions or a helpful link? Thanks in advance
Chat Boss
Ighor July sent a code, it has been re-uploaded as a file
2foryou
VD
It is apparently possible to leak memory in C++ without calling new and just using the standard libraries. I just found out about it. And this is not implementation specific either. This happens on all implementations. https://youtu.be/LKKmPAQFNgE
Pavel
It is apparently possible to leak memory in C++ without calling new and just using the standard libraries. I just found out about it. And this is not implementation specific either. This happens on all implementations. https://youtu.be/LKKmPAQFNgE
Hm, he calls front() on an empty vector, it is UB. In other words, some containers have some functions that have preconditions. If the preconditions are not satisfied when the function is called, the program enters UB (undefined behavior). And after UB is entered, no valid behavior is guaranteed anymore (in any place of the program).
VD
Yes but there is no mistake in this
VD
Could you please share a recap? I'm unable to watch the video, but interested
Ok as soon as I go home. Not able to do it from a phone
Rose
Reported anas Saliu [6834433408] to admins.​​​​​​​​​​​
VD
Could you please share a recap? I'm unable to watch the video, but interested
#include <vector> struct V : std::vector<V>{}; int main(){ V v; v.emplace_back(); v.swap(v.front()); } That is it.
VD
Once the swap is done, v points to an empty vector while v.front() the original element points to the heap allocated memory of emplace_back. So at the end of the scope, there is nothing to be done by destructor of v and the heap allocated memory is leaked
VD
If the derivation from std::vector bothers you, you can as well make std::vector a member of struct V and call it child and replace all occurrences of v in the above code with v.child and this problem happens still. This guy Bjorn Fahller has 100s of such snippets that all lead to memory leaks without using new.
Pavel
Detached threads also can leak if they never stop
MᏫᎻᎯᎷᎷᎬᎠ
You can redirect std::ostream to another std::ostream Using rdbuf std::ofstream out("file.txt"); std::cout.rdbuf(out.rdbuf()); std::cout << "This line goes to the file.txt";
Okay So, I'm trying to manipulate the I/O buffer redirection I want std::cin to read from std::cout buffer My idea of doing this is: std::cout << std::nouintbuf; // disable the auto-buffering, so std::cin can read the data from the buffer std::cin.rdbuf(std::cout.rdbuf()); //std::cin shares std::cout buffer std::cout << "Hello\n"; std::string line; std::cin >> line; // line now should have the value 'Hello' But that apparently doesn't work std::cin doesn't block for reading, but the variable line is remains empty
MᏫᎻᎯᎷᎷᎬᎠ
Any idea of how to accomplish this or I'm missing something?
klimi
Any idea of how to accomplish this or I'm missing something?
if you are running under terminal i think that it only sends to cin on \n ( I could be wrong tho)... oh it's only in the program... i don't know then :(