Developer forums (C::B DEVELOPMENT STRICTLY!) > Contributions to C::B

How to use pragma for adding resources in codeblocks?


on the linker setting we can choose to add library

what is the equivalent of doing this by writing pragma?

i have tried #pragma comment(lib, object.o)

but it doesnt work But, if i add object from linker setting it's compiled successfully. So i want to know what are the flags. So i can add object  thru the  source code file by writing pragma.

CB 16.07

build log:
main.obj||fatal error LNK1276: invalid directive 'F:\mnr\resource.o' found; does not start with '/'|

#pragma is a compiler directive

codeblocks is not a compiler

If you are using the default installation you are probably using gcc for compilation. gcc does not support this pragmas:

you have to use the msvc compiler to be able to use this kind of pragmas. You can use the msvc compiler within codeblocks if you want...

I see, you are using the msvc...
sadly i do not know anything about this compiler...
did you looked for this:

I am unable to run pragma on codeblock


--- Quote from: BlueHazzard on March 09, 2018, 04:49:21 pm ---#pragma is a compiler directive

codeblocks is not a compiler

--- End quote ---


[0] Message Index

Go to full version