-5

Basically, I'm trying to compile CEF on VS2008 EE.

The IDE complains that it cannot find atlbase.h. During some research, I've found this reference. Considering this isn't the first time I gave C++ another chance, I wasn't really surprised I had the WinSDK installed already. But of course, the IDE doesn't know this and the SDK registration tool doesn't seem to work (even if it says it does).

So, I went to the project options and force-added the paths to the WinSDK source folders. That helped me get rid of the "atlbase.h not found" error. Instead, I started having multiple errors; 33 in fact, some of which were quite cryptic complaining things like _Module was not defined.

These are the errors:

Compiling...
uiplugin_test.cpp
uiplugin.cpp
string_util.cpp
scheme_test.cpp
resource_util_win.cpp
plugin_test.cpp
SDK\Include\atl\atlwin.h(65) : error C2065: '_Module' : undeclared identifier
SDK\Include\atl\atlwin.h(79) : error C2065: '_Module' : undeclared identifier
SDK\Include\atl\atlwin.h(155) : error C2065: '_Module' : undeclared identifier
SDK\Include\atl\atlwin.h(155) : error C2228: left of '.GetModuleInstance' must have class/struct/union
        type is ''unknown-type''
SDK\Include\atl\atlwin.h(168) : error C2065: '_Module' : undeclared identifier
SDK\Include\atl\atlwin.h(168) : error C2228: left of '.GetModuleInstance' must have class/struct/union
        type is ''unknown-type''
SDK\Include\atl\atlwin.h(1753) : error C2065: 'i' : undeclared identifier
SDK\Include\atl\atlwin.h(1753) : error C2065: 'i' : undeclared identifier
SDK\Include\atl\atlwin.h(1753) : error C2065: 'i' : undeclared identifier
SDK\Include\atl\atlwin.h(1755) : error C2065: 'i' : undeclared identifier
SDK\Include\atl\atlwin.h(1757) : error C2065: 'i' : undeclared identifier
SDK\Include\atl\atlwin.h(2979) : error C2065: '_Module' : undeclared identifier
SDK\Include\atl\atlwin.h(2979) : error C2228: left of '.GetModuleInstance' must have class/struct/union
        type is ''unknown-type''
SDK\Include\atl\atlwin.h(3058) : error C2065: '_Module' : undeclared identifier
SDK\Include\atl\atlwin.h(3058) : error C2228: left of '.GetModuleInstance' must have class/struct/union
        type is ''unknown-type''
osrplugin_test.cpp
osrplugin.cpp
extension_test.cpp
download_handler.cpp
clientplugin.cpp
SDK\Include\atl\atlwin.h(65) : error C2065: '_Module' : undeclared identifier
SDK\Include\atl\atlwin.h(79) : error C2065: '_Module' : undeclared identifier
SDK\Include\atl\atlwin.h(155) : error C2065: '_Module' : undeclared identifier
SDK\Include\atl\atlwin.h(155) : error C2228: left of '.GetModuleInstance' must have class/struct/union
        type is ''unknown-type''
SDK\Include\atl\atlwin.h(168) : error C2065: '_Module' : undeclared identifier
SDK\Include\atl\atlwin.h(168) : error C2228: left of '.GetModuleInstance' must have class/struct/union
        type is ''unknown-type''
SDK\Include\atl\atlwin.h(1753) : error C2065: 'i' : undeclared identifier
SDK\Include\atl\atlwin.h(1753) : error C2065: 'i' : undeclared identifier
SDK\Include\atl\atlwin.h(1753) : error C2065: 'i' : undeclared identifier
SDK\Include\atl\atlwin.h(1755) : error C2065: 'i' : undeclared identifier
SDK\Include\atl\atlwin.h(1757) : error C2065: 'i' : undeclared identifier
SDK\Include\atl\atlwin.h(2979) : error C2065: '_Module' : undeclared identifier
SDK\Include\atl\atlwin.h(2979) : error C2228: left of '.GetModuleInstance' must have class/struct/union
        type is ''unknown-type''
SDK\Include\atl\atlwin.h(3058) : error C2065: '_Module' : undeclared identifier
SDK\Include\atl\atlwin.h(3058) : error C2228: left of '.GetModuleInstance' must have class/struct/union
        type is ''unknown-type''
