Compiling cURL Source In Application

Hi all, I was wondering if anyone has done something similar and could help me out with this. I have an app that uses cURL and have written some pretty nice wrapper classes to enable synchronous and asynchronous transfers with optional listeners etc. I was going to upload these as part of a module but I may share sooner if anyone’s interested.

My problem is that on the Mac cURL is a dream to work with as its already installed by the OS so I just need to add the lib and include the system path header. On Windows I am really struggling, I’ve tried about 6 different ways to get cURL complied and linked with my project with no luck. What I really wan’t to do is include the cURL source files directly a’la ogg and flac etc. to make the classes not have any external dependancies. When I try this method I get about 7000 erros which I think basically means something went wrong.

I have searched the forum and it seems a lot of people are using cURL. Has anybody included it using this method or knows how to? If not how are they including cURL on windows?

Any help or example Introjucer projects would be greatly appreciated.
Dave.

Hi Dave.

Adding a cURL module would be great!

The way I choose to add cURL is to create a non-Juce class LibCurlProxy which includes <curl/curl.h> in it’s cpp file and to include
it in my Juce project.

Some other useful stuff:

  • You need to make sure that you compile the libCurl project with the same Runtime Library as your Juce project (C/C++ -> Code Generation -> Runtime Library)
  • I’m using cURL as a static lib so I have CURL_STATICLIB in my preprocessor definitions.
  • I’m only using HTTP so I have HTTP_ONLY in the libCurl’s preprocessor definitions (disables all protocols except HTTP).

Hi Shlomi thanks for the reply,

How are you building the static lib of cURL in the first place? I’ve tried downloading the source and building the “libcurl.vcproj” project there. Are you setting any pre-processor definitions there? I need ftp support but my tests fail even with HTTP_ONLY. The project builds ok and I get a libcurl.lib file generated in both /Debug and /Release folders. So far so good.

