Decorated names prefix
-
Hi, In order to avoid naming conflicts between different libraries, and avoiding changing names to functions, is there any way to add some "prefix" or suffix to the decorated name that the compiler generates, via, for e.g., a #pragma? I don't believe it is possible, but if it is, please post the answer. Best regards, Mauro.
-
Hi, In order to avoid naming conflicts between different libraries, and avoiding changing names to functions, is there any way to add some "prefix" or suffix to the decorated name that the compiler generates, via, for e.g., a #pragma? I don't believe it is possible, but if it is, please post the answer. Best regards, Mauro.
-
Hi, In order to avoid naming conflicts between different libraries, and avoiding changing names to functions, is there any way to add some "prefix" or suffix to the decorated name that the compiler generates, via, for e.g., a #pragma? I don't believe it is possible, but if it is, please post the answer. Best regards, Mauro.
-
Hi, I'm making a personal library for handling images, videos and some other stuff. I use the code of libpng, and libtheora for example. In theora there is a function named "cpu_init" and I haven't conflicts for now but you see it has a "common" name that can be used in other libraries or by me if I have no deep knowledge of internal functions. I wish to add the "theora_" prefix to all functions in libtheora to prevent potential conflicts. If there is no way I should change the names manually. Best regards, Mauro.
-
Hi, Yes it would but namespaces works in C++ and many libraries are in plain C. Best regards, Mauro.
-
Hi, I'm making a personal library for handling images, videos and some other stuff. I use the code of libpng, and libtheora for example. In theora there is a function named "cpu_init" and I haven't conflicts for now but you see it has a "common" name that can be used in other libraries or by me if I have no deep knowledge of internal functions. I wish to add the "theora_" prefix to all functions in libtheora to prevent potential conflicts. If there is no way I should change the names manually. Best regards, Mauro.
Mauro Leggieri wrote:
I wish to add the "theora_" prefix to all functions in libtheora
what about prefixing - like Roger suggested - to prefix with
theora::
instead ?
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
Hi, Yes it would but namespaces works in C++ and many libraries are in plain C. Best regards, Mauro.
if you code in C++, there's no problem... you can import C functions inside it then what do you think the standard C++ library does with the C runtime functions into the std:: namespace ? -- modified at 14:30 Tuesday 20th March, 2007
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
if you code in C++, there's no problem... you can import C functions inside it then what do you think the standard C++ library does with the C runtime functions into the std:: namespace ? -- modified at 14:30 Tuesday 20th March, 2007
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
Each C source files in theora generates a .obj file with the possible conflicting public symbols. Encapsulating inside a C++ object doesn't hide public symbols from original theora compiled object files. Code is opensource so I can make things like changing function names but I wish to avoid that in order to make updates easily when there are new versions available. Greetings, Mauro
-
Each C source files in theora generates a .obj file with the possible conflicting public symbols. Encapsulating inside a C++ object doesn't hide public symbols from original theora compiled object files. Code is opensource so I can make things like changing function names but I wish to avoid that in order to make updates easily when there are new versions available. Greetings, Mauro
you don't get it. process in 2 steps. firstly, generate a library which will present the theora in your namespace. then, use this "new" library, which won't generate name duplicates anymore, due to the namespace...
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
you don't get it. process in 2 steps. firstly, generate a library which will present the theora in your namespace. then, use this "new" library, which won't generate name duplicates anymore, due to the namespace...
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
Thanks Toxcct 4 answering. Can you explain me more detailed? Imagine I have a C function named myfunc in test1.c Then test1.lib will contain the module test1.obj that contains the _myfunc public symbol. On the other side, another function with the same name but in test2.lib When I link the app with test1.lib and test2.lib the linker gives an error in test2.lib(test2.obj) because _myfunc is already defined in test1.lib(test1.obj) I didn't find to hide test1.obj from the visibility of test2.obj, no matters if it is inside a .lib Best regards, Mauro.