User forums > Using Code::Blocks

#pragma comment

(1/2) > >>

pjmavcom:
Hi. New to C::B here, but I find it pretty impressive so far. Ive been working in VC++ for a while and Ive been using
--- Code: ---#pragma comment(lib, "ddraw.lib")
--- End code ---
and
--- Code: ---#pragma comment(lib, "dxguid.lib")
--- End code ---
so I dont have to add the files to every project I make. Copying these files into C::B now it throws out a warning saying its ignoring #pragma statements.
How could I get around this, and enable the use of those #pragma statements? Or where would I need to go to add these files to the project?
Thanks in advance.

stahta01:
What compiler are you using?
I think those pragmas only works on MSVC.

Tim S

pjmavcom:
Im using the GCC compiler. Ill try the MSVC compiler after work and see. I thought it mightve been something to do with the files the project needs to know about. In MSVC you can add these libs in the project properties somewhere. Thats kinda what I was looking for in C::B. Or an alternative to #pragma. Thanks for the tip.

stahta01:
I am guessing that the comment pragma just adds the libraries. Under C::B adding Libraries is done like this.

Project -> Build Options
Tab "Linker Settings"
Try adding the Libraries under "Link Libraries"

I would try the names of listed below, GCC does not use .lib extension, and see if they work.
ddraw
dxguid


Tim S

thomas:
This is non-standard stuff only supported by MSVC. Using that compiler is the only way to make it work.

Navigation

[0] Message Index

[#] Next page

Go to full version