Now to test the library I create a simple console application (similar to http://curl.haxx.se/libcurl/c/https.html but with a valid address).
Add the include folder of the curl library to my header search paths (to find <curl/curl.h>).
Add the lib folder of the curl library to my library search paths (to find libcurl.dll).
Add CURL_STATICLIB to my pre-processor definitions.

Link fails with 22 unresolved symbols, mainly relating to socket, send, recv etc. all common symbols that should be included in all configurations. The runtime library’s are the same.

Thanks again for the help.

I’ve attached the vcxproj files.

Maybe If you’ll post the errors I’ll be able to know more about what’s wrong.
I’m using curl-7.21.6

If you would like I’ll send you the whole curl project using dropbox or something like that.

Thanks, unfortunately I can’t find a 7.21.6 version of curl and v7.21.7 & the latest 7.23.1 don’t have the hostares.c or hostthre.c files. If I remove them from the project it compiles but I get the same linker errors when building the sample app. These are:

1>------ Build started: Project: testproject2, Configuration: Debug Win32 ------ 1> testproject2.cpp 1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtSetCheckCount already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(tolower.obj) : error LNK2005: _tolower already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(sprintf.obj) : error LNK2005: _sprintf already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRTD.lib(cinitexe.obj) 1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRTD.lib(cinitexe.obj) 1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRTD.lib(cinitexe.obj) 1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRTD.lib(cinitexe.obj) 1>LIBCMTD.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(dbgrptw.obj) : error LNK2005: __CrtDbgReportW already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(strtol.obj) : error LNK2005: _strtol already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(strtol.obj) : error LNK2005: _strtoul already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(strtoq.obj) : error LNK2005: __strtoi64 already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(_file.obj) : error LNK2005: ___iob_func already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(fflush.obj) : error LNK2005: _fflush already defined in MSVCRTD.lib(MSVCR100D.dll) 1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj) 1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj) 1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library 1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library 1>libcurl.lib(easy.obj) : error LNK2019: unresolved external symbol _Curl_resolver_global_init referenced in function _curl_global_init 1>libcurl.lib(easy.obj) : error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function _win32_init 1>libcurl.lib(easy.obj) : error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function _win32_init 1>libcurl.lib(easy.obj) : error LNK2019: unresolved external symbol _Curl_resolver_global_cleanup referenced in function _curl_global_cleanup 1>libcurl.lib(easy.obj) : error LNK2019: unresolved external symbol _Curl_resolver_duphandle referenced in function _curl_easy_duphandle 1>libcurl.lib(hostip.obj) : error LNK2019: unresolved external symbol _Curl_resolver_is_resolved referenced in function _Curl_resolv 1>libcurl.lib(multi.obj) : error LNK2001: unresolved external symbol _Curl_resolver_is_resolved 1>libcurl.lib(url.obj) : error LNK2019: unresolved external symbol _Curl_resolver_cleanup referenced in function _Curl_close 1>libcurl.lib(url.obj) : error LNK2019: unresolved external symbol _Curl_resolver_init referenced in function _Curl_open 1>libcurl.lib(url.obj) : error LNK2019: unresolved external symbol _Curl_resolver_cancel referenced in function _conn_free 1>libcurl.lib(transfer.obj) : error LNK2019: unresolved external symbol _Curl_resolver_wait_resolv referenced in function _Curl_reconnect_request 1>libcurl.lib(connect.obj) : error LNK2001: unresolved external symbol _Curl_resolver_wait_resolv 1>libcurl.lib(socks.obj) : error LNK2001: unresolved external symbol _Curl_resolver_wait_resolv 1>libcurl.lib(transfer.obj) : error LNK2019: unresolved external symbol __imp__WSAGetLastError@0 referenced in function _Transfer 1>libcurl.lib(sendf.obj) : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0 1>libcurl.lib(connect.obj) : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0 1>libcurl.lib(select.obj) : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0 1>libcurl.lib(sendf.obj) : error LNK2019: unresolved external symbol __imp__send@16 referenced in function _Curl_send_plain 1>libcurl.lib(sendf.obj) : error LNK2019: unresolved external symbol __imp__recv@16 referenced in function _Curl_recv_plain 1>libcurl.lib(connect.obj) : error LNK2001: unresolved external symbol __imp__recv@16 1>libcurl.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__getsockname@12 referenced in function _Curl_updateconninfo 1>libcurl.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__getpeername@12 referenced in function _Curl_updateconninfo 1>libcurl.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__ntohs@4 referenced in function _getaddressinfo 1>libcurl.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__WSASetLastError@4 referenced in function _Curl_is_connected 1>libcurl.lib(curl_addrinfo.obj) : error LNK2001: unresolved external symbol __imp__WSASetLastError@4 1>libcurl.lib(select.obj) : error LNK2001: unresolved external symbol __imp__WSASetLastError@4 1>libcurl.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__getsockopt@20 referenced in function _verifyconnect 1>libcurl.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__setsockopt@20 referenced in function _Curl_sndbufset 1>libcurl.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__connect@12 referenced in function _singleipconnect 1>libcurl.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__socket@12 referenced in function _singleipconnect 1>libcurl.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__bind@12 referenced in function _bindlocal 1>libcurl.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__htons@4 referenced in function _bindlocal 1>libcurl.lib(curl_addrinfo.obj) : error LNK2001: unresolved external symbol __imp__htons@4 1>libcurl.lib(connect.obj) : error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function _Curl_closesocket 1>libcurl.lib(curl_addrinfo.obj) : error LNK2019: unresolved external symbol __imp__freeaddrinfo@4 referenced in function _Curl_getaddrinfo_ex 1>libcurl.lib(curl_addrinfo.obj) : error LNK2019: unresolved external symbol __imp__getaddrinfo@16 referenced in function _Curl_getaddrinfo_ex 1>libcurl.lib(hostasyn.obj) : error LNK2019: unresolved external symbol _Curl_resolver_getaddrinfo referenced in function _Curl_getaddrinfo 1>libcurl.lib(multi.obj) : error LNK2019: unresolved external symbol _Curl_resolver_getsock referenced in function _multi_getsock 1>libcurl.lib(select.obj) : error LNK2019: unresolved external symbol ___WSAFDIsSet@8 referenced in function _Curl_socket_ready 1>libcurl.lib(select.obj) : error LNK2019: unresolved external symbol __imp__select@20 referenced in function _Curl_socket_ready 1>libcurl.lib(nonblock.obj) : error LNK2019: unresolved external symbol __imp__ioctlsocket@12 referenced in function _curlx_nonblock 1>libcurl.lib(curl_gethostname.obj) : error LNK2019: unresolved external symbol __imp__gethostname@8 referenced in function _Curl_gethostname 1>LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup 1>C:\Users\Dave\Downloads\curl\testproject2\Debug\testproject2.exe : fatal error LNK1120: 33 unresolved externals