client_popup_handler.cpp
client_handler_win.cpp
client_handler.cpp
cefclient_win.cpp
.\cefclient_win.cpp(296) : error C3861: 'wcscpy_s': identifier not found
cefclient.cpp
SDK\Include\crt\utility(21) : error C2536: 'std::pair<_T1,_T2>::std::pair<_T1,_T2>::first' : cannot specify explicit initializer for arrays
        with
        [
            _T1=const char [12],
            _T2=const char [16]
        ]
        SDK\Include\crt\utility(24) : see declaration of 'std::pair<_T1,_T2>::first'
        with
        [
            _T1=const char [12],
            _T2=const char [16]
        ]
        SDK\Include\crt\utility(20) : while compiling class template member function 'std::pair<_T1,_T2>::pair(_T1 (&),_T2 (&))'
        with
        [
            _T1=const char [12],
            _T2=const char [16]
        ]
        .\cefclient.cpp(92) : see reference to class template instantiation 'std::pair<_T1,_T2>' being compiled
        with
        [
            _T1=const char [12],
            _T2=const char [16]
        ] SDK\Include\crt\utility(21) : error C2536: 'std::pair<_T1,_T2>::std::pair<_T1,_T2>::second' : cannot specify explicit initializer for arrays
        with
        [
            _T1=const char [12],
            _T2=const char [16]
        ]
        SDK\Include\crt\utility(25) : see declaration of 'std::pair<_T1,_T2>::second'
        with
        [
            _T1=const char [12],
            _T2=const char [16]
        ]
binding_test.cpp
Community
  • 1
  • 1
Christian
  • 27,509
  • 17
  • 111
  • 155
  • 2
    Your problems are with third party libraries (i.e. Windows) not C++ itself. Clean install of up to date software would be my recomendation. Windows is quite sensitive about mixing and matching incompatible versions of things. – john Aug 09 '11 at 21:14
  • 1
    Check out this: http://stackoverflow.com/questions/6979918/compile-atl-project-with-only-windows-sdk-7-1/6983388#6983388 – Nemanja Trifunovic Aug 09 '11 at 21:18
  • Having just read the installation instructions for CEF I can see it recommends **VERY** specific versions of everything. Did you follow all the instructions? Anyway impossible to help with the given information. Sorry. – john Aug 09 '11 at 21:19
  • 1
    I would guess that in the WinSDK source folders are older/newer versions of files that are also in the default Visual Studio includes, and they are conflicting. Being a fanboy, I must add that this problem can happen in pretty much any language with source code in multiple files. – Mooing Duck Aug 09 '11 at 21:19
  • You cannot get this going with the Express version of Visual Studio. The ATL version you dug up is badly outdated and more than likely not compatible with CEF. You'll need the retail edition to get the up to date version of ATL. Consider using the trial edition. – Hans Passant Aug 09 '11 at 21:32
  • @john - True, but but that's what you get from "bitching about whole OSes built in C++", it makes it part of the package, and the concern is just as fair as I would complain about PHP if it failed on a specific server configuration - it's technically not PHP's fault. – Christian Aug 09 '11 at 22:40
  • Yes, I did follow up CEF's instructions to the letter. Again, having all these build issues is a mess which throughout the years I've easily associated with C++ software builds, even when completely unrelated to Windows. – Christian Aug 09 '11 at 22:46
  • @MooingDuck - No language I know of knowingly loads conflicting source files. There are easy and well-defined mechanisms to avoid these kinds of issues. – Christian Aug 09 '11 at 22:47
  • @HansPassent - You've got a point there, even if the documentation said I could be building this over MSVS EE. This teaches me the lesson that I should assume C++ build instructions are generally lies. Not that they were accurate in the past... – Christian Aug 09 '11 at 22:49
  • `I should assume C++ build instructions are generally lies` 0/10 bad troll is bad. – ta.speot.is Aug 09 '11 at 22:56
  • Huh? I'll call it trolling when the statement is false, which clearly isn't... – Christian Aug 09 '11 at 23:09
  • 2
    Please provide evidence to support your statement that C++ build instructions are generally lies. For example, evidence that 51% of C++ build instructions are wrong. – ta.speot.is Aug 10 '11 at 01:04
  • From the 4 major builds I've had the misfortune to work with, all of them failed horribly (CEF, WKHTMLTOX, PHP and some OS libs). That makes it 100% (but of course this ain't a realistic rate). – Christian Aug 10 '11 at 05:13
  • Well maybe you need to employ an expert (seriously). C++ is really a conspiracy to keep us all in jobs. – john Aug 10 '11 at 07:07
  • @john - And that is the exact reply you get from a C++ fanboy that got stuck without a reply. Let's face it, if you complain as such over VB you get upvoted, but doing the same for C++ you get downvoted. A wise expert would say that each have their downfalls and probably agree with my answer below. John, I've compiled my fair share of C/C++ sources and they're by far the most difficult to set up in any other language I know. Even Assembler is less cryptic by this standard. **Yet, I'm not allowed to complain, 'coz if I do, I'm a C++ hater, and you gotta flame the haters...** – Christian Aug 11 '11 at 22:30
  • @Christian: Wow, it was a joke. Sorry I couldn't solve your problem, but it wasn't the kind of question that could be solved in a forum like this. – john Aug 12 '11 at 16:58
  • @christian - please can you cool it with the c++ complaints, all you're doing is fanning the flames for a potential flame war. Stick to the problem on hand and don't blame the tools. This way you're more likely to get assistance from the rather excellent c++ community who participate on Stack Overflow. – Kev Aug 13 '11 at 00:23

