Posts

Showing posts with the label googletest

SFML, Google Test and Visual Studio

SFML, Google Test and Visual Studio I'm new on this site, so be gentle with me. I've made a project using visual studio 2017 and SFML. I need to add a google test project and I don't know how to set up correctly both SFML and gtest. When I try it using some tutorial online I get the error LINK2019, but this problem occurs only when I create a test.cpp that uses SFML elements that come from my main project. Also, my project needs to be an exe and cannot be converted to lib (I've also tried that option). If someone can help or link to a good tutorial for this I really appreciated. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

is it possible to overwrite strdup from with my own?

is it possible to overwrite strdup from <string.h> with my own? I need to do so because I am supposed to stub this function for unit testing. I am using gcc version 5.4.0. for a lot of other functions that exist in glibc like memcpy I simply wrote the implementation in my .c file and then this implementation was the one used instead of the original, but in case of strdup and some other function I get a compilation error like this one: error: expected identifier or ‘(’ before ‘__extension__’ char* strdup (const char *__s) I know this is because I am trying to use a function name that already exist in string.h although it works with some other functions in their as well. I wish to know if it is possible to bypass this somehow. Welcome to stackoverflow.com. Please take some time to read the help pages, especially the sections named "What topics can I ask about here?" and "What types of questions should I avoid asking?". Also please t...