I’ve pm’d you my email. if you could send the project that would be brilliant.
Cheers.

Don’t you need to link against ws2_32.lib ?

Cheers Vinn, just tried that. It gets rid of quite a few symbol errors, I’m still left with these.

1>------ Build started: Project: testproject2, Configuration: Debug Win32 ------ 1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtSetCheckCount already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(tolower.obj) : error LNK2005: _tolower already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(sprintf.obj) : error LNK2005: _sprintf already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRTD.lib(cinitexe.obj) 1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRTD.lib(cinitexe.obj) 1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRTD.lib(cinitexe.obj) 1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRTD.lib(cinitexe.obj) 1>LIBCMTD.lib(crt0.obj) : error LNK2005: _mainCRTStartup already defined in MSVCRTD.lib(crtexe.obj) 1>LIBCMTD.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(dbgrptw.obj) : error LNK2005: __CrtDbgReportW already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(strtol.obj) : error LNK2005: _strtol already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(strtol.obj) : error LNK2005: _strtoul already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(strtoq.obj) : error LNK2005: __strtoi64 already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(_file.obj) : error LNK2005: ___iob_func already defined in MSVCRTD.lib(MSVCR100D.dll) 1>LIBCMTD.lib(fflush.obj) : error LNK2005: _fflush already defined in MSVCRTD.lib(MSVCR100D.dll) 1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj) 1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj) 1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library 1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library 1>libcurl.lib(easy.obj) : error LNK2019: unresolved external symbol _Curl_resolver_global_init referenced in function _curl_global_init 1>libcurl.lib(easy.obj) : error LNK2019: unresolved external symbol _Curl_resolver_global_cleanup referenced in function _curl_global_cleanup 1>libcurl.lib(easy.obj) : error LNK2019: unresolved external symbol _Curl_resolver_duphandle referenced in function _curl_easy_duphandle 1>libcurl.lib(hostip.obj) : error LNK2019: unresolved external symbol _Curl_resolver_is_resolved referenced in function _Curl_resolv 1>libcurl.lib(multi.obj) : error LNK2001: unresolved external symbol _Curl_resolver_is_resolved 1>libcurl.lib(url.obj) : error LNK2019: unresolved external symbol _Curl_resolver_cleanup referenced in function _Curl_close 1>libcurl.lib(url.obj) : error LNK2019: unresolved external symbol _Curl_resolver_init referenced in function _Curl_open 1>libcurl.lib(url.obj) : error LNK2019: unresolved external symbol _Curl_resolver_cancel referenced in function _conn_free 1>libcurl.lib(transfer.obj) : error LNK2019: unresolved external symbol _Curl_resolver_wait_resolv referenced in function _Curl_reconnect_request 1>libcurl.lib(connect.obj) : error LNK2001: unresolved external symbol _Curl_resolver_wait_resolv 1>libcurl.lib(socks.obj) : error LNK2001: unresolved external symbol _Curl_resolver_wait_resolv 1>libcurl.lib(hostasyn.obj) : error LNK2019: unresolved external symbol _Curl_resolver_getaddrinfo referenced in function _Curl_getaddrinfo 1>libcurl.lib(multi.obj) : error LNK2019: unresolved external symbol _Curl_resolver_getsock referenced in function _multi_getsock 1>C:\Users\Dave\Downloads\curl\testproject2\Debug\testproject2.exe : fatal error LNK1120: 10 unresolved externals ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

It looks like its still not finding the curl symbols and I’m not sure where all these ms ones are being included twice. I can’t find any sign of either MSVCRTD.lib or MSVCR100D.dll in the linker section of the project properties.

Now you have a problem that you are mixing standard C runtimes. Visit each library and check that you are either using Multithreaded, or Multithreaded DLL for all of them. You cannot use both in a project. All object files must have the same setting for “Runtime” - either all DLL or all static.