2 Answers2

-1

Have you tried following Chromium's Build Instructions (Windows)? In particular the section under Additional (free) downloads that deals with Visual Studio 2008 Express (item 4 here).

Christian
  • 27,509
  • 17
  • 111
  • 155
Frank Boyne
  • 4,400
  • 23
  • 30
  • Did you download the Windows SDK or the Windows Driver Kit? – ta.speot.is Aug 10 '11 at 01:07
  • Yes (both), as well as DirectX SDK. – Christian Aug 10 '11 at 05:08
  • From your error messages it says that `SDK\Include\atl\...` have all the errors but the Chromium build instructions say that the path to ATL is `include\atl71` - so I'm assuming you have your include folders set up wrong? Possibly the order in which you have defined. – ta.speot.is Aug 10 '11 at 05:34
  • That is indeed strange... But they are set up correctly with regards to the install. `SDK` is a relative path to Windows SDK 7.1 – Christian Aug 10 '11 at 06:17
  • Well the instructions say the `include\atl71` path is from the Windows Driver Kit not the Windows 7.1 SDK so I'm assuming there's your problem. – ta.speot.is Aug 10 '11 at 06:31
-5

I have found a solution to this problem. A few minutes ago I realized they also have a working version for Delphi.

After a couple of minutes, I got my Delphi install configured with the right paths and now it builds nicely.

Kev
  • 118,037
  • 53
  • 300
  • 385
Christian
  • 27,509
  • 17
  • 111
  • 155
  • -3 for the perfect solution? Now I know where the bias on SO lies. Of course, we're talking about the Almighty C++ Language, and just as you can't swear at God, you can't complain against the Almighty Language. – Christian Aug 11 '11 at 22:32
  • this answer is just flamebait so you can't really expect anything other than a raft of downvotes. I think you need to take a chill-pill and think before committing words like these to the community. We expect posts to be "constructive" and not mini-rants about tooling or some perceived bias by our community. Thanks. – Kev Aug 13 '11 at 00:29
  • @Kev I think making a note that "C++ fails miserably and that switching to alternatives is better", is actually constructive. I don't think I should be blamed, since I gave C++ ample time-share (3 working days), yet Delphi (the supposedly dead language) exceeded all expectations. What is infuriating is that C++ coders seem to think that forced (and absolutely unnecessary) hardships like this make you a better programmer. Sometimes I wonder who's instructing who when it comes to computers and programmers.. – Christian Aug 13 '11 at 00:36
  • @Kev That also reminds me, if it were me, I wouldn't use tools that sporadically attempt to chop off parts of my body. Dunno about C++ programmers. You'd think by now there wouldn't be any left as a whole... – Christian Aug 13 '11 at 00:39
  • No that is not constructive language, that's just noise and is not welcome. We expect our users to rise above such language, we're here to solve problems and not listen to people complain about tools. – Kev Aug 13 '11 at 00:49