Worth 1,000 words:

[attachment=0]vs_language.gif[/attachment]

Ah, thanks again, Shlomi did mention that in his original post. Must have missed it when I created a new project for testing.

Just the cURL symbols missing now, must not be building or finding the library properly, I’ll keep digging.

Almost there…

Right, I’ve finally got this working from scratch with the help of Shlomi’s example projects. The following instructions should enable you to download the latest cURL source code and create a Juce application using it fairly simply. I will post again soon with an example project and some cURL classes once I tidy them up and maybe put this into the Wiki.

This will suffice for now, perhaps I’ll revisit the source code idea later. Thanks to all those who helped me get this sorted!

Build static cURL Libraray:

  1. Download latest source

  2. Open “/lib/libcurl.vcproj”

  3. Open “Configuration Manager”

  4. Create a new configuration for LIB_Debug and LIB_Release copied from the relevant exisiting configuration

  5. Open Project Properties/C/C++

  6. Under Preprocessor Definitions remove _USRDLL and add CURL_STATICLIB

  7. Under Code Generation change Runtime library to Multi-threaded Debug and Multi-threaded respectively

  8. You could also change the “Ouput Files” names to LIB_Debug etc.

  9. Also you could change the Output directory & target name to include debug or release eg. $(ProjectName)debug

Configure Juce Project:

  1. Create normal project using Introjucer

  2. Under your “Source” folder create a new folder called “curl”

  3. Copy into that the curl include folder (curl-x.xx.x/include) and delete all the make files

  4. Create a new folder called lib and copy into that your built library files i.e. libcurldebug.lib and libcurlrelease.lib

  5. Folder structure should look like:
    Source
    curl
    include
    curl
    lots of .h files
    lib
    libcurldebug.lib
    libcurlrelease.lib

  6. Edit project settings:

  • Project Properties -> VC++ Directories
    -> Include Directories:
    “Source/curl/include” (to use <curl/curl.h>)
    -> Library Directories
    "Source/curl/lib" (to find libcurlrelease.lib & libcurldebug.lib)

  • Project Properties -> C/C++ -> Preprocessor Definitions
    CURL_STATICLIB

  • Project Properties -> C/C++ -> Code Generation -> Runtime Library:
    Multi-threaded /MT

  • Project Properties -> Linker -> Command Line -> Additional Options:
    Wldap32.lib
    ws2_32.lib
    libcurlrelease.lib (or libcurldebug.lib)

Some of these options can be set in the Introjucer, you should be able to see where.

I’m sure this thread will be handy for those seeking for advanced communication capabilities, and having a special module
for that will be even better.

I did a curl integration with JUCE some time ago don’t know how current is the code but maybe someone will find it useful. Also i wasn’t linking to the static .lib i just added the curl source files to the project. Here is some of that code i wrote then: http://code.google.com/p/edoapp/source/browse/trunk/?r=476#trunk%2Fsrc%2FLibraries%2Fcurl

I just did this as well. Used the curl-easy libs and compiled with SSL support:
http://www.geek.net.au/curl/

I suspect this is easier than grabbing the official latest source and starting from there … took a couple hours to get through, but pretty straightforward, so worth a look if you are still stuck.

Also, would love to see what you come up with when you get this running. Post something here if possible.

There is still no definitive guide for using LibCurl alongside a JUCE application/plugin on a windows system.   Esp. LibCurl using OpenSSL.   Smh my development experience on OS X was soooo much easier compared to windows!!!!   

 

Can anyone advise?   I've been struggling with getting libCurl to work with JUCE for the past few days. 

This thread is legacy now - the latest version of JUCE has built-in support for libcurl!

Just set JUCE_USE_CURL = 1

does version 3.20 have support for it built in?   i wrote my project with 3.20 and haven't tried compiliing it with 4.x yet. 

 

Also, where do we set that Define??  in the IntroJucer Preprocessor Directives?  in any file in the project?

No, it was more recent, I think. You'd set the define either globally in your project, or in the AppConfig.h file, or in the introjucer's options for that module.

This is only true for Linux, not Windows, right?